Beispiel #1
0
 public NullNodeDummyObject FindNodeObject(int nodeId)
 {
     for (int i = 0; i < mDummyArray.Count; i++)
     {
         NullNodeDummyObject nodeObject = mDummyArray[i];
         if (nodeId == nodeObject.GetNodeHandle())
         {
             return(nodeObject);
         }
     }
     return(null);
 }
Beispiel #2
0
 public NullNodeDummyObject FindNodeObject(string nodeName)
 {
     for (int i = 0; i < mDummyArray.Count; i++)
     {
         NullNodeDummyObject nodeObject = mDummyArray[i];
         if (nodeName.Equals(nodeObject.GetNodeName()))
         {
             return(nodeObject);
         }
     }
     return(null);
 }
Beispiel #3
0
        protected bool RotateNodeDummy(NullNodeDummy nodeDummy, float angle)
        {
            if (nodeDummy == null || nodeDummy.GetNodeCount() == 0)
            {
                return(false);
            }
            for (int i = 0; i < nodeDummy.GetNodeCount(); i++)
            {
                NullNodeDummyObject nodeDummyObject = nodeDummy[i];
                Vector3             pos             = nodeDummyObject.GetPosition();
                Vector3             newPos          = Vector3.zero;
                Quaternion          quat            = nodeDummyObject.GetQuaternion();
                Quaternion          newQuat         = Quaternion.identity;
                Vector3RotateCalculation(angle, pos, ref newPos, false);
                QuaternionRotateCalculation(angle, quat, ref newQuat);
                nodeDummyObject.SetTransform(newPos.x, newPos.y, newPos.z, newQuat.x, newQuat.y, newQuat.z, newQuat.w);
            }

            return(true);
        }