Esempio n. 1
0
        public static Vector3 Transform(ref Vector3 v, ref MyTransform t2)
        {
            Vector3 result;

            Transform(ref v, ref t2, out result);
            return(result);
        }
Esempio n. 2
0
        public static MyTransform Transform(ref MyTransform t1, ref MyTransform t2)
        {
            MyTransform result;

            Transform(ref t1, ref t2, out result);
            return(result);
        }
Esempio n. 3
0
        public static Vector3 Transform(ref Vector3 v, ref MyTransform t2)
        {
            Vector3 vector;

            Transform(ref v, ref t2, out vector);
            return(vector);
        }
Esempio n. 4
0
        public static MyTransform Transform(ref MyTransform t1, ref MyTransform t2)
        {
            MyTransform transform;

            Transform(ref t1, ref t2, out transform);
            return(transform);
        }
Esempio n. 5
0
 public static void Transform(ref MyTransform t1, ref MyTransform t2, out MyTransform result)
 {
     Vector3 newPos;
     Vector3.Transform(ref t1.Position, ref t2.Rotation, out newPos);
     newPos += t2.Position;
     Quaternion newRot;
     Quaternion.Multiply(ref t1.Rotation, ref t2.Rotation, out newRot);
     result.Position = newPos;
     result.Rotation = newRot;
 }
Esempio n. 6
0
        public static void Transform(ref MyTransform t1, ref MyTransform t2, out MyTransform result)
        {
            Vector3    vector;
            Quaternion quaternion;

            Vector3.Transform(ref t1.Position, ref t2.Rotation, out vector);
            vector += t2.Position;
            Quaternion.Multiply(ref t1.Rotation, ref t2.Rotation, out quaternion);
            result.Position = vector;
            result.Rotation = quaternion;
        }
Esempio n. 7
0
        public static void Transform(ref MyTransform t1, ref MyTransform t2, out MyTransform result)
        {
            Vector3 newPos;

            Vector3.Transform(ref t1.Position, ref t2.Rotation, out newPos);
            newPos += t2.Position;
            Quaternion newRot;

            Quaternion.Multiply(ref t1.Rotation, ref t2.Rotation, out newRot);
            result.Position = newPos;
            result.Rotation = newRot;
        }
 public void SyncHeadToolTransform(ref MatrixD headMatrix)
 {
     if (ControllerInfo.IsLocallyControlled())
     {
         MatrixD headMatrixLocal = headMatrix * PositionComp.WorldMatrixInvScaled;
         MyTransform transformToBeSent = new MyTransform(headMatrixLocal);
         transformToBeSent.Rotation = Quaternion.Normalize(transformToBeSent.Rotation);
         m_localHeadTransformTool.Value = transformToBeSent;
     }  
 }
        public MatrixD GetHeadMatrix(bool includeY, bool includeX = true, bool forceHeadAnim = false, bool forceHeadBone = false, bool preferLocalOverSync = false)
        {
            if (preferLocalOverSync || ControllerInfo.IsLocallyControlled())
            {
            int headBone = IsInFirstPersonView || forceHeadBone || ForceFirstPersonCamera ? m_headBoneIndex : m_camera3rdBoneIndex;
                MatrixD headMatrix = GetHeadMatrixInternal(headBone, includeY, includeX, forceHeadAnim, forceHeadBone);
                MatrixD headMatrixLocal = headMatrix * PositionComp.WorldMatrixInvScaled;
                MyTransform transformToBeSent = new MyTransform(headMatrixLocal);
                transformToBeSent.Rotation = Quaternion.Normalize(transformToBeSent.Rotation);


                m_localHeadTransform.Value = transformToBeSent;

                return headMatrix;
        }
            else
            {
                return m_localHeadTransform.Value.TransformMatrix * PositionComp.WorldMatrix;
            }
        }
Esempio n. 10
0
 public static void Transform(ref Vector3 v, ref MyTransform t2, out Vector3 result)
 {
     Vector3.Transform(ref v, ref t2.Rotation, out result);
     result += t2.Position;
 }
Esempio n. 11
0
 public static Vector3 Transform(ref Vector3 v, ref MyTransform t2)
 {
     Vector3 result;
     Transform(ref v, ref t2, out result);
     return result;
 }
Esempio n. 12
0
 public static MyTransform Transform(ref MyTransform t1, ref MyTransform t2)
 {
     MyTransform result;
     Transform(ref t1, ref t2, out result);
     return result;
 }
Esempio n. 13
0
 public static void Transform(ref Vector3 v, ref MyTransform t2, out Vector3 result)
 {
     Vector3.Transform(ref v, ref t2.Rotation, out result);
     result += t2.Position;
 }