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

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

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

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

            Transform(ref t1, ref t2, out transform);
            return(transform);
        }
Ejemplo 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;
 }
Ejemplo 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;
        }
Ejemplo 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;
        }
Ejemplo n.º 8
0
 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;
     }  
 }
Ejemplo n.º 9
0
        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;
            }
        }
Ejemplo 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;
 }
Ejemplo n.º 11
0
 public static Vector3 Transform(ref Vector3 v, ref MyTransform t2)
 {
     Vector3 result;
     Transform(ref v, ref t2, out result);
     return result;
 }
Ejemplo n.º 12
0
 public static MyTransform Transform(ref MyTransform t1, ref MyTransform t2)
 {
     MyTransform result;
     Transform(ref t1, ref t2, out result);
     return result;
 }
Ejemplo 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;
 }