Exemplo n.º 1
0
 public static void amQuatMultiVector(
     ref AppMain.SNNS_VECTOR4D pDst,
     ref AppMain.SNNS_VECTOR4D pSrc,
     ref AppMain.NNS_QUATERNION pQuat,
     AppMain.NNS_VECTOR4D?pVec)
 {
     AppMain.NNS_QUATERNION nnsQuaternion1 = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION quat2          = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION nnsQuaternion2 = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION nnsQuaternion3 = new AppMain.NNS_QUATERNION();
     AppMain.VEC4_COPY(ref nnsQuaternion3, ref pSrc);
     quat2.x = -pQuat.x;
     quat2.y = -pQuat.y;
     quat2.z = -pQuat.z;
     quat2.w = pQuat.w;
     AppMain.nnMultiplyQuaternion(ref nnsQuaternion2, ref pQuat, ref nnsQuaternion3);
     AppMain.nnMultiplyQuaternion(ref nnsQuaternion1, ref nnsQuaternion2, ref quat2);
     if (pVec == null)
     {
         AppMain.VEC4_COPY(ref pDst, ref nnsQuaternion1);
     }
     else
     {
         AppMain.SNNS_VECTOR4D snnsVectoR4D1 = new AppMain.SNNS_VECTOR4D();
         AppMain.SNNS_VECTOR4D snnsVectoR4D2 = new AppMain.SNNS_VECTOR4D();
         AppMain.VEC4_COPY(ref snnsVectoR4D1, ref nnsQuaternion1);
         AppMain.VEC4_COPY(ref snnsVectoR4D2, pVec.Value);
         AppMain.amVectorAdd(ref pDst, ref snnsVectoR4D1, ref snnsVectoR4D2);
     }
 }
Exemplo n.º 2
0
 public static void amQuatMultiVector(
     AppMain.NNS_VECTOR4D pDst,
     AppMain.NNS_VECTOR4D pSrc,
     ref AppMain.NNS_QUATERNION pQuat,
     AppMain.NNS_VECTOR4D?pVec)
 {
     AppMain.NNS_QUATERNION nnsQuaternion1 = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION quat2          = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION nnsQuaternion2 = new AppMain.NNS_QUATERNION();
     AppMain.NNS_QUATERNION nnsQuaternion3 = new AppMain.NNS_QUATERNION();
     AppMain.VEC4_COPY(ref nnsQuaternion3, (AppMain.NNS_VECTOR)pSrc);
     quat2.x = -pQuat.x;
     quat2.y = -pQuat.y;
     quat2.z = -pQuat.z;
     quat2.w = pQuat.w;
     AppMain.nnMultiplyQuaternion(ref nnsQuaternion2, ref pQuat, ref nnsQuaternion3);
     AppMain.nnMultiplyQuaternion(ref nnsQuaternion1, ref nnsQuaternion2, ref quat2);
     if (pVec == null)
     {
         AppMain.VEC4_COPY(ref pDst, ref nnsQuaternion1);
     }
     else
     {
         AppMain.NNS_VECTOR4D nnsVectoR4D = new AppMain.NNS_VECTOR4D();
         AppMain.NNS_VECTOR4D pV2         = new AppMain.NNS_VECTOR4D();
         AppMain.VEC4_COPY(ref nnsVectoR4D, ref nnsQuaternion1);
         AppMain.VEC4_COPY(ref pV2, (AppMain.NNS_VECTOR)pVec);
         AppMain.amVectorAdd(ref pDst, nnsVectoR4D, pV2);
         //AppMain.GlobalPool<AppMain.NNS_VECTOR4D>.Release(nnsVectoR4D);
         //AppMain.GlobalPool<AppMain.NNS_VECTOR4D>.Release(pV2);
     }
 }
Exemplo n.º 3
0
 public static void VEC4_COPY(ref AppMain.NNS_QUATERNION d_vec, ref AppMain.SNNS_VECTOR4D s_vec)
 {
     d_vec.x = s_vec.x;
     d_vec.y = s_vec.y;
     d_vec.z = s_vec.z;
     d_vec.w = s_vec.w;
 }
Exemplo n.º 4
0
 public static void amQuatRotAxisToQuat(
     ref AppMain.NNS_QUATERNION pQuat,
     AppMain.NNS_VECTOR4D pVec,
     int angle)
 {
     AppMain.amQuatRotAxisToQuat(ref pQuat, pVec, AppMain.NNM_A32toRAD(angle));
 }
Exemplo n.º 5
0
 public static void amQuatMakeRotateAxis(
     ref AppMain.NNS_QUATERNION pDst,
     AppMain.NNS_VECTOR pV,
     int ang)
 {
     AppMain.nnMakeRotateAxisQuaternion(out pDst, pV.x, pV.y, pV.z, ang);
 }
Exemplo n.º 6
0
 public static void VEC4_COPY(ref AppMain.NNS_QUATERNION d_vec, AppMain.NNS_VECTOR s_vec)
 {
     d_vec.x = s_vec.x;
     d_vec.y = s_vec.y;
     d_vec.z = s_vec.z;
     d_vec.w = 0.0f;
 }
Exemplo n.º 7
0
    // Token: 0x06000F5D RID: 3933 RVA: 0x0008803C File Offset: 0x0008623C
    public void amQuatVectorToQuat(ref AppMain.NNS_QUATERNION pQuat, AppMain.NNS_VECTOR4D pV1, AppMain.NNS_VECTOR4D pV2)
    {
        AppMain.NNS_VECTOR nns_VECTOR = AppMain.GlobalPool <AppMain.NNS_VECTOR> .Alloc();

        AppMain.NNS_VECTOR nns_VECTOR2 = AppMain.GlobalPool <AppMain.NNS_VECTOR> .Alloc();

        AppMain.NNS_VECTOR nns_VECTOR3 = AppMain.GlobalPool <AppMain.NNS_VECTOR> .Alloc();

        AppMain.NNS_VECTOR nns_VECTOR4 = AppMain.GlobalPool <AppMain.NNS_VECTOR> .Alloc();

        AppMain.VEC3_COPY(nns_VECTOR, pV1);
        AppMain.VEC3_COPY(nns_VECTOR2, pV2);
        AppMain.nnAddVector(nns_VECTOR4, nns_VECTOR, nns_VECTOR2);
        float num = AppMain.nnDotProductVector(nns_VECTOR4, nns_VECTOR4);

        num = ( float )(1.0 / Math.Sqrt(( double )num));
        AppMain.nnScaleVector(nns_VECTOR2, nns_VECTOR4, num);
        AppMain.nnCrossProductVector(nns_VECTOR3, nns_VECTOR, nns_VECTOR2);
        AppMain.VEC3_COPY(pQuat, nns_VECTOR3);
        pQuat.w = AppMain.nnDotProductVector(nns_VECTOR, nns_VECTOR2);
        AppMain.GlobalPool <AppMain.NNS_VECTOR> .Release(nns_VECTOR);

        AppMain.GlobalPool <AppMain.NNS_VECTOR> .Release(nns_VECTOR2);

        AppMain.GlobalPool <AppMain.NNS_VECTOR> .Release(nns_VECTOR3);

        AppMain.GlobalPool <AppMain.NNS_VECTOR> .Release(nns_VECTOR4);
    }
Exemplo n.º 8
0
 public static void amQuatMulti(
     ref AppMain.NNS_QUATERNION pDst,
     ref AppMain.NNS_QUATERNION pQ1,
     ref AppMain.NNS_QUATERNION pQ2)
 {
     AppMain.nnMultiplyQuaternion(ref pDst, ref pQ1, ref pQ2);
 }
Exemplo n.º 9
0
 // Token: 0x06000F68 RID: 3944 RVA: 0x0008849F File Offset: 0x0008669F
 public static void amQuatSet(ref AppMain.NNS_QUATERNION pDst, float x, float y, float z, float w)
 {
     pDst.x = x;
     pDst.y = y;
     pDst.z = z;
     pDst.w = w;
 }
Exemplo n.º 10
0
 private static void readQuaternion(BinaryReader br, ref AppMain.NNS_QUATERNION q)
 {
     q.x = br.ReadSingle();
     q.y = br.ReadSingle();
     q.z = br.ReadSingle();
     q.w = br.ReadSingle();
 }
Exemplo n.º 11
0
    // Token: 0x06000F64 RID: 3940 RVA: 0x0008825C File Offset: 0x0008645C
    public static void amQuatMultiVector(AppMain.NNS_VECTOR4D pDst, AppMain.NNS_VECTOR4D pSrc, ref AppMain.NNS_QUATERNION pQuat, AppMain.NNS_VECTOR4D pVec)
    {
        AppMain.NNS_QUATERNION nns_QUATERNION  = default(AppMain.NNS_QUATERNION);
        AppMain.NNS_QUATERNION nns_QUATERNION2 = default(AppMain.NNS_QUATERNION);
        AppMain.NNS_QUATERNION nns_QUATERNION3 = default(AppMain.NNS_QUATERNION);
        AppMain.NNS_QUATERNION nns_QUATERNION4 = default(AppMain.NNS_QUATERNION);
        AppMain.VEC4_COPY(ref nns_QUATERNION4, pSrc);
        nns_QUATERNION2.x = -pQuat.x;
        nns_QUATERNION2.y = -pQuat.y;
        nns_QUATERNION2.z = -pQuat.z;
        nns_QUATERNION2.w = pQuat.w;
        AppMain.nnMultiplyQuaternion(ref nns_QUATERNION3, ref pQuat, ref nns_QUATERNION4);
        AppMain.nnMultiplyQuaternion(ref nns_QUATERNION, ref nns_QUATERNION3, ref nns_QUATERNION2);
        if (pVec == null)
        {
            AppMain.VEC4_COPY(pDst, ref nns_QUATERNION);
            return;
        }
        AppMain.NNS_VECTOR4D nns_VECTOR4D = AppMain.GlobalPool <AppMain.NNS_VECTOR4D> .Alloc();

        AppMain.NNS_VECTOR4D nns_VECTOR4D2 = AppMain.GlobalPool <AppMain.NNS_VECTOR4D> .Alloc();

        AppMain.VEC4_COPY(nns_VECTOR4D, ref nns_QUATERNION);
        AppMain.VEC4_COPY(nns_VECTOR4D2, pVec);
        AppMain.amVectorAdd(pDst, nns_VECTOR4D, nns_VECTOR4D2);
        AppMain.GlobalPool <AppMain.NNS_VECTOR4D> .Release(nns_VECTOR4D);

        AppMain.GlobalPool <AppMain.NNS_VECTOR4D> .Release(nns_VECTOR4D2);
    }
Exemplo n.º 12
0
 // Token: 0x06000F62 RID: 3938 RVA: 0x000881EC File Offset: 0x000863EC
 public static void amQuatMultiMatrix(ref AppMain.NNS_QUATERNION pQuat, ref AppMain.SNNS_VECTOR pVec)
 {
     AppMain.NNS_MATRIX nns_MATRIX = AppMain.amMatrixGetCurrent();
     AppMain.nnMakeQuaternionMatrix(out AppMain.tempSNNS_MATRIX0, ref pQuat);
     AppMain.nnCopyVectorMatrixTranslation(ref AppMain.tempSNNS_MATRIX0, ref pVec);
     AppMain.nnMultiplyMatrix(nns_MATRIX, nns_MATRIX, ref AppMain.tempSNNS_MATRIX0);
 }
Exemplo n.º 13
0
 public void Assign(AppMain.NNS_QUATERNION q)
 {
     this.x = q.x;
     this.y = q.y;
     this.z = q.z;
     this.w = q.w;
 }
Exemplo n.º 14
0
 // Token: 0x0600199C RID: 6556 RVA: 0x000E847D File Offset: 0x000E667D
 public static void VEC3_COPY(AppMain.NNS_QUATERNION d_vec, AppMain.NNS_VECTOR s_vec)
 {
     d_vec.x = s_vec.x;
     d_vec.y = s_vec.y;
     d_vec.z = s_vec.z;
     d_vec.z = 0f;
 }
Exemplo n.º 15
0
 public static void amQuatToMatrix(
     AppMain.NNS_MATRIX pMtx,
     ref AppMain.NNS_QUATERNION pQuat,
     AppMain.NNS_VECTOR4D?pVec)
 {
     if (pMtx == null)
     {
         AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent();
         AppMain.nnMakeQuaternionMatrix(out AppMain.tempSNNS_MATRIX0, ref pQuat);
         if (pVec != null)
         {
             AppMain.nnCopyVectorMatrixTranslation(ref AppMain.tempSNNS_MATRIX0, (AppMain.NNS_VECTOR)pVec);
         }
         AppMain.nnCopyMatrix(current, ref AppMain.tempSNNS_MATRIX0);
     }
     else
     {
         AppMain.nnMakeQuaternionMatrix(pMtx, ref pQuat);
         if (pVec == null)
         {
             return;
         }
         AppMain.nnCopyVectorMatrixTranslation(ref AppMain.tempSNNS_MATRIX0, (AppMain.NNS_VECTOR)pVec);
     }
 }
Exemplo n.º 16
0
 public static void AkMathInvertXYQuaternion(
     out AppMain.NNS_QUATERNION dst_quat,
     ref AppMain.NNS_QUATERNION src_quat)
 {
     dst_quat   = src_quat;
     dst_quat.x = -dst_quat.x;
     dst_quat.y = -dst_quat.y;
 }
Exemplo n.º 17
0
 public static void amQuatEulerToQuatXYZ(
     ref AppMain.NNS_QUATERNION pQuat,
     float rx,
     float ry,
     float rz)
 {
     AppMain.nnMakeRotateXYZQuaternion(out pQuat, AppMain.NNM_RADtoA32(rx), AppMain.NNM_RADtoA32(ry), AppMain.NNM_RADtoA32(rz));
 }
Exemplo n.º 18
0
 public static void amQuatEulerToQuatXYZ(
     ref AppMain.NNS_QUATERNION pQuat,
     int ax,
     int ay,
     int az)
 {
     AppMain.nnMakeRotateXYZQuaternion(out pQuat, ax, ay, az);
 }
Exemplo n.º 19
0
 public static void amQuatLerp(
     ref AppMain.NNS_QUATERNION pDst,
     ref AppMain.NNS_QUATERNION pQ1,
     ref AppMain.NNS_QUATERNION pQ2,
     float per)
 {
     AppMain.nnLerpQuaternion(ref pDst, ref pQ1, ref pQ2, per);
 }
Exemplo n.º 20
0
 public AppMain.NNS_MOTION_KEY_Class7 Assign(AppMain.NNS_MOTION_KEY_Class7 motionKey)
 {
     if (this != motionKey)
     {
         this.Frame = motionKey.Frame;
         this.Value = motionKey.Value;
     }
     return(this);
 }
Exemplo n.º 21
0
 public AppMain.NNS_TRS Assign(AppMain.NNS_TRS trs)
 {
     if (this != trs)
     {
         this.Translation = trs.Translation;
         this.Rotation    = trs.Rotation;
         this.Scaling     = trs.Scaling;
     }
     return(this);
 }
Exemplo n.º 22
0
 public static void amQuatUnitLerp(
     ref AppMain.NNS_QUATERNION pDst,
     ref AppMain.NNS_QUATERNION pQ1,
     ref AppMain.NNS_QUATERNION pQ2,
     float per)
 {
     AppMain.NNS_QUATERNION nnsQuaternion = new AppMain.NNS_QUATERNION();
     AppMain.amQuatLerp(ref nnsQuaternion, ref pQ1, ref pQ2, per);
     AppMain.nnNormalizeQuaternion(ref pDst, ref nnsQuaternion);
 }
Exemplo n.º 23
0
 public static void amQuatSquad(
     ref AppMain.NNS_QUATERNION pDst,
     ref AppMain.NNS_QUATERNION pQ1,
     ref AppMain.NNS_QUATERNION pQ2,
     ref AppMain.NNS_QUATERNION pQ3,
     ref AppMain.NNS_QUATERNION pQ4,
     float t)
 {
     AppMain.nnSquadQuaternion(ref pDst, ref pQ1, ref pQ2, ref pQ3, ref pQ4, t);
 }
Exemplo n.º 24
0
 public static void amQuatMultiMatrix(ref AppMain.NNS_QUATERNION pQuat, AppMain.NNS_VECTOR?pVec)
 {
     AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent();
     AppMain.nnMakeQuaternionMatrix(out AppMain.tempSNNS_MATRIX0, ref pQuat);
     if (pVec != null)
     {
         AppMain.nnCopyVectorMatrixTranslation(ref AppMain.tempSNNS_MATRIX0, pVec.Value);
     }
     AppMain.nnMultiplyMatrix(current, current, ref AppMain.tempSNNS_MATRIX0);
 }
Exemplo n.º 25
0
    // Token: 0x06000F5C RID: 3932 RVA: 0x00088008 File Offset: 0x00086208
    public void amQuatToEulerXYZ(out int ax, out int ay, out int az, ref AppMain.NNS_QUATERNION pQuat)
    {
        float n;
        float n2;
        float n3;

        this.amQuatToEulerXYZ(out n, out n2, out n3, ref pQuat);
        ax = AppMain.NNM_RADtoA32(n);
        ay = AppMain.NNM_RADtoA32(n2);
        az = AppMain.NNM_RADtoA32(n3);
    }
Exemplo n.º 26
0
    // Token: 0x06000F5E RID: 3934 RVA: 0x000880D8 File Offset: 0x000862D8
    public static void amQuatRotAxisToQuat(ref AppMain.NNS_QUATERNION pQuat, AppMain.NNS_VECTOR4D pVec, float radian)
    {
        radian *= 0.5f;
        float num;
        float w;

        AppMain.amSinCos(radian, out num, out w);
        pQuat.x = pVec.x * num;
        pQuat.y = pVec.y * num;
        pQuat.z = pVec.z * num;
        pQuat.w = w;
    }
Exemplo n.º 27
0
 public static void amEffectSetRotate(
     AppMain.AMS_AME_ECB ecb,
     ref AppMain.NNS_QUATERNION q,
     int offset)
 {
     ecb.rotate = q;
     for (AppMain.AMS_AME_ENTRY amsAmeEntry = ecb.entry_head; amsAmeEntry != null; amsAmeEntry = (AppMain.AMS_AME_ENTRY)amsAmeEntry.next)
     {
         AppMain.AMS_AME_RUNTIME runtime = amsAmeEntry.runtime;
         if ((runtime.state & 8192) != 0 && ((int)runtime.node.flag & 134217728) == 0)
         {
             if (runtime.work != null)
             {
                 if (offset != 0)
                 {
                     AppMain.amQuatMulti(ref runtime.work.rotate[0], ref ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).rotate, ref q);
                 }
                 else
                 {
                     runtime.work.rotate[0] = q;
                 }
             }
             if ((int)runtime.work_num + (int)runtime.active_num != 0)
             {
                 AppMain.AMS_AME_RUNTIME_WORK next1 = (AppMain.AMS_AME_RUNTIME_WORK)runtime.work_head.next;
                 for (AppMain.AMS_AME_RUNTIME_WORK workTail = (AppMain.AMS_AME_RUNTIME_WORK)runtime.work_tail; next1 != workTail; next1 = (AppMain.AMS_AME_RUNTIME_WORK)next1.next)
                 {
                     if (offset != 0)
                     {
                         AppMain.amQuatMulti(ref next1.rotate[0], ref ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).rotate, ref q);
                     }
                     else
                     {
                         next1.rotate[0] = q;
                     }
                 }
                 AppMain.AMS_AME_RUNTIME_WORK next2 = (AppMain.AMS_AME_RUNTIME_WORK)runtime.active_head.next;
                 for (AppMain.AMS_AME_RUNTIME_WORK activeTail = (AppMain.AMS_AME_RUNTIME_WORK)runtime.active_tail; next2 != activeTail; next2 = (AppMain.AMS_AME_RUNTIME_WORK)next2.next)
                 {
                     if (offset != 0)
                     {
                         AppMain.amQuatMulti(ref next2.rotate[0], ref ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).rotate, ref q);
                     }
                     else
                     {
                         next2.rotate[0] = q;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 28
0
    public void amQuatToEulerXYZ(
        out int ax,
        out int ay,
        out int az,
        ref AppMain.NNS_QUATERNION pQuat)
    {
        float rx;
        float ry;
        float rz;

        this.amQuatToEulerXYZ(out rx, out ry, out rz, ref pQuat);
        ax = AppMain.NNM_RADtoA32(rx);
        ay = AppMain.NNM_RADtoA32(ry);
        az = AppMain.NNM_RADtoA32(rz);
    }
Exemplo n.º 29
0
    public static void amQuatRotAxisToQuat(
        ref AppMain.NNS_QUATERNION pQuat,
        AppMain.NNS_VECTOR4D pVec,
        float radian)
    {
        radian *= 0.5f;
        float pSn;
        float pCs;

        AppMain.amSinCos(radian, out pSn, out pCs);
        pQuat.x = pVec.x * pSn;
        pQuat.y = pVec.y * pSn;
        pQuat.z = pVec.z * pSn;
        pQuat.w = pCs;
    }
Exemplo n.º 30
0
    public void amQuatToEulerXYZ(
        out float rx,
        out float ry,
        out float rz,
        ref AppMain.NNS_QUATERNION pQuat)
    {
        rx = ry = rz = 0.0f;
        AppMain.NNS_QUATERNION pDst = new AppMain.NNS_QUATERNION();
        AppMain.amQuatUnit(ref pDst, ref pQuat);
        float num1  = pDst.x * pDst.x;
        float num2  = pDst.x * pDst.y;
        float num3  = pDst.x * pDst.z;
        float num4  = pDst.x * pDst.w;
        float num5  = pDst.y * pDst.y;
        float num6  = pDst.y * pDst.z;
        float num7  = pDst.y * pDst.w;
        float num8  = pDst.z * pDst.z;
        float num9  = pDst.z * pDst.w;
        float n_1   = (float)(1.0 - 2.0 * ((double)num5 + (double)num8));
        float n_2   = (float)(2.0 * ((double)num2 + (double)num9));
        float n_3   = (float)(2.0 * ((double)num3 - (double)num7));
        float num10 = 1f - AppMain.amPow2(n_3);

        ry = (float)Math.Atan2(-(double)n_3, (double)num10 > 0.0 ? Math.Sqrt((double)num10) : 0.0);
        float fs = (float)Math.Sqrt((double)AppMain.amPow2(n_1) + (double)AppMain.amPow2(n_2));
        float num11;
        float num12;

        if (AppMain.amIsZerof(fs))
        {
            num11 = 0.0f;
            num12 = 1f;
        }
        else
        {
            num11 = n_2 / fs;
            num12 = n_1 / fs;
        }
        float num13 = (float)(2.0 * ((double)num2 - (double)num9));
        float num14 = (float)(2.0 * ((double)num3 + (double)num7));
        float num15 = (float)(1.0 - 2.0 * ((double)num1 + (double)num8));
        float num16 = (float)(2.0 * ((double)num6 - (double)num4));
        float num17 = (float)((double)num14 * (double)num11 - (double)num16 * (double)num12);
        float num18 = (float)((double)num15 * (double)num12 - (double)num13 * (double)num11);

        rx = (float)Math.Atan2((double)num17, (double)num18);
        rz = (float)Math.Atan2((double)num11, (double)num12);
    }