// Token: 0x060019D0 RID: 6608 RVA: 0x000E8FB0 File Offset: 0x000E71B0 public static void amVectorSub(ref AppMain.SNNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pV1, ref AppMain.SNNS_VECTOR4D pV2) { pDst.x = pV1.x - pV2.x; pDst.y = pV1.y - pV2.y; pDst.z = pV1.z - pV2.z; pDst.w = pV1.w; }
public static void amVectorCopy(ref AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pSrc) { pDst.x = pSrc.x; pDst.y = pSrc.y; pDst.z = pSrc.z; pDst.w = pSrc.w; }
public void Assign(ref AppMain.SNNS_VECTOR4D val) { this.x = val.x; this.y = val.y; this.z = val.z; this.w = val.w; }
// Token: 0x060019BF RID: 6591 RVA: 0x000E8B3C File Offset: 0x000E6D3C public static void amVectorAdd(AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pV1, AppMain.NNS_VECTOR4D pV2) { pDst.x = pV1.x + pV2.x; pDst.y = pV1.y + pV2.y; pDst.z = pV1.z + pV2.z; pDst.w = pV1.w; }
public AppMain.NNS_VECTOR Assign(ref AppMain.SNNS_VECTOR4D vec) { this.x = vec.x; this.y = vec.y; this.z = vec.z; return(this); }
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; }
public static void amEffectSetTranslate( AppMain.AMS_AME_ECB ecb, ref AppMain.SNNS_VECTOR4D translate) { AppMain.amVectorCopy(ref ecb.translate, ref translate); 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 & 67108864) == 0) { if (runtime.work != null) { AppMain.amVectorAdd(ref runtime.work.position, ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).translate, ref translate); } 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) { AppMain.amVectorAdd(ref next1.position, ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).translate, ref translate); } 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) { AppMain.amVectorAdd(ref next2.position, ((AppMain.AMS_AME_NODE_TR_ROT)runtime.node).translate, ref translate); } } } } }
// Token: 0x06000F61 RID: 3937 RVA: 0x000881B4 File Offset: 0x000863B4 public static void amQuatMultiMatrix(ref AppMain.NNS_QUATERNION pQuat, ref AppMain.SNNS_VECTOR4D 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); }
public static void amVectorOne(ref AppMain.SNNS_VECTOR4D pVec) { pVec.x = 1f; pVec.y = 1f; pVec.z = 1f; pVec.w = 1f; }
public static void amVectorSet(out AppMain.SNNS_VECTOR4D pDst, float x, float y, float z) { pDst.x = x; pDst.y = y; pDst.z = z; pDst.w = 1f; }
public static void amVectorOuterProduct( ref AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pV1, ref AppMain.SNNS_VECTOR4D pV2) { AppMain.amVectorSet(ref pDst, (float)((double)pV1.y * (double)pV2.z - (double)pV1.z * (double)pV2.y), (float)((double)pV1.z * (double)pV2.x - (double)pV1.x * (double)pV2.z), (float)((double)pV1.x * (double)pV2.y - (double)pV1.y * (double)pV2.x)); }
public static void amVectorInit(ref AppMain.SNNS_VECTOR4D pVec) { pVec.x = 0.0f; pVec.y = 0.0f; pVec.z = 0.0f; pVec.w = 1f; }
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); } }
// Token: 0x060019E5 RID: 6629 RVA: 0x000E9642 File Offset: 0x000E7842 public static void amVectorScale(AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pSrc, float sc) { pDst.x = pSrc.x * sc; pDst.y = pSrc.y * sc; pDst.z = pSrc.z * sc; pDst.w = pSrc.w; }
public static float amVectorUnit(ref AppMain.SNNS_VECTOR4D pDst) { float fs = AppMain.amSqrt(AppMain.amPow2(pDst.x) + AppMain.amPow2(pDst.y) + AppMain.amPow2(pDst.z)); if (!AppMain.amIsZerof(fs)) { float num = 1f / fs; pDst.x *= num; pDst.y *= num; pDst.z *= num; } return(fs); }
public static float amVectorUnit(ref AppMain.NNS_VECTOR pDst, ref AppMain.SNNS_VECTOR4D pSrc) { float fs = AppMain.amSqrt(AppMain.amPow2(pSrc.x) + AppMain.amPow2(pSrc.y) + AppMain.amPow2(pSrc.z)); AppMain.nnCopyVector(ref pDst, ref pSrc); if (!AppMain.amIsZerof(fs)) { float num = 1f / fs; pDst.x *= num; pDst.y *= num; pDst.z *= num; } return(fs); }
// Token: 0x060019E1 RID: 6625 RVA: 0x000E94EC File Offset: 0x000E76EC public static float amVectorScaleUnit(ref AppMain.SNNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pSrc, float len) { float num = AppMain.amSqrt(AppMain.amPow2(pSrc.x) + AppMain.amPow2(pSrc.y) + AppMain.amPow2(pSrc.z)); AppMain.amVectorCopy(ref pDst, ref pSrc); if (!AppMain.amIsZerof(num)) { len /= num; pDst.x *= len; pDst.y *= len; pDst.z *= len; } return(num); }
// Token: 0x06000F66 RID: 3942 RVA: 0x000883D8 File Offset: 0x000865D8 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 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, ref 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(ref pDst, ref nns_QUATERNION); return; } AppMain.SNNS_VECTOR4D snns_VECTOR4D = default(AppMain.SNNS_VECTOR4D); AppMain.SNNS_VECTOR4D snns_VECTOR4D2 = default(AppMain.SNNS_VECTOR4D); AppMain.VEC4_COPY(ref snns_VECTOR4D, ref nns_QUATERNION); AppMain.VEC4_COPY(ref snns_VECTOR4D2, pVec); AppMain.amVectorAdd(ref pDst, ref snns_VECTOR4D, ref snns_VECTOR4D2); }
// Token: 0x060019F4 RID: 6644 RVA: 0x000E9A84 File Offset: 0x000E7C84 public static void amVectorOuterProduct(AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pV1, ref AppMain.SNNS_VECTOR4D pV2) { AppMain.amVectorSet(pDst, pV1.y * pV2.z - pV1.z * pV2.y, pV1.z * pV2.x - pV1.x * pV2.z, pV1.x * pV2.y - pV1.y * pV2.x); }
public static void amVectorRandom(ref AppMain.SNNS_VECTOR4D pDst) { AppMain.amVectorSet(out pDst, AppMain.nnRandom() - 0.5f, AppMain.nnRandom() - 0.5f, AppMain.nnRandom() - 0.5f); double num = (double)AppMain.amVectorUnit(ref pDst); }
public static int _amDrawPlane(object r) { AppMain.AMS_AME_RUNTIME runtime = (AppMain.AMS_AME_RUNTIME)r; AppMain.AMS_AME_NODE_PLANE node = (AppMain.AMS_AME_NODE_PLANE)runtime.node; AppMain.AMS_AME_LIST next = runtime.active_head.next; AppMain.AMS_AME_LIST activeTail = runtime.active_tail; AppMain.AMS_PARAM_DRAW_PRIMITIVE setParam = AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Alloc(); int num1 = AppMain._amEffectSetDrawMode(runtime, setParam, node.blend); AppMain.SNNS_VECTOR4D pDst = new AppMain.SNNS_VECTOR4D(); float zBias = node.z_bias; AppMain.amVectorSet(out pDst, zBias * AppMain._am_ef_worldViewMtx.M20, zBias * AppMain._am_ef_worldViewMtx.M21, zBias * AppMain._am_ef_worldViewMtx.M22); AppMain.SNNS_VECTOR snnsVector = new AppMain.SNNS_VECTOR(); if (((int)node.flag & 4096) != 0) { AppMain.NNS_PRIM3D_PCT_ARRAY nnsPriM3DPctArray = AppMain.amDrawAlloc_NNS_PRIM3D_PCT(6 * (int)runtime.active_num); AppMain.NNS_PRIM3D_PCT[] buffer = nnsPriM3DPctArray.buffer; int offset = nnsPriM3DPctArray.offset; float num2 = 0.0f; for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_PLANE runtimeWorkPlane = (AppMain.AMS_AME_RUNTIME_WORK_PLANE)(AppMain.AMS_AME_RUNTIME_WORK) next; AppMain.amMatrixPush(); AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent(); float x = runtimeWorkPlane.size.x; float y = runtimeWorkPlane.size.y; AppMain.amVectorAdd(ref snnsVector, runtimeWorkPlane.position, ref pDst); AppMain.NNS_QUATERNION rotate = runtimeWorkPlane.rotate; AppMain.amQuatMultiMatrix(ref rotate, ref snnsVector); runtimeWorkPlane.rotate = rotate; num2 = AppMain.nnDistanceVector(ref snnsVector, AppMain._am_ef_camPos); buffer[offset].Pos.Assign(-x, y, 0.0f); buffer[offset + 1].Pos.Assign(x, y, 0.0f); buffer[offset + 2].Pos.Assign(-x, -y, 0.0f); buffer[offset + 5].Pos.Assign(x, -y, 0.0f); AppMain.nnTransformVector(ref buffer[offset].Pos, current, ref buffer[offset].Pos); AppMain.nnTransformVector(ref buffer[offset + 1].Pos, current, ref buffer[offset + 1].Pos); AppMain.nnTransformVector(ref buffer[offset + 2].Pos, current, ref buffer[offset + 2].Pos); AppMain.nnTransformVector(ref buffer[offset + 5].Pos, current, ref buffer[offset + 5].Pos); buffer[offset + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkPlane.color.r, runtimeWorkPlane.color.g, runtimeWorkPlane.color.b, runtimeWorkPlane.color.a); buffer[offset].Col = buffer[offset + 1].Col = buffer[offset + 2].Col = buffer[offset + 5].Col; buffer[offset].Tex.u = runtimeWorkPlane.st.x; buffer[offset].Tex.v = runtimeWorkPlane.st.y; buffer[offset + 1].Tex.u = runtimeWorkPlane.st.z; buffer[offset + 1].Tex.v = runtimeWorkPlane.st.y; buffer[offset + 2].Tex.u = runtimeWorkPlane.st.x; buffer[offset + 2].Tex.v = runtimeWorkPlane.st.w; buffer[offset + 5].Tex.u = runtimeWorkPlane.st.z; buffer[offset + 5].Tex.v = runtimeWorkPlane.st.w; buffer[offset + 3] = buffer[offset + 1]; buffer[offset + 4] = buffer[offset + 2]; offset += 6; AppMain.amMatrixPop(); } setParam.format3D = 4; setParam.type = 0; setParam.vtxPCT3D = nnsPriM3DPctArray; setParam.texlist = runtime.texlist; setParam.texId = (int)node.texture_id; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } else { AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray1 = AppMain.amDrawAlloc_NNS_PRIM3D_PC(6 * (int)runtime.active_num); int index = 0; AppMain.NNS_PRIM3D_PC[] nnsPriM3DPcArray2 = nnsPriM3DPcArray1; float num2 = 0.0f; for (; next != activeTail; next = next.next) { AppMain.AMS_AME_RUNTIME_WORK_PLANE runtimeWorkPlane = (AppMain.AMS_AME_RUNTIME_WORK_PLANE)(AppMain.AMS_AME_RUNTIME_WORK) next; AppMain.amMatrixPush(); AppMain.NNS_MATRIX current = AppMain.amMatrixGetCurrent(); float x = runtimeWorkPlane.size.x; float y = runtimeWorkPlane.size.y; AppMain.amVectorAdd(ref snnsVector, runtimeWorkPlane.position, ref pDst); AppMain.NNS_QUATERNION rotate = runtimeWorkPlane.rotate; AppMain.amQuatMultiMatrix(ref rotate, ref snnsVector); runtimeWorkPlane.rotate = rotate; num2 = AppMain.nnDistanceVector(ref snnsVector, AppMain._am_ef_camPos); nnsPriM3DPcArray1[index].Pos.Assign(-x, y, 0.0f); nnsPriM3DPcArray1[index + 1].Pos.Assign(x, y, 0.0f); nnsPriM3DPcArray1[index + 2].Pos.Assign(-x, -y, 0.0f); nnsPriM3DPcArray1[index + 5].Pos.Assign(x, -y, 0.0f); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index].Pos, current, ref nnsPriM3DPcArray1[index].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 1].Pos, current, ref nnsPriM3DPcArray1[index + 1].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 2].Pos, current, ref nnsPriM3DPcArray1[index + 2].Pos); AppMain.nnTransformVector(ref nnsPriM3DPcArray1[index + 5].Pos, current, ref nnsPriM3DPcArray1[index + 5].Pos); nnsPriM3DPcArray1[index + 5].Col = AppMain.AMD_RGBA8888(runtimeWorkPlane.color.r, runtimeWorkPlane.color.g, runtimeWorkPlane.color.b, runtimeWorkPlane.color.a); nnsPriM3DPcArray1[index].Col = nnsPriM3DPcArray1[index + 1].Col = nnsPriM3DPcArray1[index + 2].Col = nnsPriM3DPcArray1[index + 5].Col; nnsPriM3DPcArray1[index + 3] = nnsPriM3DPcArray1[index + 1]; nnsPriM3DPcArray1[index + 4] = nnsPriM3DPcArray1[index + 2]; index += 6; AppMain.amMatrixPop(); } setParam.format3D = 2; setParam.type = 0; setParam.vtxPC3D = nnsPriM3DPcArray2; setParam.texlist = runtime.texlist; setParam.texId = -1; setParam.count = 6 * (int)runtime.active_num; setParam.ablend = num1; setParam.sortZ = num2; AppMain.amDrawPrimitive3D(runtime.ecb.drawState, setParam); } AppMain.GlobalPool <AppMain.AMS_PARAM_DRAW_PRIMITIVE> .Release(setParam); return(0); }
public static float amVectorScalor(ref AppMain.SNNS_VECTOR4D pVec) { return(AppMain.amSqrt(AppMain.amPow2(pVec.x) + AppMain.amPow2(pVec.y) + AppMain.amPow2(pVec.z))); }
// Token: 0x06000A75 RID: 2677 RVA: 0x0005C964 File Offset: 0x0005AB64 public static void amMatrixCalcVector(ref AppMain.SNNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pSrc) { AppMain.NNS_MATRIX mtx = AppMain.amMatrixGetCurrent(); AppMain.nnTransformNormalVector(ref pDst, mtx, ref pSrc); }
public static void amVectorAdd(ref AppMain.NNS_VECTOR4D pDst, ref AppMain.SNNS_VECTOR4D pSrc) { pDst.x += pSrc.x; pDst.y += pSrc.y; pDst.z += pSrc.z; }