Beispiel #1
0
        public static ActorIKTarget Read(Actor actor, BinaryReader reader, ActorIKTarget node = null)
        {
            if (node == null)
            {
                node = new ActorIKTarget();
            }

            ActorNode.Read(actor, reader, node);

            // discard old value
            int order = reader.ReadUInt16();

            node.m_Strength        = reader.ReadSingle();
            node.m_InvertDirection = reader.ReadByte() == 1;

            int numInfluencedBones = (int)reader.ReadByte();

            if (numInfluencedBones > 0)
            {
                node.m_InfluencedBones = new InfluencedBone[numInfluencedBones];

                for (int i = 0; i < numInfluencedBones; i++)
                {
                    InfluencedBone ib = new InfluencedBone();
                    ib.m_BoneIdx = reader.ReadUInt16();
                    node.m_InfluencedBones[i] = ib;
                }
            }

            return(node);
        }
Beispiel #2
0
        public static ActorIKConstraint Read(Actor actor, BinaryReader reader, ActorIKConstraint component = null)
        {
            if (component == null)
            {
                component = new ActorIKConstraint();
            }
            ActorTargetedConstraint.Read(actor, reader, component);

            component.m_InvertDirection = reader.ReadByte() == 1;

            int numInfluencedBones = (int)reader.ReadByte();

            if (numInfluencedBones > 0)
            {
                component.m_InfluencedBones = new InfluencedBone[numInfluencedBones];

                for (int i = 0; i < numInfluencedBones; i++)
                {
                    InfluencedBone ib = new InfluencedBone();
                    ib.m_BoneIdx = reader.ReadUInt16();
                    component.m_InfluencedBones[i] = ib;
                }
            }

            return(component);
        }
Beispiel #3
0
        public void Copy(ActorIKTarget node, Actor resetActor)
        {
            base.Copy(node, resetActor);

            m_InvertDirection = node.m_InvertDirection;
            m_Strength        = node.m_Strength;
            m_InfluencedBones = new InfluencedBone[node.m_InfluencedBones.Length];
            for (int i = 0; i < m_InfluencedBones.Length; i++)
            {
                InfluencedBone ib = new InfluencedBone();
                ib.m_BoneIdx         = node.m_InfluencedBones[i].m_BoneIdx;
                m_InfluencedBones[i] = ib;
            }
        }
Beispiel #4
0
        public void Copy(ActorIKConstraint node, Actor resetActor)
        {
            base.Copy(node, resetActor);

            m_InvertDirection = node.m_InvertDirection;
            if (node.m_InfluencedBones != null)
            {
                m_InfluencedBones = new InfluencedBone[node.m_InfluencedBones.Length];
                for (int i = 0; i < m_InfluencedBones.Length; i++)
                {
                    InfluencedBone ib = new InfluencedBone();
                    ib.m_BoneIdx         = node.m_InfluencedBones[i].m_BoneIdx;
                    m_InfluencedBones[i] = ib;
                }
            }
        }