コード例 #1
0
        public void UpdateAttachments()
        {
            BaseAttachment = new clsAttachment();

            if (Body == null)
            {
                AlwaysDrawTextLabel = true;
                return;
            }

            var NewBody = BaseAttachment.AddCopyOfAttachment(Body.Attachment);

            AlwaysDrawTextLabel = NewBody.Models.Count == 0;

            if (Propulsion != null)
            {
                if (Body.ObjectDataLink.IsConnected)
                {
                    BaseAttachment.AddCopyOfAttachment(Propulsion.Bodies[Body.ObjectDataLink.ArrayPosition].LeftAttachment);
                    BaseAttachment.AddCopyOfAttachment(Propulsion.Bodies[Body.ObjectDataLink.ArrayPosition].RightAttachment);
                }
            }

            if (NewBody.Models.Count == 0)
            {
                return;
            }

            if (NewBody.Models[0].ConnectorCount <= 0)
            {
                return;
            }

            var turretConnector = Body.Attachment.Models[0].Connectors[0];

            if (TurretCount >= 1)
            {
                if (Turret1 != null)
                {
                    var newTurret = NewBody.AddCopyOfAttachment(Turret1.Attachment);
                    newTurret.PosOffset = turretConnector;
                }
            }

            if (Body.Attachment.Models[0].ConnectorCount <= 1)
            {
                return;
            }

            turretConnector = Body.Attachment.Models[0].Connectors[1];

            if (TurretCount >= 2)
            {
                if (Turret2 != null)
                {
                    var newTurret = NewBody.AddCopyOfAttachment(Turret2.Attachment);
                    newTurret.PosOffset = turretConnector;
                }
            }
        }
コード例 #2
0
        public clsAttachment CreateAttachment()
        {
            var result = new clsAttachment();

            Attachments.Add(result);
            return(result);
        }
コード例 #3
0
        public clsAttachment CopyAttachment(clsAttachment Other)
        {
            var result = new clsAttachment
            {
                PosOffset = Other.PosOffset
            };

            Attachments.Add(result);
            Matrix3DMath.MatrixCopy(Other.AngleOffsetMatrix, result.AngleOffsetMatrix);
            result.Models.AddRange(Other.Models);
            result.Attachments.AddRange(Other.Attachments);

            return(result);
        }
コード例 #4
0
        public clsAttachment AddCopyOfAttachment(clsAttachment AttachmentToCopy)
        {
            var ResultAttachment = new clsAttachment();
            var Attachment       = default(clsAttachment);

            Attachments.Add(ResultAttachment);
            Matrix3DMath.MatrixCopy(AttachmentToCopy.AngleOffsetMatrix, ResultAttachment.AngleOffsetMatrix);
            ResultAttachment.Models.AddRange(AttachmentToCopy.Models);
            foreach (var tempLoopVar_Attachment in AttachmentToCopy.Attachments)
            {
                Attachment = tempLoopVar_Attachment;
                ResultAttachment.AddCopyOfAttachment(Attachment);
            }

            return(ResultAttachment);
        }