mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-08-17 12:39:27 -04:00
setup dolphin VEC/MTX function defines (#1903)
* setup VEC function defines * setup MTX function defines
This commit is contained in:
@@ -56,7 +56,7 @@ void J2DGrafContext::setup2D() {
|
||||
GXSetCullMode(GX_CULL_NONE);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
Mtx mtx;
|
||||
PSMTXIdentity(mtx);
|
||||
MTXIdentity(mtx);
|
||||
GXLoadTexMtxImm(mtx, GX_IDENTITY, GX_MTX3x4);
|
||||
GXSetChanCtrl(GX_COLOR0A0, GX_FALSE, GX_SRC_REG, GX_SRC_VTX, GX_LIGHT_NULL, GX_DF_NONE,
|
||||
GX_AF_NONE);
|
||||
|
||||
@@ -50,7 +50,7 @@ void J2DOrthoGraph::setOrtho(JGeometry::TBox2<f32> const& bounds, f32 far, f32 n
|
||||
|
||||
/* 802E9840-802E987C 2E4180 003C+00 1/0 0/0 0/0 .text setLookat__13J2DOrthoGraphFv */
|
||||
void J2DOrthoGraph::setLookat() {
|
||||
PSMTXIdentity(mPosMtx);
|
||||
MTXIdentity(mPosMtx);
|
||||
GXLoadPosMtxImm(mPosMtx, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -292,7 +292,7 @@ void J2DPane::draw(f32 x, f32 y, J2DGrafContext const* p_grafCtx, bool isOrthoGr
|
||||
f32 width = parent->mGlobalBounds.i.x - parent->mBounds.i.x;
|
||||
f32 height = parent->mGlobalBounds.i.y - parent->mBounds.i.y;
|
||||
mGlobalBounds.addPos(width, height);
|
||||
PSMTXConcat(parent->mGlobalMtx, mPositionMtx, mGlobalMtx);
|
||||
MTXConcat(parent->mGlobalMtx, mPositionMtx, mGlobalMtx);
|
||||
|
||||
if (unkBool) {
|
||||
if (isOrthoGraf) {
|
||||
@@ -308,7 +308,7 @@ void J2DPane::draw(f32 x, f32 y, J2DGrafContext const* p_grafCtx, bool isOrthoGr
|
||||
} else {
|
||||
mGlobalBounds.addPos(x, y);
|
||||
makeMatrix(mTranslateX + x, mTranslateY + y);
|
||||
PSMTXCopy(mPositionMtx, mGlobalMtx);
|
||||
MTXCopy(mPositionMtx, mGlobalMtx);
|
||||
mClipRect = mGlobalBounds;
|
||||
mColorAlpha = mAlpha;
|
||||
}
|
||||
@@ -528,15 +528,15 @@ void J2DPane::makeMatrix(f32 param_0, f32 param_1, f32 param_2, f32 param_3) {
|
||||
f32 tmpX = mRotateOffsetX - param_2;
|
||||
f32 tmpY = mRotateOffsetY - param_3;
|
||||
Mtx rotX, rotY, rotZ, rotMtx, mtx, tmp;
|
||||
PSMTXTrans(mtx, -tmpX, -tmpY, 0);
|
||||
PSMTXRotRad(rotX, 'x', DEG_TO_RAD(mRotateX));
|
||||
PSMTXRotRad(rotY, 'y', DEG_TO_RAD(mRotateY));
|
||||
PSMTXRotRad(rotZ, 'z', DEG_TO_RAD(-mRotateZ));
|
||||
PSMTXConcat(rotZ, rotX, tmp);
|
||||
PSMTXConcat(rotY, tmp, rotMtx);
|
||||
PSMTXScaleApply(mtx, mPositionMtx, mScaleX, mScaleY, 1);
|
||||
PSMTXConcat(rotMtx, mPositionMtx, tmp);
|
||||
PSMTXTransApply(tmp, mPositionMtx, param_0 + tmpX, param_1 + tmpY, 0);
|
||||
MTXTrans(mtx, -tmpX, -tmpY, 0);
|
||||
MTXRotRad(rotX, 'x', DEG_TO_RAD(mRotateX));
|
||||
MTXRotRad(rotY, 'y', DEG_TO_RAD(mRotateY));
|
||||
MTXRotRad(rotZ, 'z', DEG_TO_RAD(-mRotateZ));
|
||||
MTXConcat(rotZ, rotX, tmp);
|
||||
MTXConcat(rotY, tmp, rotMtx);
|
||||
MTXScaleApply(mtx, mPositionMtx, mScaleX, mScaleY, 1);
|
||||
MTXConcat(rotMtx, mPositionMtx, tmp);
|
||||
MTXTransApply(tmp, mPositionMtx, param_0 + tmpX, param_1 + tmpY, 0);
|
||||
}
|
||||
|
||||
/* 802F7680-802F76F8 2F1FC0 0078+00 1/0 7/3 0/0 .text setCullBack__7J2DPaneF11_GXCullMode
|
||||
|
||||
@@ -662,7 +662,7 @@ void J2DPicture::changeTexture(char const* param_0, u8 param_1, JUTPalette* para
|
||||
/* 802FDB28-802FDB90 2F8468 0068+00 1/0 1/0 0/0 .text drawSelf__10J2DPictureFff */
|
||||
void J2DPicture::drawSelf(f32 param_0, f32 param_1) {
|
||||
Mtx tmp;
|
||||
PSMTXIdentity(tmp);
|
||||
MTXIdentity(tmp);
|
||||
|
||||
drawSelf(param_0, param_1, &tmp);
|
||||
}
|
||||
@@ -732,7 +732,7 @@ void J2DPicture::drawTexCoord(f32 param_0, f32 param_1, f32 param_2, f32 param_3
|
||||
|
||||
getNewColor(black);
|
||||
setTevMode();
|
||||
PSMTXConcat((MtxP)param_12,mGlobalMtx,outputMtx);
|
||||
MTXConcat((MtxP)param_12,mGlobalMtx,outputMtx);
|
||||
|
||||
GXLoadPosMtxImm(outputMtx,0);
|
||||
GXClearVtxDesc();
|
||||
|
||||
@@ -305,7 +305,7 @@ void J2DTextBox::draw(f32 posX, f32 posY) {
|
||||
if (mStringPtr != NULL) {
|
||||
print.print(0.0f, 0.0f, mAlpha, "%s", mStringPtr);
|
||||
}
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -334,7 +334,7 @@ void J2DTextBox::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBind)
|
||||
print.printReturn(mStringPtr, param_2, 0.0f, hBind, VBIND_TOP, 0.0f, -mFontSizeY,
|
||||
mAlpha);
|
||||
}
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -421,7 +421,7 @@ bool J2DTextBox::setConnectParent(bool connected) {
|
||||
/* 803008E8-80300950 2FB228 0068+00 1/0 1/0 0/0 .text drawSelf__10J2DTextBoxFff */
|
||||
void J2DTextBox::drawSelf(f32 param_0, f32 param_1) {
|
||||
Mtx identity;
|
||||
PSMTXIdentity(identity);
|
||||
MTXIdentity(identity);
|
||||
|
||||
drawSelf(param_0, param_1, &identity);
|
||||
}
|
||||
@@ -434,7 +434,7 @@ void J2DTextBox::drawSelf(f32 param_0, f32 param_1, Mtx* p_mtx) {
|
||||
J2DPrint print(mFont, mCharSpacing, mLineSpacing, mCharColor, mGradientColor, mBlackColor,
|
||||
mWhiteColor);
|
||||
print.setFontSize(mFontSizeX, mFontSizeY);
|
||||
PSMTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
MTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
|
||||
GXLoadPosMtxImm(m, GX_PNMTX0);
|
||||
GXSetNumIndStages(0);
|
||||
|
||||
@@ -211,7 +211,7 @@ void J2DTextBoxEx::drawSelf(f32 param_0, f32 param_1, Mtx* p_mtx) {
|
||||
|
||||
if (mMaterial != NULL) {
|
||||
mMaterial->setGX();
|
||||
PSMTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
MTXConcat(*p_mtx, mGlobalMtx, m);
|
||||
|
||||
GXLoadPosMtxImm(m, GX_PNMTX0);
|
||||
GXClearVtxDesc();
|
||||
@@ -288,7 +288,7 @@ void J2DTextBoxEx::draw(f32 posX, f32 posY) {
|
||||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
@@ -346,7 +346,7 @@ void J2DTextBoxEx::draw(f32 posX, f32 posY, f32 param_2, J2DTextBoxHBinding hBin
|
||||
GXSetTevDirect((GXTevStageID)i);
|
||||
}
|
||||
|
||||
PSMTXIdentity(m);
|
||||
MTXIdentity(m);
|
||||
GXLoadPosMtxImm(m, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ void J3DMtxCalcCalcTransformBasic::calcTransform(J3DTransformInfo const& transIn
|
||||
mtxBuf->setScaleFlag(jntNo, 1);
|
||||
}
|
||||
|
||||
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
MTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
MTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
}
|
||||
|
||||
/* 8032EE50-8032EFBC 329790 016C+00 0/0 1/1 0/0 .text
|
||||
@@ -99,7 +99,7 @@ void J3DMtxCalcCalcTransformSoftimage::calcTransform(J3DTransformInfo const& tra
|
||||
transInfo.mTranslate.x * J3DSys::mCurrentS.x,
|
||||
transInfo.mTranslate.y * J3DSys::mCurrentS.y,
|
||||
transInfo.mTranslate.z * J3DSys::mCurrentS.z, anmMtx);
|
||||
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
MTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
|
||||
J3DSys::mCurrentS.x *= transInfo.mScale.x;
|
||||
J3DSys::mCurrentS.y *= transInfo.mScale.y;
|
||||
@@ -114,7 +114,7 @@ void J3DMtxCalcCalcTransformSoftimage::calcTransform(J3DTransformInfo const& tra
|
||||
anmMtx[2][3] = J3DSys::mCurrentMtx[2][3];
|
||||
} else {
|
||||
mtxBuf->setScaleFlag(jntNo, 1);
|
||||
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
MTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,8 +154,8 @@ void J3DMtxCalcCalcTransformMaya::calcTransform(J3DTransformInfo const& transInf
|
||||
anmMtx[2][2] *= invZ;
|
||||
}
|
||||
|
||||
PSMTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
PSMTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
MTXConcat(J3DSys::mCurrentMtx, anmMtx, J3DSys::mCurrentMtx);
|
||||
MTXCopy(J3DSys::mCurrentMtx, anmMtx);
|
||||
|
||||
J3DSys::mParentS.x = transInfo.mScale.x;
|
||||
J3DSys::mParentS.y = transInfo.mScale.y;
|
||||
|
||||
@@ -119,8 +119,8 @@ void J3DModel::initialize() {
|
||||
mBaseScale.y = 1.0f;
|
||||
mBaseScale.z = 1.0f;
|
||||
|
||||
PSMTXIdentity(mBaseTransformMtx);
|
||||
PSMTXIdentity(mInternalView);
|
||||
MTXIdentity(mBaseTransformMtx);
|
||||
MTXIdentity(mInternalView);
|
||||
|
||||
mMtxBuffer = NULL;
|
||||
mMatPacket = NULL;
|
||||
@@ -406,7 +406,7 @@ void J3DModel::calcDiffTexMtx() {
|
||||
J3DTexMtx* texMtxNode = texGenBlock->getTexMtx(j);
|
||||
J3DTexMtxObj* texMtxObj = shapePacket->getTexMtxObj();
|
||||
if (texMtxNode != NULL && texMtxObj != NULL) {
|
||||
PSMTXCopy(texMtxNode->getMtx(), texMtxObj->getMtx(j));
|
||||
MTXCopy(texMtxNode->getMtx(), texMtxObj->getMtx(j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,5 +317,5 @@ void J3DCalcViewBaseMtx(Mtx view, Vec const& scale, const Mtx& base, Mtx dst) {
|
||||
m[2][2] = base[2][2] * scale.z;
|
||||
m[2][3] = base[2][3];
|
||||
|
||||
PSMTXConcat(view, m, dst);
|
||||
MTXConcat(view, m, dst);
|
||||
}
|
||||
|
||||
@@ -534,8 +534,8 @@ void J3DSkinDeform::transformVtxPosNrm(J3DModelData* param_0) {
|
||||
u16 drawMtxIndex = param_0->getDrawMtxIndex(posIndex);
|
||||
Vec* pos = ((Vec*)param_0->getVtxPosArray()) + i;
|
||||
Mtx invMtx;
|
||||
PSMTXInverse(param_0->getInvJointMtx(drawMtxIndex), invMtx);
|
||||
PSMTXMultVec(invMtx, pos, pos);
|
||||
MTXInverse(param_0->getInvJointMtx(drawMtxIndex), invMtx);
|
||||
MTXMultVec(invMtx, pos, pos);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < nrmNum; i++) {
|
||||
@@ -544,8 +544,8 @@ void J3DSkinDeform::transformVtxPosNrm(J3DModelData* param_0) {
|
||||
u16 drawMtxIndex = param_0->getDrawMtxIndex(nrmIndex);
|
||||
Vec* nrm = ((Vec*)param_0->getVtxNrmArray()) + i;
|
||||
Mtx invMtx;
|
||||
PSMTXInverse(param_0->getInvJointMtx(drawMtxIndex), invMtx);
|
||||
PSMTXMultVecSR(invMtx, nrm, nrm);
|
||||
MTXInverse(param_0->getInvJointMtx(drawMtxIndex), invMtx);
|
||||
MTXMultVecSR(invMtx, nrm, nrm);
|
||||
}
|
||||
}
|
||||
field_0x19 = 1;
|
||||
@@ -561,7 +561,7 @@ void J3DSkinDeform::calcAnmInvJointMtx(J3DMtxBuffer* param_0) {
|
||||
Mtx* invJointMtx = ¶m_0->getJointTree()->getInvJointMtx(0);
|
||||
Mtx* posMtx = mPosMtx;
|
||||
for (int i = 0; i < jointNum; i++) {
|
||||
PSMTXConcat(anmMtx[i], invJointMtx[i], posMtx[i]);
|
||||
MTXConcat(anmMtx[i], invJointMtx[i], posMtx[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -393,7 +393,7 @@ asm void J3DDifferedTexMtx::loadExecute(f32 const (*param_0)[4]) {
|
||||
* loadMtxConcatView_PNGP__21J3DShapeMtxConcatViewCFiUs */
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PNGP(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
PSMTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(m, slot * 3);
|
||||
loadNrmMtx(slot, drw, m);
|
||||
@@ -403,7 +403,7 @@ void J3DShapeMtxConcatView::loadMtxConcatView_PNGP(int slot, u16 drw) const {
|
||||
* loadMtxConcatView_PCPU__21J3DShapeMtxConcatViewCFiUs */
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PCPU(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
PSMTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
loadNrmMtx(slot, drw, m);
|
||||
@@ -413,7 +413,7 @@ void J3DShapeMtxConcatView::loadMtxConcatView_PCPU(int slot, u16 drw) const {
|
||||
* loadMtxConcatView_NCPU__21J3DShapeMtxConcatViewCFiUs */
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_NCPU(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
PSMTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(m, slot * 3);
|
||||
J3DFifoLoadNrmMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
@@ -426,7 +426,7 @@ void J3DShapeMtxConcatView::loadMtxConcatView_NCPU(int slot, u16 drw) const {
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PNCPU(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
if (J3DDifferedTexMtx::sTexGenBlock != NULL) {
|
||||
PSMTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
J3DDifferedTexMtx::loadExecute(m);
|
||||
}
|
||||
J3DFifoLoadPosMtxImm(*j3dSys.getShapePacket()->getBaseMtxPtr(), slot * 3);
|
||||
@@ -439,8 +439,8 @@ void J3DShapeMtxConcatView::loadMtxConcatView_PNCPU(int slot, u16 drw) const {
|
||||
* loadMtxConcatView_PNGP_LOD__21J3DShapeMtxConcatViewCFiUs */
|
||||
void J3DShapeMtxConcatView::loadMtxConcatView_PNGP_LOD(int slot, u16 drw) const {
|
||||
Mtx m;
|
||||
PSMTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
PSMTXConcat(m, j3dSys.mModel->getModelData()->getInvJointMtx(drw), m);
|
||||
MTXConcat(*j3dSys.getShapePacket()->getBaseMtxPtr(), j3dSys.getModelDrawMtx(drw), m);
|
||||
MTXConcat(m, j3dSys.mModel->getModelData()->getInvJointMtx(drw), m);
|
||||
J3DDifferedTexMtx::load(m);
|
||||
J3DFifoLoadPosMtxImm(m, slot * 3);
|
||||
loadNrmMtx(slot, drw, m);
|
||||
|
||||
@@ -61,7 +61,7 @@ J3DSys::J3DSys() {
|
||||
makeZModeTable();
|
||||
|
||||
mFlags = 0;
|
||||
PSMTXIdentity(mViewMtx);
|
||||
MTXIdentity(mViewMtx);
|
||||
mDrawMode = 1;
|
||||
mMaterialMode = 0;
|
||||
mModel = NULL;
|
||||
|
||||
@@ -36,20 +36,20 @@ void J3DUClipper::calcViewFrustum() {
|
||||
Vec tmp2 = {-f5, f4, -mNear};
|
||||
Vec tmp3 = {f5, f4, -mNear};
|
||||
Vec tmp4 = {f5, -f4, -mNear};
|
||||
PSVECCrossProduct(&tmp2, &tmp1, &_04);
|
||||
PSVECCrossProduct(&tmp3, &tmp2, &_10);
|
||||
PSVECCrossProduct(&tmp4, &tmp3, &_1C);
|
||||
PSVECCrossProduct(&tmp1, &tmp4, &_28);
|
||||
PSVECNormalize(&_04, &_04);
|
||||
PSVECNormalize(&_10, &_10);
|
||||
PSVECNormalize(&_1C, &_1C);
|
||||
PSVECNormalize(&_28, &_28);
|
||||
VECCrossProduct(&tmp2, &tmp1, &_04);
|
||||
VECCrossProduct(&tmp3, &tmp2, &_10);
|
||||
VECCrossProduct(&tmp4, &tmp3, &_1C);
|
||||
VECCrossProduct(&tmp1, &tmp4, &_28);
|
||||
VECNormalize(&_04, &_04);
|
||||
VECNormalize(&_10, &_10);
|
||||
VECNormalize(&_1C, &_1C);
|
||||
VECNormalize(&_28, &_28);
|
||||
}
|
||||
|
||||
/* 802738FC-80273A44 26E23C 0148+00 0/0 3/3 2/2 .text clip__11J3DUClipperCFPA4_Cf3Vecf */
|
||||
u32 J3DUClipper::clip(f32 const (*param_0)[4], Vec param_1, f32 param_2) const {
|
||||
Vec vec1;
|
||||
PSMTXMultVec(param_0, ¶m_1, &vec1);
|
||||
MTXMultVec(param_0, ¶m_1, &vec1);
|
||||
if (-vec1.z < mNear - param_2) {
|
||||
return 1;
|
||||
}
|
||||
@@ -113,7 +113,7 @@ u32 J3DUClipper::clip(f32 const (*param_1)[4], Vec* param_2, Vec* param_3) const
|
||||
|
||||
for (u32 i = 0; i < 8; i++) {
|
||||
Vec vec1;
|
||||
PSMTXMultVec(param_1, local_80 + i, &vec1);
|
||||
MTXMultVec(param_1, local_80 + i, &vec1);
|
||||
s32 r4 = 0;
|
||||
if (-vec1.z < mNear) {
|
||||
local_98[4]++;
|
||||
|
||||
@@ -658,7 +658,7 @@ static void noLoadPrj(JPAEmitterWorkData const* work, const Mtx srt) {
|
||||
/* 80277C90-80277CC8 2725D0 0038+00 1/0 0/0 0/0 .text loadPrj__FPC18JPAEmitterWorkDataPA4_Cf */
|
||||
void loadPrj(JPAEmitterWorkData const* work, const Mtx srt) {
|
||||
Mtx mtx;
|
||||
PSMTXConcat(work->mPrjMtx, srt, mtx);
|
||||
MTXConcat(work->mPrjMtx, srt, mtx);
|
||||
GXLoadTexMtxImm(mtx, GX_TEXMTX0, GX_MTX3x4);
|
||||
}
|
||||
|
||||
@@ -692,8 +692,8 @@ static void loadPrjAnm(JPAEmitterWorkData const* work, f32 const (*param_1)[4])
|
||||
local_108[2][1] = 0.0f;
|
||||
local_108[2][2] = 1.0f;
|
||||
local_108[2][3] = 0.0f;
|
||||
PSMTXConcat(local_108, work->mPrjMtx, local_108);
|
||||
PSMTXConcat(local_108, param_1, local_108);
|
||||
MTXConcat(local_108, work->mPrjMtx, local_108);
|
||||
MTXConcat(local_108, param_1, local_108);
|
||||
GXLoadTexMtxImm(local_108, 0x1e, GX_MTX3x4);
|
||||
}
|
||||
#else
|
||||
@@ -736,7 +736,7 @@ static projectionFunc p_prj[3] = {
|
||||
void JPADrawBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
PSMTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
Mtx local_38;
|
||||
local_38[0][0] = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
local_38[0][3] = local_48.x;
|
||||
@@ -773,7 +773,7 @@ asm void JPADrawBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1)
|
||||
void JPADrawRotBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
PSMTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
f32 particleX = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
@@ -815,7 +815,7 @@ asm void JPADrawRotBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param
|
||||
void JPADrawYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
PSMTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
Mtx local_38;
|
||||
f32 particleY = work->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
local_38[0][0] = work->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
@@ -853,7 +853,7 @@ asm void JPADrawYBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1
|
||||
void JPADrawRotYBillboard(JPAEmitterWorkData* work, JPABaseParticle* param_1) {
|
||||
if (param_1->checkStatus(8) == 0) {
|
||||
JGeometry::TVec3<f32> local_48;
|
||||
PSMTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
MTXMultVec(work->mPosCamMtx, param_1->mPosition, local_48);
|
||||
f32 sinRot = JMASSin(param_1->mRotateAngle);
|
||||
f32 cosRot = JMASCos(param_1->mRotateAngle);
|
||||
Mtx local_38;
|
||||
@@ -1168,7 +1168,7 @@ void JPADrawDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
local_60[2][2] = local_78.z;
|
||||
local_60[2][3] = param_1->mPosition.z;
|
||||
p_plane[param_0->mPlaneType](local_60, fVar1, fVar2);
|
||||
PSMTXConcat(param_0->mPosCamMtx, local_60, local_60);
|
||||
MTXConcat(param_0->mPosCamMtx, local_60, local_60);
|
||||
GXLoadPosMtxImm(local_60, 0);
|
||||
p_prj[param_0->mPrjType](param_0, local_60);
|
||||
GXCallDisplayList(p_dl[param_0->mDLType], sizeof(jpa_dl));
|
||||
@@ -1223,8 +1223,8 @@ void JPADrawRotDirection(JPAEmitterWorkData* param_0, JPABaseParticle* param_1)
|
||||
local_60[2][1] = local_6c.z;
|
||||
local_60[2][2] = local_78.z;
|
||||
local_60[2][3] = param_1->mPosition.z;
|
||||
PSMTXConcat(local_60, auStack_80, auStack_80);
|
||||
PSMTXConcat(param_0->mPosCamMtx, auStack_80, local_60);
|
||||
MTXConcat(local_60, auStack_80, auStack_80);
|
||||
MTXConcat(param_0->mPosCamMtx, auStack_80, local_60);
|
||||
GXLoadPosMtxImm(local_60, 0);
|
||||
p_prj[param_0->mPrjType](param_0, local_60);
|
||||
GXCallDisplayList(p_dl[param_0->mDLType], sizeof(jpa_dl));
|
||||
@@ -1257,9 +1257,9 @@ void JPADrawDBillboard(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
local_70.cross(local_70, aTStack_7c);
|
||||
if (!local_70.isZero()) {
|
||||
local_70.normalize();
|
||||
PSMTXMultVecSR(param_0->mPosCamMtx, local_70, local_70);
|
||||
MTXMultVecSR(param_0->mPosCamMtx, local_70, local_70);
|
||||
JGeometry::TVec3<f32> local_88;
|
||||
PSMTXMultVec(param_0->mPosCamMtx, param_1->mPosition, local_88);
|
||||
MTXMultVec(param_0->mPosCamMtx, param_1->mPosition, local_88);
|
||||
f32 particleX = param_0->mGlobalPtclScl.x * param_1->mParticleScaleX;
|
||||
f32 particleY = param_0->mGlobalPtclScl.y * param_1->mParticleScaleY;
|
||||
Mtx local_60;
|
||||
@@ -1306,7 +1306,7 @@ void JPADrawRotation(JPAEmitterWorkData* param_0, JPABaseParticle* param_1) {
|
||||
auStack_88[0][3] = param_1->mPosition.x;
|
||||
auStack_88[1][3] = param_1->mPosition.y;
|
||||
auStack_88[2][3] = param_1->mPosition.z;
|
||||
PSMTXConcat(param_0->mPosCamMtx, auStack_88, auStack_88);
|
||||
MTXConcat(param_0->mPosCamMtx, auStack_88, auStack_88);
|
||||
GXLoadPosMtxImm(auStack_88, 0);
|
||||
p_prj[param_0->mPrjType](param_0, auStack_88);
|
||||
GXCallDisplayList(p_dl[param_0->mDLType], sizeof(jpa_dl));
|
||||
@@ -1473,7 +1473,7 @@ void JPADrawStripe(JPAEmitterWorkData* param_0) {
|
||||
local_c8[2][1] = local_f8.z;
|
||||
local_c8[2][2] = pTVar7->mBaseAxis.z;
|
||||
local_c8[2][3] = 0.0f;
|
||||
PSMTXMultVecArraySR(local_c8, local_e0, local_e0, 2);
|
||||
MTXMultVecArraySR(local_c8, local_e0, local_e0, 2);
|
||||
GXPosition3f32(local_e0.x + local_ec.x, local_e0.y + local_ec.y,
|
||||
local_e0.z + local_ec.z);
|
||||
GXTexCoord2f32(0.0f, dVar16);
|
||||
|
||||
@@ -55,7 +55,7 @@ void JPABaseEmitter::init(JPAEmitterManager* param_0, JPAResource* param_1) {
|
||||
mRndmDirSpeed = mpRes->getDyn()->getInitVelRndm();
|
||||
mAirResist = mpRes->getDyn()->getAirRes();
|
||||
mRndm.set_seed(mpEmtrMgr->mpWorkData->mRndm.get_rndm_u());
|
||||
PSMTXIdentity(mGlobalRot);
|
||||
MTXIdentity(mGlobalRot);
|
||||
mGlobalScl.set(1.0f, 1.0f, 1.0f);
|
||||
mGlobalTrs.zero();
|
||||
mGlobalPScl.set(1.0f, 1.0f);
|
||||
@@ -156,12 +156,12 @@ bool JPABaseEmitter::processTermination() {
|
||||
* calcEmitterGlobalPosition__14JPABaseEmitterCFPQ29JGeometry8TVec3<f> */
|
||||
void JPABaseEmitter::calcEmitterGlobalPosition(JGeometry::TVec3<f32>* dst) const {
|
||||
Mtx mtx;
|
||||
PSMTXScale(mtx, mGlobalScl.x, mGlobalScl.y, mGlobalScl.z);
|
||||
PSMTXConcat(mGlobalRot, mtx, mtx);
|
||||
MTXScale(mtx, mGlobalScl.x, mGlobalScl.y, mGlobalScl.z);
|
||||
MTXConcat(mGlobalRot, mtx, mtx);
|
||||
mtx[0][3] = mGlobalTrs.x;
|
||||
mtx[1][3] = mGlobalTrs.y;
|
||||
mtx[2][3] = mGlobalTrs.z;
|
||||
PSMTXMultVec(mtx, mLocalTrs, *dst);
|
||||
MTXMultVec(mtx, mLocalTrs, *dst);
|
||||
}
|
||||
|
||||
/* 8027EF30-8027EF40 279870 0010+00 0/0 1/1 0/0 .text getCurrentCreateNumber__14JPABaseEmitterCFv
|
||||
|
||||
@@ -139,7 +139,7 @@ void JPASetRMtxSTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4],
|
||||
param_2->y = aTStack_54.length();
|
||||
aTStack_54.set(param_0[0][2], param_0[1][2], param_0[2][2]);
|
||||
param_2->z = aTStack_54.length();
|
||||
PSMTXIdentity(param_1);
|
||||
MTXIdentity(param_1);
|
||||
if (param_2->x != 0.0f) {
|
||||
f32 fVar5 = 1.0f / param_2->x;
|
||||
param_1[0][0] = param_0[0][0] * fVar5;
|
||||
|
||||
@@ -759,8 +759,8 @@ void JPAResource::calcWorkData_d(JPAEmitterWorkData* work) {
|
||||
Mtx mtx;
|
||||
JPAGetXYZRotateMtx(work->mpEmtr->mLocalRot.x * 0xB6, work->mpEmtr->mLocalRot.y * 0xB6,
|
||||
work->mpEmtr->mLocalRot.z * 0xB6, mtx);
|
||||
PSMTXConcat(work->mpEmtr->mGlobalRot, mtx, work->mGlobalRot);
|
||||
PSMTXMultVecSR(work->mGlobalRot, (Vec*)&work->mpEmtr->mLocalDir, (Vec*)&work->mGlobalEmtrDir);
|
||||
MTXConcat(work->mpEmtr->mGlobalRot, mtx, work->mGlobalRot);
|
||||
MTXMultVecSR(work->mGlobalRot, (Vec*)&work->mpEmtr->mLocalDir, (Vec*)&work->mGlobalEmtrDir);
|
||||
}
|
||||
|
||||
/* 80276A8C-80276A90 2713CC 0004+00 0/0 3/0 0/0 .text
|
||||
|
||||
@@ -343,7 +343,7 @@ bool cCcD_TriAttr::GetNVec(cXyz const& param_0, cXyz* pOut) const {
|
||||
*pOut = mNormal;
|
||||
} else {
|
||||
*pOut = mNormal;
|
||||
PSVECScale(pOut, pOut, -1.0f);
|
||||
VECScale(pOut, pOut, -1.0f);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -436,32 +436,32 @@ void cCcD_CpsAttr::CalcAabBox() {
|
||||
bool cCcD_CpsAttr::GetNVec(cXyz const& param_0, cXyz* param_1) const {
|
||||
Vec diff;
|
||||
const cXyz& endP = GetEndP();
|
||||
PSVECSubtract(&endP, &mStart, &diff);
|
||||
VECSubtract(&endP, &mStart, &diff);
|
||||
|
||||
f32 diffLen = PSVECDotProduct(&diff, &diff);
|
||||
f32 diffLen = VECDotProduct(&diff, &diff);
|
||||
if (cM3d_IsZero(diffLen)) {
|
||||
return false;
|
||||
} else {
|
||||
Vec vec1, vec2;
|
||||
PSVECSubtract(¶m_0, &mStart, &vec1);
|
||||
f32 vec1Len = PSVECDotProduct(&vec1, &diff) / diffLen;
|
||||
VECSubtract(¶m_0, &mStart, &vec1);
|
||||
f32 vec1Len = VECDotProduct(&vec1, &diff) / diffLen;
|
||||
if (vec1Len < 0.0f) {
|
||||
vec2 = mStart;
|
||||
} else {
|
||||
if (vec1Len > 1.0f) {
|
||||
vec2 = endP;
|
||||
} else {
|
||||
PSVECScale(&diff, &diff, vec1Len);
|
||||
PSVECAdd(&diff, &mStart, &vec2);
|
||||
VECScale(&diff, &diff, vec1Len);
|
||||
VECAdd(&diff, &mStart, &vec2);
|
||||
}
|
||||
}
|
||||
|
||||
PSVECSubtract(¶m_0, &vec2, param_1);
|
||||
if (cM3d_IsZero(PSVECMag(param_1))) {
|
||||
VECSubtract(¶m_0, &vec2, param_1);
|
||||
if (cM3d_IsZero(VECMag(param_1))) {
|
||||
param_1->set(0.0f, 0.0f, 0.0f);
|
||||
return false;
|
||||
} else {
|
||||
PSVECNormalize(param_1, param_1);
|
||||
VECNormalize(param_1, param_1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -569,12 +569,12 @@ bool cCcD_CylAttr::GetNVec(cXyz const& param_0, cXyz* param_1) const {
|
||||
}
|
||||
}
|
||||
|
||||
PSVECSubtract(¶m_0, &vec, param_1);
|
||||
if (cM3d_IsZero(PSVECMag(param_1))) {
|
||||
VECSubtract(¶m_0, &vec, param_1);
|
||||
if (cM3d_IsZero(VECMag(param_1))) {
|
||||
param_1->set(0.0f, 0.0f, 0.0f);
|
||||
return false;
|
||||
} else {
|
||||
PSVECNormalize(param_1, param_1);
|
||||
VECNormalize(param_1, param_1);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -692,13 +692,13 @@ bool cCcD_SphAttr::GetNVec(cXyz const& param_0, cXyz* param_1) const {
|
||||
param_1->y = param_0.y - mCenter.y;
|
||||
param_1->z = param_0.z - mCenter.z;
|
||||
|
||||
if (cM3d_IsZero(PSVECMag(param_1))) {
|
||||
if (cM3d_IsZero(VECMag(param_1))) {
|
||||
param_1->x = 0.0f;
|
||||
param_1->y = 0.0f;
|
||||
param_1->z = 0.0f;
|
||||
return false;
|
||||
} else {
|
||||
PSVECNormalize(param_1, param_1);
|
||||
VECNormalize(param_1, param_1);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,8 +310,8 @@ void cCcS::SetPosCorrect(cCcD_Obj* obj1, cXyz* xyz1, cCcD_Obj* obj2, cXyz* xyz2,
|
||||
Vec obj2Move;
|
||||
Vec objsDist;
|
||||
if (bothCoSph3DCrr) {
|
||||
PSVECSubtract(xyz2, xyz1, &objsDist);
|
||||
objDistLen = PSVECMag(&objsDist);
|
||||
VECSubtract(xyz2, xyz1, &objsDist);
|
||||
objDistLen = VECMag(&objsDist);
|
||||
} else {
|
||||
objsDist.x = xyz2->x - xyz1->x;
|
||||
objsDist.y = 0;
|
||||
@@ -320,10 +320,10 @@ void cCcS::SetPosCorrect(cCcD_Obj* obj1, cXyz* xyz1, cCcD_Obj* obj2, cXyz* xyz2,
|
||||
}
|
||||
if (!cM3d_IsZero(objDistLen)) {
|
||||
if (bothCoSph3DCrr) {
|
||||
PSVECScale(&objsDist, &objsDist, crossLen / objDistLen);
|
||||
VECScale(&objsDist, &objsDist, crossLen / objDistLen);
|
||||
obj2Weight *= -1;
|
||||
PSVECScale(&objsDist, &obj1Move, obj2Weight);
|
||||
PSVECScale(&objsDist, &obj2Move, obj1Weight);
|
||||
VECScale(&objsDist, &obj1Move, obj2Weight);
|
||||
VECScale(&objsDist, &obj2Move, obj1Weight);
|
||||
} else {
|
||||
f32 pushFactor = crossLen / objDistLen;
|
||||
objsDist.x *= pushFactor;
|
||||
@@ -350,8 +350,8 @@ void cCcS::SetPosCorrect(cCcD_Obj* obj1, cXyz* xyz1, cCcD_Obj* obj2, cXyz* xyz2,
|
||||
}
|
||||
obj1->GetStts()->PlusCcMove(obj1Move.x, obj1Move.y, obj1Move.z);
|
||||
obj2->GetStts()->PlusCcMove(obj2Move.x, obj2Move.y, obj2Move.z);
|
||||
PSVECAdd(xyz1, &obj1Move, xyz1);
|
||||
PSVECAdd(xyz2, &obj2Move, xyz2);
|
||||
VECAdd(xyz1, &obj1Move, xyz1);
|
||||
VECAdd(xyz2, &obj2Move, xyz2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -363,36 +363,36 @@ void MtxInit() {
|
||||
/* 80270E5C-80270EA4 26B79C 0048+00 0/0 0/0 43/43 .text MtxTrans__FfffUc */
|
||||
void MtxTrans(f32 x_trans, f32 y_trans, f32 z_trans, u8 param_3) {
|
||||
if (param_3 == 0) {
|
||||
PSMTXTrans(*calc_mtx, x_trans, y_trans, z_trans);
|
||||
MTXTrans(*calc_mtx, x_trans, y_trans, z_trans);
|
||||
} else {
|
||||
Mtx mtx;
|
||||
PSMTXTrans(mtx, x_trans, y_trans, z_trans);
|
||||
PSMTXConcat(*calc_mtx, mtx, *calc_mtx);
|
||||
MTXTrans(mtx, x_trans, y_trans, z_trans);
|
||||
MTXConcat(*calc_mtx, mtx, *calc_mtx);
|
||||
}
|
||||
}
|
||||
|
||||
/* 80270EA4-80270EEC 26B7E4 0048+00 0/0 0/0 46/46 .text MtxScale__FfffUc */
|
||||
void MtxScale(f32 x_trans, f32 y_trans, f32 z_trans, u8 param_3) {
|
||||
if (param_3 == 0) {
|
||||
PSMTXScale(*calc_mtx, x_trans, y_trans, z_trans);
|
||||
MTXScale(*calc_mtx, x_trans, y_trans, z_trans);
|
||||
} else {
|
||||
Mtx mtx;
|
||||
PSMTXScale(mtx, x_trans, y_trans, z_trans);
|
||||
PSMTXConcat(*calc_mtx, mtx, *calc_mtx);
|
||||
MTXScale(mtx, x_trans, y_trans, z_trans);
|
||||
MTXConcat(*calc_mtx, mtx, *calc_mtx);
|
||||
}
|
||||
}
|
||||
|
||||
/* 80270EEC-80270F1C 26B82C 0030+00 0/0 2/2 615/615 .text MtxPosition__FP4cXyzP4cXyz */
|
||||
void MtxPosition(cXyz* src, cXyz* dest) {
|
||||
PSMTXMultVec(*calc_mtx, src, dest);
|
||||
MTXMultVec(*calc_mtx, src, dest);
|
||||
}
|
||||
|
||||
/* 80270F1C-80270F58 26B85C 003C+00 0/0 0/0 20/20 .text MtxPush__Fv */
|
||||
void MtxPush() {
|
||||
Mtx mtx;
|
||||
PSMTXCopy(*calc_mtx, mtx);
|
||||
MTXCopy(*calc_mtx, mtx);
|
||||
calc_mtx++;
|
||||
PSMTXCopy(mtx, *calc_mtx);
|
||||
MTXCopy(mtx, *calc_mtx);
|
||||
}
|
||||
|
||||
/* 80270F58-80270F68 26B898 0010+00 0/0 0/0 20/20 .text MtxPull__Fv */
|
||||
|
||||
@@ -117,15 +117,15 @@ f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON;
|
||||
*/
|
||||
void cM3d_InDivPos1(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) {
|
||||
Vec tmp;
|
||||
PSVECScale(pVecB, &tmp, pF);
|
||||
PSVECAdd(&tmp, pVecA, pOut);
|
||||
VECScale(pVecB, &tmp, pF);
|
||||
VECAdd(&tmp, pVecA, pOut);
|
||||
}
|
||||
|
||||
/* 802685B0-80268614 262EF0 0064+00 2/2 1/1 2/2 .text cM3d_InDivPos2__FPC3VecPC3VecfP3Vec
|
||||
*/
|
||||
void cM3d_InDivPos2(const Vec* pVecA, const Vec* pVecB, f32 pF, Vec* pOut) {
|
||||
Vec tmp;
|
||||
PSVECSubtract(pVecB, pVecA, &tmp);
|
||||
VECSubtract(pVecB, pVecA, &tmp);
|
||||
cM3d_InDivPos1(pVecA, &tmp, pF, pOut);
|
||||
}
|
||||
|
||||
@@ -189,24 +189,24 @@ bool cM3d_Len2dSqPntAndSegLine(f32 param_1, f32 param_2, f32 param_3, f32 param_
|
||||
bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOutVec, f32* pOutF) {
|
||||
bool retVal = false;
|
||||
Vec tmp;
|
||||
PSVECSubtract(&pLine->GetEndP(), &pLine->GetStartP(), &tmp);
|
||||
f32 seqLen = PSVECDotProduct(&tmp, &tmp);
|
||||
VECSubtract(&pLine->GetEndP(), &pLine->GetStartP(), &tmp);
|
||||
f32 seqLen = VECDotProduct(&tmp, &tmp);
|
||||
if (cM3d_IsZero(seqLen)) {
|
||||
*pOutF = /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
return retVal;
|
||||
} else {
|
||||
Vec tmp2;
|
||||
PSVECSubtract(pVec, &pLine->GetStartP(), &tmp2);
|
||||
f32 tmpF = PSVECDotProduct(&tmp2, &tmp);
|
||||
VECSubtract(pVec, &pLine->GetStartP(), &tmp2);
|
||||
f32 tmpF = VECDotProduct(&tmp2, &tmp);
|
||||
tmpF /= seqLen;
|
||||
if (tmpF < /* 0.0 */ FLOAT_LABEL(lit_2256) || tmpF > /* 1.0 */ FLOAT_LABEL(lit_2273)) {
|
||||
retVal = false;
|
||||
} else {
|
||||
retVal = true;
|
||||
}
|
||||
PSVECScale(&tmp, &tmp, tmpF);
|
||||
PSVECAdd(&tmp, &pLine->GetStartP(), pOutVec);
|
||||
*pOutF = PSVECSquareDistance(pOutVec, pVec);
|
||||
VECScale(&tmp, &tmp, tmpF);
|
||||
VECAdd(&tmp, &pLine->GetStartP(), pOutVec);
|
||||
*pOutF = VECSquareDistance(pOutVec, pVec);
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
@@ -214,11 +214,11 @@ bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin* pLine, const Vec* pVec, Vec* pOut
|
||||
/* 80268814-80268894 263154 0080+00 1/1 3/3 0/0 .text cM3d_SignedLenPlaAndPos__FPC8cM3dGPlaPC3Vec
|
||||
*/
|
||||
f32 cM3d_SignedLenPlaAndPos(const cM3dGPla* pPlane, const Vec* pPosition) {
|
||||
f32 mag = PSVECMag(&pPlane->GetNP());
|
||||
f32 mag = VECMag(&pPlane->GetNP());
|
||||
if (cM3d_IsZero(mag)) {
|
||||
return /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
} else {
|
||||
return (pPlane->mD + PSVECDotProduct(&pPlane->GetNP(), pPosition)) / mag;
|
||||
return (pPlane->mD + VECDotProduct(&pPlane->GetNP(), pPosition)) / mag;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,9 +232,9 @@ f32 cM3d_VectorProduct2d(f32 pX1, f32 pY1, f32 pX2, f32 pY2, f32 pX3, f32 pY3) {
|
||||
void cM3d_VectorProduct(const cXyz* pVecA, const cXyz* pVecB, const cXyz* pVecC, cXyz* pVecOut) {
|
||||
Vec tmp1;
|
||||
Vec tmp2;
|
||||
PSVECSubtract(pVecB, pVecA, &tmp1);
|
||||
PSVECSubtract(pVecC, pVecA, &tmp2);
|
||||
PSVECCrossProduct(&tmp1, &tmp2, pVecOut);
|
||||
VECSubtract(pVecB, pVecA, &tmp1);
|
||||
VECSubtract(pVecC, pVecA, &tmp2);
|
||||
VECCrossProduct(&tmp1, &tmp2, pVecOut);
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
@@ -245,13 +245,13 @@ SECTION_SDATA2 static f32 lit_2346 = 1.0f / 50.0f;
|
||||
void cM3d_CalcPla(const Vec* pVecA, const Vec* pVecB, const Vec* pVecC, Vec* pVecOut, f32* pD) {
|
||||
Vec tmp2;
|
||||
Vec tmp1;
|
||||
PSVECSubtract(pVecB, pVecA, &tmp1);
|
||||
PSVECSubtract(pVecC, pVecA, &tmp2);
|
||||
PSVECCrossProduct(&tmp1, &tmp2, pVecOut);
|
||||
f32 mag = PSVECMag(pVecOut);
|
||||
VECSubtract(pVecB, pVecA, &tmp1);
|
||||
VECSubtract(pVecC, pVecA, &tmp2);
|
||||
VECCrossProduct(&tmp1, &tmp2, pVecOut);
|
||||
f32 mag = VECMag(pVecOut);
|
||||
if (fabsf(mag) >= /* 0.02 */ FLOAT_LABEL(lit_2346)) {
|
||||
PSVECScale(pVecOut, pVecOut, /* 1.0 */ FLOAT_LABEL(lit_2273) / mag);
|
||||
*pD = -PSVECDotProduct(pVecOut, pVecA);
|
||||
VECScale(pVecOut, pVecOut, /* 1.0 */ FLOAT_LABEL(lit_2273) / mag);
|
||||
*pD = -VECDotProduct(pVecOut, pVecA);
|
||||
} else {
|
||||
f32 zero = /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
pVecOut->y = zero;
|
||||
@@ -346,23 +346,23 @@ int cM3d_Check_LinLin(const cM3dGLin* pLinA, const cM3dGLin* pLinB, f32* pFloatA
|
||||
Vec linBVec;
|
||||
pLinA->CalcVec(&linAVec);
|
||||
pLinB->CalcVec(&linBVec);
|
||||
f32 linALen = PSVECMag(&linAVec);
|
||||
f32 linBLen = PSVECMag(&linBVec);
|
||||
f32 linALen = VECMag(&linAVec);
|
||||
f32 linBLen = VECMag(&linBVec);
|
||||
if (cM3d_IsZero(linALen) || cM3d_IsZero(linBLen)) {
|
||||
return 1;
|
||||
} else {
|
||||
f32 invLinALen = /* 1.0 */ FLOAT_LABEL(lit_2273) / linALen;
|
||||
f32 invLinBLen = /* 1.0 */ FLOAT_LABEL(lit_2273) / linBLen;
|
||||
PSVECScale(&linAVec, &linAVec, invLinALen);
|
||||
PSVECScale(&linBVec, &linBVec, invLinBLen);
|
||||
VECScale(&linAVec, &linAVec, invLinALen);
|
||||
VECScale(&linBVec, &linBVec, invLinBLen);
|
||||
Vec tmp;
|
||||
PSVECSubtract(&pLinA->GetStartP(), &pLinB->GetStartP(), &tmp);
|
||||
f32 tmpF = -PSVECDotProduct(&linAVec, &linBVec);
|
||||
f32 tmpF2 = PSVECDotProduct(&tmp, &linAVec);
|
||||
PSVECSquareMag(&tmp); // result not used
|
||||
VECSubtract(&pLinA->GetStartP(), &pLinB->GetStartP(), &tmp);
|
||||
f32 tmpF = -VECDotProduct(&linAVec, &linBVec);
|
||||
f32 tmpF2 = VECDotProduct(&tmp, &linAVec);
|
||||
VECSquareMag(&tmp); // result not used
|
||||
f32 tmpF3 = fabsf(/* 1.0 */ FLOAT_LABEL(lit_2273) - (tmpF * tmpF));
|
||||
if (!cM3d_IsZero(tmpF3)) {
|
||||
f32 tmpF4 = -PSVECDotProduct(&tmp, &linBVec);
|
||||
f32 tmpF4 = -VECDotProduct(&tmp, &linBVec);
|
||||
f32 tmpF7 = /* 1.0 */ FLOAT_LABEL(lit_2273) / tmpF3;
|
||||
f32 outFloatAtmp = ((tmpF * tmpF4) - tmpF2) * tmpF7;
|
||||
*pFloatA = outFloatAtmp * invLinALen;
|
||||
@@ -377,7 +377,7 @@ int cM3d_Check_LinLin(const cM3dGLin* pLinA, const cM3dGLin* pLinB, f32* pFloatA
|
||||
tmpF6 = linBLen;
|
||||
tmpF5 = (tmpF6 * tmpF) - tmpF2;
|
||||
}
|
||||
f32 tmpF7 = PSVECDotProduct(&tmp, &linBVec);
|
||||
f32 tmpF7 = VECDotProduct(&tmp, &linBVec);
|
||||
if (tmpF5 < /* 0.0 */ FLOAT_LABEL(lit_2256) || tmpF5 > linALen) {
|
||||
tmpF5 = /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
tmpF6 = tmpF7;
|
||||
@@ -897,9 +897,9 @@ bool cM3d_Cross_SphSph(const cM3dGSph* pSphereA, const cM3dGSph* pSphereB, Vec*
|
||||
// could be an inlined function
|
||||
f32 tmpF = pSphereB->GetR() / centerDist;
|
||||
Vec tmp;
|
||||
PSVECSubtract(&pSphereA->GetC(), &pSphereB->GetC(), &tmp);
|
||||
PSVECScale(&tmp, &tmp, tmpF);
|
||||
PSVECAdd(&tmp, &pSphereB->GetC(), pVecOut);
|
||||
VECSubtract(&pSphereA->GetC(), &pSphereB->GetC(), &tmp);
|
||||
VECScale(&tmp, &tmp, tmpF);
|
||||
VECAdd(&tmp, &pSphereB->GetC(), pVecOut);
|
||||
} else {
|
||||
*pVecOut = pSphereA->GetC();
|
||||
}
|
||||
@@ -918,9 +918,9 @@ SECTION_SDATA2 static f32 lit_3892 = 0.5f;
|
||||
void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph* pSphere, const cM3dGTri* pTriangle, Vec* pVecOut) {
|
||||
Vec tmp2;
|
||||
Vec tmp;
|
||||
PSVECAdd(&pTriangle->mA, &pTriangle->mB, &tmp);
|
||||
PSVECScale(&tmp, &tmp2, /* 0.5 */ FLOAT_LABEL(lit_3892));
|
||||
f32 sqDist = PSVECSquareDistance(&tmp2, &pSphere->GetC());
|
||||
VECAdd(&pTriangle->mA, &pTriangle->mB, &tmp);
|
||||
VECScale(&tmp, &tmp2, /* 0.5 */ FLOAT_LABEL(lit_3892));
|
||||
f32 sqDist = VECSquareDistance(&tmp2, &pSphere->GetC());
|
||||
if (cM3d_IsZero(sqDist)) {
|
||||
*pVecOut = pSphere->GetC();
|
||||
} else {
|
||||
@@ -1071,8 +1071,8 @@ inline void cM3d_2LinCenter(cM3dGLin const pLinA, f32 pLinAF, cM3dGLin const& pL
|
||||
Vec tmp, tmp2;
|
||||
pLinA.CalcPos(&tmp, pLinAF);
|
||||
pLinB.CalcPos(&tmp2, pLinBF);
|
||||
PSVECAdd(&tmp, &tmp2, pVecOut);
|
||||
PSVECScale(pVecOut, pVecOut, /* 0.5 */ FLOAT_LABEL(lit_3892));
|
||||
VECAdd(&tmp, &tmp2, pVecOut);
|
||||
VECScale(pVecOut, pVecOut, /* 0.5 */ FLOAT_LABEL(lit_3892));
|
||||
}
|
||||
|
||||
/* 8026E12C-8026E4FC 268A6C 03D0+00 0/0 2/2 0/0 .text
|
||||
@@ -1115,7 +1115,7 @@ void cM3d_PlaneCrossLineProcWork(f32 f1, f32 f2, f32 f3, f32 f4, f32 f5, f32 f6,
|
||||
static int cM3d_2PlaneCrossLine(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB,
|
||||
cM3dGLin* pLinOut) {
|
||||
Vec tmp;
|
||||
PSVECCrossProduct(&pPlaneA.GetNP(), &pPlaneB.GetNP(), &tmp);
|
||||
VECCrossProduct(&pPlaneA.GetNP(), &pPlaneB.GetNP(), &tmp);
|
||||
if (cM3d_IsZero(tmp.x) && cM3d_IsZero(tmp.y) && cM3d_IsZero(tmp.z)) {
|
||||
return 0;
|
||||
} else {
|
||||
@@ -1138,12 +1138,12 @@ static int cM3d_2PlaneCrossLine(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB
|
||||
&pLinOut->GetStartP().x, &pLinOut->GetStartP().y);
|
||||
pLinOut->GetStartP().z = /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
}
|
||||
f32 scale = PSVECMag(&pLinOut->GetStartP());
|
||||
f32 scale = VECMag(&pLinOut->GetStartP());
|
||||
if (cM3d_IsZero(scale)) {
|
||||
scale = /* 1.0 */ FLOAT_LABEL(lit_2273);
|
||||
}
|
||||
PSVECScale(&tmp, &tmp, scale);
|
||||
PSVECAdd(&pLinOut->GetStartP(), &tmp, &pLinOut->GetEndP());
|
||||
VECScale(&tmp, &tmp, scale);
|
||||
VECAdd(&pLinOut->GetStartP(), &tmp, &pLinOut->GetEndP());
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -1174,15 +1174,15 @@ f32 cM3d_lineVsPosSuisenCross(const cM3dGLin* pLine, const Vec* pPoint, Vec* pVe
|
||||
Vec tmp2;
|
||||
Vec tmp3;
|
||||
pLine->CalcVec(&tmp1);
|
||||
f32 diffLen = PSVECSquareMag(&tmp1);
|
||||
f32 diffLen = VECSquareMag(&tmp1);
|
||||
if (cM3d_IsZero(diffLen)) {
|
||||
*pVecOut = *pPoint;
|
||||
return /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
} else {
|
||||
PSVECSubtract(pPoint, &pLine->GetStartP(), &tmp2);
|
||||
f32 retVal = PSVECDotProduct(&tmp2, &tmp1) / diffLen;
|
||||
PSVECScale(&tmp1, &tmp3, retVal);
|
||||
PSVECAdd(&tmp3, &pLine->GetStartP(), pVecOut);
|
||||
VECSubtract(pPoint, &pLine->GetStartP(), &tmp2);
|
||||
f32 retVal = VECDotProduct(&tmp2, &tmp1) / diffLen;
|
||||
VECScale(&tmp1, &tmp3, retVal);
|
||||
VECAdd(&tmp3, &pLine->GetStartP(), pVecOut);
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
@@ -1194,17 +1194,17 @@ f32 cM3d_lineVsPosSuisenCross(const Vec& pLinePointA, const Vec& pLinePointB, co
|
||||
Vec tmp1;
|
||||
Vec tmp2;
|
||||
Vec tmp3;
|
||||
PSVECSubtract(&pLinePointB, &pLinePointA, &tmp1);
|
||||
f32 diffLen = PSVECSquareMag(&tmp1);
|
||||
VECSubtract(&pLinePointB, &pLinePointA, &tmp1);
|
||||
f32 diffLen = VECSquareMag(&tmp1);
|
||||
if (cM3d_IsZero(diffLen)) {
|
||||
*pVecOut = pPoint;
|
||||
return /* 0.0 */ FLOAT_LABEL(lit_2256);
|
||||
} else {
|
||||
PSVECSubtract(&pPoint, &pLinePointA, &tmp2);
|
||||
f32 dotProd = PSVECDotProduct(&tmp2, &tmp1);
|
||||
VECSubtract(&pPoint, &pLinePointA, &tmp2);
|
||||
f32 dotProd = VECDotProduct(&tmp2, &tmp1);
|
||||
f32 retVal = dotProd / diffLen;
|
||||
PSVECScale(&tmp1, &tmp3, retVal);
|
||||
PSVECAdd(&tmp3, &pLinePointA, pVecOut);
|
||||
VECScale(&tmp1, &tmp3, retVal);
|
||||
VECAdd(&tmp3, &pLinePointA, pVecOut);
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
@@ -1225,6 +1225,6 @@ int cM3d_2PlaneLinePosNearPos(const cM3dGPla& pPlaneA, const cM3dGPla& pPlaneB,
|
||||
/* 8026EBBC-8026EC3C 2694FC 0080+00 0/0 1/1 0/0 .text cM3d_CrawVec__FRC3VecRC3VecP3Vec */
|
||||
void cM3d_CrawVec(const Vec& pVecA, const Vec& pVecB, Vec* pVecOut) {
|
||||
Vec tmp;
|
||||
PSVECScale(&pVecA, &tmp, fabsf(pVecB.x * pVecA.x + pVecB.y * pVecA.y + pVecB.z * pVecA.z));
|
||||
PSVECAdd(&tmp, &pVecB, pVecOut);
|
||||
VECScale(&pVecA, &tmp, fabsf(pVecB.x * pVecA.x + pVecB.y * pVecA.y + pVecB.z * pVecA.z));
|
||||
VECAdd(&tmp, &pVecB, pVecOut);
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ void cM3dGAab::SetMax(const cXyz& pMax) {
|
||||
}
|
||||
/* 8026EE24-8026EE68 0044+00 s=0 e=1 z=0 None .text CalcCenter__8cM3dGAabCFP4cXyz */
|
||||
void cM3dGAab::CalcCenter(cXyz* pOut) const {
|
||||
PSVECAdd(&mMin, &mMax, pOut);
|
||||
PSVECScale(pOut, pOut, 0.5f);
|
||||
VECAdd(&mMin, &mMax, pOut);
|
||||
VECScale(pOut, pOut, 0.5f);
|
||||
}
|
||||
|
||||
/* 8026EE68-8026EEB4 004C+00 s=0 e=1 z=0 None .text PlusR__8cM3dGAabFf */
|
||||
|
||||
@@ -28,9 +28,9 @@ void cM3dGLin::SetStartEnd(const Vec& pStart, const Vec& pEnd) {
|
||||
/* 8026F350-8026F3C0 0070+00 s=0 e=3 z=0 None .text CalcPos__8cM3dGLinCFP3Vecf */
|
||||
void cM3dGLin::CalcPos(Vec* pOut, f32 pScale) const {
|
||||
Vec tmp;
|
||||
PSVECSubtract(&mEnd, &mStart, &tmp);
|
||||
PSVECScale(&tmp, &tmp, pScale);
|
||||
PSVECAdd(&tmp, &mStart, pOut);
|
||||
VECSubtract(&mEnd, &mStart, &tmp);
|
||||
VECScale(&tmp, &tmp, pScale);
|
||||
VECAdd(&tmp, &mStart, pOut);
|
||||
}
|
||||
|
||||
/* 8026F3C0-8026F3DC 001C+00 s=0 e=1 z=0 None .text SetEnd__8cM3dGLinFRC4cXyz */
|
||||
|
||||
@@ -17,8 +17,8 @@ cM3dGPla::cM3dGPla(const cXyz* pNormal, f32 pD) : mNormal(*pNormal), mD(pD) {}
|
||||
/* 8026F408-8026F4C4 269D48 00BC+00 0/0 3/3 0/0 .text crossInfLin__8cM3dGPlaCFRC4cXyzRC4cXyzR4cXyz
|
||||
*/
|
||||
bool cM3dGPla::crossInfLin(const cXyz& pStart, const cXyz& pEnd, cXyz& out) const {
|
||||
f32 tmp1 = (mD + PSVECDotProduct(&mNormal, &pStart));
|
||||
f32 tmp2 = tmp1 - (mD + PSVECDotProduct(&mNormal, &pEnd));
|
||||
f32 tmp1 = (mD + VECDotProduct(&mNormal, &pStart));
|
||||
f32 tmp2 = tmp1 - (mD + VECDotProduct(&mNormal, &pEnd));
|
||||
if (fabsf(tmp2) < G_CM3D_F_ABS_MIN) {
|
||||
out = pEnd;
|
||||
return false;
|
||||
@@ -31,14 +31,14 @@ bool cM3dGPla::crossInfLin(const cXyz& pStart, const cXyz& pEnd, cXyz& out) cons
|
||||
/* 8026F4C4-8026F52C 269E04 0068+00 0/0 1/1 0/0 .text SetupNP0__8cM3dGPlaFRC3VecRC3Vec */
|
||||
void cM3dGPla::SetupNP0(const Vec& pNormal, const Vec& pPoint) {
|
||||
mNormal = pNormal;
|
||||
PSVECNormalize(&mNormal, &mNormal);
|
||||
mD = -PSVECDotProduct(&mNormal, &pPoint);
|
||||
VECNormalize(&mNormal, &mNormal);
|
||||
mD = -VECDotProduct(&mNormal, &pPoint);
|
||||
}
|
||||
|
||||
/* 8026F52C-8026F57C 269E6C 0050+00 0/0 2/2 0/0 .text SetupNP__8cM3dGPlaFRC3VecRC3Vec */
|
||||
void cM3dGPla::SetupNP(const Vec& pNormal, const Vec& pPoint) {
|
||||
mNormal = pNormal;
|
||||
mD = -PSVECDotProduct(&mNormal, &pPoint);
|
||||
mD = -VECDotProduct(&mNormal, &pPoint);
|
||||
}
|
||||
|
||||
/* 8026F57C-8026F5D4 269EBC 0058+00 0/0 2/2 0/0 .text getCrossY__8cM3dGPlaCFRC4cXyzPf */
|
||||
|
||||
@@ -14,21 +14,21 @@
|
||||
/* 80266AE4-80266B34 0050+00 s=0 e=103 z=300 None .text __pl__4cXyzCFRC3Vec */
|
||||
cXyz cXyz::operator+(const Vec& vec) const {
|
||||
Vec ret;
|
||||
PSVECAdd(this, &vec, &ret);
|
||||
VECAdd(this, &vec, &ret);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
/* 80266B34-80266B84 0050+00 s=0 e=196 z=1082 None .text __mi__4cXyzCFRC3Vec */
|
||||
cXyz cXyz::operator-(const Vec& vec) const {
|
||||
Vec ret;
|
||||
PSVECSubtract(this, &vec, &ret);
|
||||
VECSubtract(this, &vec, &ret);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
/* 80266B84-80266BD0 004C+00 s=1 e=99 z=158 None .text __ml__4cXyzCFf */
|
||||
cXyz cXyz::operator*(f32 scale) const {
|
||||
Vec ret;
|
||||
PSVECScale(this, &ret, scale);
|
||||
VECScale(this, &ret, scale);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
@@ -48,14 +48,14 @@ cXyz cXyz::operator*(const Vec& vec) const {
|
||||
/* 80266C18-80266C6C 0054+00 s=0 e=3 z=12 None .text __dv__4cXyzCFf */
|
||||
cXyz cXyz::operator/(f32 scale) const {
|
||||
Vec ret;
|
||||
PSVECScale(this, &ret, 1.0f / scale);
|
||||
VECScale(this, &ret, 1.0f / scale);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
/* 80266C6C-80266CBC 0050+00 s=1 e=0 z=0 None .text getCrossProduct__4cXyzCFRC3Vec */
|
||||
cXyz cXyz::getCrossProduct(const Vec& vec) const {
|
||||
Vec ret;
|
||||
PSVECCrossProduct(this, &vec, &ret);
|
||||
VECCrossProduct(this, &vec, &ret);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
@@ -67,7 +67,7 @@ cXyz cXyz::outprod(const Vec& vec) const {
|
||||
/* 80266CE4-80266D30 004C+00 s=0 e=10 z=1 None .text norm__4cXyzCFv */
|
||||
cXyz cXyz::norm(void) const {
|
||||
Vec ret;
|
||||
PSVECNormalize(this, &ret);
|
||||
VECNormalize(this, &ret);
|
||||
return cXyz(ret);
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ cXyz cXyz::norm(void) const {
|
||||
cXyz cXyz::normZP(void) const {
|
||||
Vec vec;
|
||||
if (this->isNearZeroSquare() == false) {
|
||||
PSVECNormalize(this, &vec);
|
||||
VECNormalize(this, &vec);
|
||||
} else {
|
||||
vec = cXyz::Zero;
|
||||
}
|
||||
@@ -96,7 +96,7 @@ inline void normToUpZIfNearZero(Vec& vec) {
|
||||
cXyz cXyz::normZC(void) const {
|
||||
Vec outVec;
|
||||
if (this->isNearZeroSquare() == false) {
|
||||
PSVECNormalize(this, &outVec);
|
||||
VECNormalize(this, &outVec);
|
||||
} else {
|
||||
outVec = (*this * 1.25f * 1000000.0f).normZP();
|
||||
normToUpZIfNearZero(outVec);
|
||||
@@ -106,14 +106,14 @@ cXyz cXyz::normZC(void) const {
|
||||
|
||||
/* 80266EF4-80266F48 0054+00 s=0 e=13 z=17 None .text normalize__4cXyzFv */
|
||||
cXyz cXyz::normalize(void) {
|
||||
PSVECNormalize(this, this);
|
||||
VECNormalize(this, this);
|
||||
return *this;
|
||||
}
|
||||
|
||||
/* 80266F48-80266FDC 0094+00 s=0 e=19 z=59 None .text normalizeZP__4cXyzFv */
|
||||
cXyz cXyz::normalizeZP(void) {
|
||||
if (this->isNearZeroSquare() == false) {
|
||||
PSVECNormalize(this, this);
|
||||
VECNormalize(this, this);
|
||||
} else {
|
||||
*this = cXyz::Zero;
|
||||
}
|
||||
@@ -125,7 +125,7 @@ bool cXyz::normalizeRS(void) {
|
||||
if (this->isNearZeroSquare()) {
|
||||
return false;
|
||||
} else {
|
||||
PSVECNormalize(this, this);
|
||||
VECNormalize(this, this);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ SECTION_SDATA2 static f32 lit_1273 = 0.01745329238474369f;
|
||||
void Z2AudioCamera::setCameraState(f32 (*param_0)[4], Vec& param_1, Vec& param_2, f32 param_3,
|
||||
f32 param_4, bool param_5, bool param_6) {
|
||||
JGeometry::TVec3<f32> aTStack_c0;
|
||||
PSVECSubtract(¶m_2, ¶m_1, aTStack_c0);
|
||||
VECSubtract(¶m_2, ¶m_1, aTStack_c0);
|
||||
mCamDist = aTStack_c0.length();
|
||||
f32 dVar10 = 0.5f * param_3;
|
||||
mFovySin = JMASinDegree(dVar10);
|
||||
@@ -728,9 +728,9 @@ void Z2AudioCamera::setCameraState(f32 (*param_0)[4], Vec& param_1, Vec& param_2
|
||||
aTStack_cc.y = param_0[0][1];
|
||||
aTStack_cc.z = param_0[0][2];
|
||||
Mtx rotMtx;
|
||||
PSMTXRotAxisRad(rotMtx, aTStack_cc, 0.01745329238474369f * (-1.0f * dVar10));
|
||||
MTXRotAxisRad(rotMtx, aTStack_cc, 0.01745329238474369f * (-1.0f * dVar10));
|
||||
JGeometry::TVec3<f32> aTStack_d8;
|
||||
PSMTXMultVec(rotMtx, aTStack_c0, aTStack_d8);
|
||||
MTXMultVec(rotMtx, aTStack_c0, aTStack_d8);
|
||||
aTStack_d8.scale(aTStack_c0.y / aTStack_d8.y);
|
||||
mDolbyCenterZ = fVar8 * aTStack_d8.length();
|
||||
if (mSetMainCamera) {
|
||||
@@ -759,7 +759,7 @@ void Z2AudioCamera::convertAbsToRel(Z2Audible* param_0, int param_1) {
|
||||
return;
|
||||
}
|
||||
Z2AudibleRelPos* relPos = &iVar2->field_0x14;
|
||||
PSMTXMultVec(field_0x0, param_0->mPos, relPos->field_0x00);
|
||||
MTXMultVec(field_0x0, param_0->mPos, relPos->field_0x00);
|
||||
relPos->field_0xC = relPos->field_0x00.length();
|
||||
JGeometry::TVec3<f32> aTStack_38;
|
||||
JGeometry::setTVec3f(*(Vec*)&relPos->field_0x00, *(Vec*)&aTStack_38);
|
||||
@@ -770,7 +770,7 @@ void Z2AudioCamera::convertAbsToRel(Z2Audible* param_0, int param_1) {
|
||||
/* 802BCC7C-802BCCC0 2B75BC 0044+00 2/2 0/0 0/0 .text convertAbsToRel__13Z2AudioCameraCFR3VecP3Vec
|
||||
*/
|
||||
bool Z2AudioCamera::convertAbsToRel(Vec& param_0, Vec* param_1) const {
|
||||
PSMTXMultVec(field_0x0, ¶m_0, param_1);
|
||||
MTXMultVec(field_0x0, ¶m_0, param_1);
|
||||
return isInSight(*param_1);
|
||||
}
|
||||
|
||||
@@ -1308,7 +1308,7 @@ asm f32 Z2Audience::calcRelPosVolume(Vec const& param_0, f32 param_1, int param_
|
||||
f32 Z2Audience::calcRelPosPan(Vec const& param_0, int param_1) {
|
||||
Vec local_54 = param_0;
|
||||
local_54.y = 0.0f;
|
||||
f32 dVar6 = PSVECMag(&local_54);
|
||||
f32 dVar6 = VECMag(&local_54);
|
||||
if (dVar6 < 0.1f) {
|
||||
return 0.5f;
|
||||
}
|
||||
|
||||
@@ -486,7 +486,7 @@ void Z2WolfHowlMgr::startWindStoneSound(s8 param_0, Vec* param_1) {
|
||||
return;
|
||||
}
|
||||
JGeometry::TVec3<f32> local_60 = Z2GetAudience()->getAudioCamPos();
|
||||
f32 dVar13 = sqrtf(PSVECSquareDistance(param_1, local_60));
|
||||
f32 dVar13 = sqrtf(VECSquareDistance(param_1, local_60));
|
||||
if (dVar13 > 2100.0f && field_0x04) {
|
||||
field_0x04->stop();
|
||||
} else if (dVar13 < 2100.0f && !field_0x04) {
|
||||
@@ -496,7 +496,7 @@ void Z2WolfHowlMgr::startWindStoneSound(s8 param_0, Vec* param_1) {
|
||||
field_0x04->fadeIn(0);
|
||||
field_0x04->stop(0x1e);
|
||||
if (Z2GetLink()->getLinkState() == 1) {
|
||||
f32 fVar14 = sqrtf(PSVECSquareDistance(param_1, Z2GetLink()->getCurrentPos()));
|
||||
f32 fVar14 = sqrtf(VECSquareDistance(param_1, Z2GetLink()->getCurrentPos()));
|
||||
f32 dVar13 = 1.0f;
|
||||
if (fVar14 < 150.0f) {
|
||||
dVar13 = 0.0f;
|
||||
|
||||
Reference in New Issue
Block a user