Exemple #1
0
        public NullSocketNode AppendSocketNode(int handle, int parent, Vector3 pos, Quaternion quat)
        {
            NullSocketNode node = new NullSocketNode(handle, parent, pos, quat);

            mSocketNodeArray.Add(node);
            return(node);
        }
Exemple #2
0
        protected bool RotateSocketNodes(NullSocketNodes socketNodes, float angle)
        {
            if (socketNodes == null || socketNodes.GetSocketCount() == 0)
            {
                return(false);
            }
            NullSocketNode rootSocketNode = socketNodes[0];

            if (rootSocketNode != null)
            {
                Vector3    pos     = rootSocketNode.GetPosition();
                Quaternion quat    = rootSocketNode.GetQuaternion();
                Vector3    newPos  = Vector3.zero;
                Quaternion newQuat = Quaternion.identity;
                Vector3RotateCalculation(angle, pos, ref newPos, false);
                QuaternionRotateCalculation(angle, quat, ref newQuat);
                rootSocketNode.SetPosition(newPos);
                rootSocketNode.SetQuaternion(newQuat);
            }
            return(true);
        }