Exemple #1
0
        public clsAttachment CreateAttachment()
        {
            var Result = new clsAttachment();

            Attachments.Add(Result);
            return Result;
        }
Exemple #2
0
        public clsAttachment CopyAttachment(clsAttachment Other)
        {
            var Result = new clsAttachment();

            Result.Pos_Offset = Other.Pos_Offset;
            Attachments.Add(Result);
            Matrix3DMath.MatrixCopy(Other.AngleOffsetMatrix, Result.AngleOffsetMatrix);
            Result.Models.AddSimpleList(Other.Models);
            Result.Attachments.AddSimpleList(Other.Attachments);

            return Result;
        }
Exemple #3
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.AddSimpleList(AttachmentToCopy.Models);
            foreach ( var tempLoopVar_Attachment in AttachmentToCopy.Attachments )
            {
                Attachment = tempLoopVar_Attachment;
                ResultAttachment.AddCopyOfAttachment(Attachment);
            }

            return ResultAttachment;
        }
Exemple #4
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 = new XYZDouble();

            TurretConnector = Body.Attachment.Models[0].Connectors[0];

            if ( TurretCount >= 1 )
            {
                if ( Turret1 != null )
                {
                    var NewTurret = NewBody.AddCopyOfAttachment(Turret1.Attachment);
                    NewTurret.Pos_Offset = 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.Pos_Offset = TurretConnector;
                }
            }
        }