コード例 #1
0
        /**
         *      This method is used to get the relative angular velocities of the parent and child bodies of joint i,
         *      expressed in parent's local coordinates.
         *      We'll assume that i is in the range 0 - joints.size()-1!!!
         */
        public Vector3 getRelativeAngularVelocity(int i)
        {
            CWJoint    joint     = this.joints[i] as CWJoint;
            Quaternion parentOri = joint.getParent().getOrientation();

            return(Quaternion.Inverse(parentOri) * (joint.getChild().getAngularVelocity() - joint.getParent().getAngularVelocity()));
        }
コード例 #2
0
        /**
         *      This method is used to populate the relative orientation of the parent and child bodies of joint i.
         */
        public Quaternion getRelativeOrientation(int i)
        {
            CWJoint    joint     = this.joints[i] as CWJoint;
            Quaternion parentOri = joint.getParent().getOrientation();
            Quaternion childOri  = joint.getChild().getOrientation();

            return(Quaternion.Inverse(parentOri) * childOri);
        }