Example #1
0
        private PartAttachment AddPartAttachment(Vector3 position, TransformFollower.Transformable target, bool normalized = false)
        {
            TransformFollower follower = TransformFollower.CreateFollower(partModel, position, target);
            object            data     = shape.AddAttachment(follower, normalized);

            return(new PartAttachment(follower, data));
        }
Example #2
0
        private void InitializeNode(AttachNode node)
        {
            Vector3 position = transform.TransformPoint(node.position);

            node.originalPosition = node.position *= 1.00001f;

            TransformFollower follower = TransformFollower.CreateFollower(partModel, position, new NodeTransformable(part, node));

            // When the object is symmetryClone, the nodes will be already in offset, not in standard offset.
            object data = shape.AddAttachment(follower, !symmetryClone);

            nodeAttachments.Add(data);
        }
Example #3
0
        public void AddAttachment(Transform child, Vector3 offset, bool normalized)
        {
            ModelAttachment attach = new ModelAttachment
            {
                child = child
            };

            Vector3 position = child.TransformPoint(offset);

            TransformFollower follower = TransformFollower.CreateFollower(partModel, position, new TransformFollower.TransformTransformable(child, position, Space.World));

            attach.data = shape.AddAttachment(follower, normalized);

            attachments.AddLast(attach);
        }
        private PartAttachment AddPartAttachment(Vector3 position, TransformFollower.Transformable target, bool normalized = false)
        {
            if ((object)target == null)
            {
                Debug.Log("AddPartAttachment: null target!");
            }
            TransformFollower follower = TransformFollower.CreateFollower(partModel, position, target);

            if ((object)follower == null)
            {
                Debug.Log("AddPartAttachment: null follower!");
            }
            object data = shape.AddAttachment(follower, normalized);

            return(new PartAttachment(follower, data));
        }