tag_allmato almost, swhit0 treesh swball done, misc cleanup (#2312)

* d_a_tag_allmato almost done

* d_a_swhit0 done

* some SSystem cleanup

* treesh done

* swball done, some other rel cleanup
This commit is contained in:
TakaRikka
2025-03-01 04:48:49 -08:00
committed by GitHub
parent 80edf3c8a8
commit f06311cd09
54 changed files with 2162 additions and 1767 deletions
+3 -1
View File
@@ -28,7 +28,9 @@ void cBgS_Chk::SetExtChk(cBgS_Chk& other) {
bool cBgS_Chk::ChkSameActorPid(fpc_ProcID pid) const {
if (mActorPid == fpcM_ERROR_PROCESS_ID_e || pid == fpcM_ERROR_PROCESS_ID_e || !mSameActorChk) {
return FALSE;
} else if (mActorPid == pid) {
return TRUE;
} else {
return (mActorPid == pid) ? TRUE : FALSE;
return FALSE;
}
}
+12 -8
View File
@@ -4,6 +4,7 @@
*/
#include "SSystem/SComponent/c_bg_s_poly_info.h"
#include "JSystem/JUtility/JUTAssert.h"
/* 80268074-802680B0 2629B4 003C+00 0/0 7/7 9/9 .text __ct__13cBgS_PolyInfoFv */
cBgS_PolyInfo::cBgS_PolyInfo() {
@@ -33,22 +34,20 @@ void cBgS_PolyInfo::ClearPi() {
/* 80268148-8026816C 262A88 0024+00 0/0 11/11 1/1 .text
* SetPolyInfo__13cBgS_PolyInfoFRC13cBgS_PolyInfo */
void cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo& poly) {
mPolyIndex = poly.mPolyIndex;
mBgIndex = poly.mBgIndex;
unk_0x04 = poly.unk_0x04;
mActorId = poly.mActorId;
*this = poly;
}
/* 8026816C-8026817C 262AAC 0010+00 0/0 6/6 0/0 .text SetActorInfo__13cBgS_PolyInfoFiPvUi
*/
void cBgS_PolyInfo::SetActorInfo(int bg_index, void* p_data, unsigned int actor_id) {
void cBgS_PolyInfo::SetActorInfo(int bg_index, void* p_data, fpc_ProcID actor_id) {
JUT_ASSERT(74, 0 <= bg_index);
mBgIndex = bg_index;
unk_0x04 = p_data;
mActorId = actor_id;
}
/* 8026817C-802681A4 262ABC 0028+00 0/0 1/1 0/0 .text ChkSafe__13cBgS_PolyInfoCFPCvUi */
bool cBgS_PolyInfo::ChkSafe(const void* param_1, unsigned int actor_id) const {
bool cBgS_PolyInfo::ChkSafe(const void* param_1, fpc_ProcID actor_id) const {
if (unk_0x04 == param_1 && mActorId == actor_id) {
return true;
} else {
@@ -59,10 +58,15 @@ bool cBgS_PolyInfo::ChkSafe(const void* param_1, unsigned int actor_id) const {
/* 802681A4-802681AC 262AE4 0008+00 0/0 11/11 0/0 .text SetPolyIndex__13cBgS_PolyInfoFi
*/
void cBgS_PolyInfo::SetPolyIndex(int poly_index) {
JUT_ASSERT(103, 0 <= poly_index);
mPolyIndex = poly_index;
}
/* 802681AC-802681C0 262AEC 0014+00 0/0 3/3 0/0 .text ChkBgIndex__13cBgS_PolyInfoCFv */
bool cBgS_PolyInfo::ChkBgIndex() const {
return mBgIndex != 0x100;
}
if (mBgIndex == 0x100) {
return false;
}
return true;
}
+16 -4
View File
@@ -17,17 +17,29 @@ void cBgW_BgId::Release() {
/* 802681D4-802681E4 262B14 0010+00 0/0 7/7 121/121 .text ChkUsed__9cBgW_BgIdCFv */
bool cBgW_BgId::ChkUsed() const {
return m_id < 0x100;
if (m_id < 0x100) {
return true;
}
return false;
}
/* 802681E4-802681FC 262B24 0018+00 1/1 22/22 8/8 .text cBgW_CheckBGround__Ff */
bool cBgW_CheckBGround(float y) {
return y >= 0.5f;
if (y >= 0.5f) {
return true;
} else {
return false;
}
}
/* 802681FC-80268210 262B3C 0014+00 1/1 6/6 0/0 .text cBgW_CheckBRoof__Ff */
bool cBgW_CheckBRoof(float y) {
return y < (-4.0f / 5.0f);
if (y < (-4.0f / 5.0f)) {
return true;
} else {
return false;
}
}
/* 80268210-80268260 262B50 0050+00 0/0 16/16 4/4 .text cBgW_CheckBWall__Ff */
@@ -36,4 +48,4 @@ bool cBgW_CheckBWall(float y) {
return true;
return false;
}
}
+7 -7
View File
@@ -165,7 +165,7 @@ void cCcS::ChkAtTg() {
continue;
cCcD_ShapeAttr* pat_sa = (*pat_obj)->GetShapeAttr();
JUT_ASSERT(pat_sa != 0);
JUT_ASSERT(0, pat_sa != 0);
for (cCcD_Obj** ptg_obj = mpObjTg; ptg_obj < objTgEnd; ++ptg_obj) {
if (*ptg_obj == NULL || !(*ptg_obj)->ChkTgSet())
@@ -176,7 +176,7 @@ void cCcS::ChkAtTg() {
continue;
cCcD_ShapeAttr* ptg_sa = (*ptg_obj)->GetShapeAttr();
JUT_ASSERT(ptg_sa != 0);
JUT_ASSERT(0, ptg_sa != 0);
static cXyz cross;
bool didCross = pat_sa->CrossAtTg(*ptg_sa, &cross);
@@ -225,7 +225,7 @@ void cCcS::ChkCo() {
continue;
cCcD_ShapeAttr* pco1_sa = (*pco1_obj)->GetShapeAttr();
JUT_ASSERT(pco1_sa != 0);
JUT_ASSERT(0, pco1_sa != 0);
for (cCcD_Obj** pco2_obj = pco1_obj + 1; pco2_obj < objCoEnd; ++pco2_obj) {
if (*pco2_obj == NULL || !(*pco2_obj)->ChkCoSet())
@@ -236,7 +236,7 @@ void cCcS::ChkCo() {
continue;
cCcD_ShapeAttr* pco2_sa = (*pco2_obj)->GetShapeAttr();
JUT_ASSERT(pco2_sa != 0);
JUT_ASSERT(0, pco2_sa != 0);
f32 cross_len;
if (pco1_sa->CrossCo(*pco2_sa, &cross_len)) {
@@ -456,7 +456,7 @@ void cCcS::CalcArea() {
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
if (*pset_obj != NULL) {
cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
JUT_ASSERT(pset_sa != 0);
JUT_ASSERT(0, pset_sa != 0);
pset_sa->CalcAabBox();
aab.SetMinMax(pset_sa->GetWorkAab());
@@ -467,7 +467,7 @@ void cCcS::CalcArea() {
for (cCcD_Obj** pset_obj = mpObj; pset_obj < mpObj + mObjCount; ++pset_obj) {
if (*pset_obj != NULL) {
const cCcD_ShapeAttr* pset_sa = (*pset_obj)->GetShapeAttr();
JUT_ASSERT(pset_sa != 0);
JUT_ASSERT(0, pset_sa != 0);
cCcD_DivideInfo* divideInfo = &(*pset_obj)->GetDivideInfo();
mDivideArea.CalcDivideInfo(divideInfo, pset_sa->GetWorkAab(),
@@ -553,4 +553,4 @@ bool cCcS::ChkNoHitGCo(cCcD_Obj* pco1_obj, cCcD_Obj* pco2_obj) {
}
/* 80265E18-80265E1C 260758 0004+00 1/0 0/0 0/0 .text MoveAfterCheck__4cCcSFv */
void cCcS::MoveAfterCheck() {}
void cCcS::MoveAfterCheck() {}
+7 -5
View File
@@ -41,8 +41,9 @@ void cLib_memSet(void* ptr, int value, unsigned long num) {
* @return The absolute value of remaining distance to target
*/
f32 cLib_addCalc(f32* pvalue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
f32 step = 0.0f;
if (*pvalue != target) {
f32 step = scale * (target - *pvalue);
step = scale * (target - *pvalue);
if (step >= minStep || step <= -minStep) {
if (step > maxStep) {
step = maxStep;
@@ -54,15 +55,16 @@ f32 cLib_addCalc(f32* pvalue, f32 target, f32 scale, f32 maxStep, f32 minStep) {
} else {
if (step > 0) {
if (step < minStep) {
*pvalue += minStep;
step = minStep;
*pvalue += step;
if (*pvalue > target) {
*pvalue = target;
}
}
} else {
minStep = -minStep;
if (step > minStep) {
*pvalue += minStep;
if (step > -minStep) {
step = -minStep;
*pvalue += step;
if (*pvalue < target) {
*pvalue = target;
}
+21 -13
View File
@@ -5,7 +5,7 @@
#include "SSystem/SComponent/c_list.h"
#include "SSystem/SComponent/c_node.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
/* 80265E64-80265E78 0014+00 s=1 e=0 z=0 None .text cLs_Init__FP15node_list_class */
void cLs_Init(node_list_class* list) {
@@ -17,15 +17,23 @@ void cLs_Init(node_list_class* list) {
/* 80265E78-80265EFC 0084+00 s=1 e=4 z=0 None .text cLs_SingleCut__FP10node_class */
int cLs_SingleCut(node_class* node) {
node_list_class* list = (node_list_class*)node->mpData;
if (node == list->mpHead)
list->mpHead = node->mpNextNode;
if (node == list->mpTail)
list->mpTail = node->mpPrevNode;
cNd_SingleCut(node);
cNd_ClearObject(node);
int newSize = list->mSize - 1;
list->mSize = newSize;
return newSize > 0;
int ret;
if (--list->mSize > 0) {
ret = 1;
} else {
ret = 0;
}
return ret;
}
/* 80265EFC-80265F70 0074+00 s=1 e=4 z=0 None .text
@@ -49,13 +57,13 @@ int cLs_Insert(node_list_class* list, int idx, node_class* node) {
node_class* pExisting = cNd_Order(list->mpHead, idx);
if (pExisting == NULL) {
return cLs_Addition(list, node);
} else {
cNd_SetObject(node, list);
cNd_Insert(pExisting, node);
list->mpHead = cNd_First(node);
list->mSize = cNd_LengthOf(list->mpHead);
return list->mSize;
}
cNd_SetObject(node, list);
cNd_Insert(pExisting, node);
list->mpHead = cNd_First(node);
list->mSize = cNd_LengthOf(list->mpHead);
return list->mSize;
}
/* 80265FF8-80266040 0048+00 s=0 e=1 z=0 None .text cLs_GetFirst__FP15node_list_class */
@@ -64,12 +72,12 @@ node_class* cLs_GetFirst(node_list_class* list) {
node_class* pHead = list->mpHead;
cLs_SingleCut(pHead);
return pHead;
} else {
return NULL;
}
return NULL;
}
/* 80266040-80266060 0020+00 s=0 e=4 z=0 None .text cLs_Create__FP15node_list_class */
void cLs_Create(node_list_class* list) {
cLs_Init(list);
}
}
+47 -16
View File
@@ -6,47 +6,78 @@
#include "SSystem/SComponent/c_m2d.h"
#include "SSystem/SComponent/c_m3d.h"
#include "SSystem/SComponent/c_m3d_g_cir.h"
#include "JSystem/JUtility/JUTAssert.h"
/* 80268260-80268560 262BA0 0300+00 0/0 4/4 0/0 .text cM2d_CrossCirLin__FR8cM2dGCirffffPfPf */
void cM2d_CrossCirLin(cM2dGCir& param_0, f32 param_1, f32 param_2, f32 param_3, f32 param_4,
f32* param_5, f32* param_6) {
int ans = 0;
f32 fVar1 = param_1 - param_0.GetCx();
f32 fVar15 = param_2 - param_0.GetCy();
f32 dVar13 = param_3 * param_3 + param_4 * param_4;
f32 dVar14 = 2.0f * ((param_3 * fVar1) + (param_4 * fVar15));
f32 fVar3 = (fVar1 * fVar1 + fVar15 * fVar15) - (param_0.GetR() * param_0.GetR());
f32 in_f31;
f32 c = (fVar1 * fVar1 + fVar15 * fVar15) - (param_0.GetR() * param_0.GetR());
JUT_ASSERT(71, c < 0.0f);
f32 t;
if (cM3d_IsZero(dVar13)) {
if (!cM3d_IsZero(dVar14)) {
in_f31 = -fVar3 / dVar14;
if (cM3d_IsZero(dVar14)) {
ans = 0;
} else {
ans = 1;
t = -c / dVar14;
}
} else {
f32 dVar10 = ((dVar14 * dVar14) - (4.0f * dVar13) * fVar3);
f32 dVar10 = ((dVar14 * dVar14) - (4.0f * dVar13) * c);
if (cM3d_IsZero(dVar10)) {
in_f31 = (-dVar14 / (2.0f * dVar13));
ans = 1;
t = (-dVar14 / (2.0f * dVar13));
} else {
if (dVar10 < 0.0f) {
ans = 0;
} else {
ans = 2;
f32 fVar2 = 1.0f / (2.0f * dVar13);
f32 fVar15 = sqrtf(dVar10);
fVar15 = fVar2 * (-dVar14 + fVar15);
f32 fVar16 = sqrtf(dVar10);
f32 fVar4 = fVar2 * (-dVar14 - fVar16);
f32 fVar15 = fVar2 * (-dVar14 + sqrtf(dVar10));
f32 fVar4 = fVar2 * (-dVar14 - sqrtf(dVar10));
if (fVar15 > fVar4) {
in_f31 = fVar15;
t = fVar15;
} else {
in_f31 = fVar4;
t = fVar4;
}
}
}
}
if (cM3d_IsZero(in_f31)) {
if (cM3d_IsZero(t)) {
*param_5 = param_1;
*param_6 = param_2;
} else {
*param_5 = param_1 + (in_f31 * param_3);
*param_6 = param_2 + (in_f31 * param_4);
if (ans == 0 || t < 0.0f) {
OS_REPORT("\x1b[41;37m");
if (ans == 0) {
OS_REPORT("ans == 0\n");
}
if (t < 0.0f) {
OS_REPORT("t %f < 0.0f\n", t);
}
OS_REPORT("c.x %f c.y %f\n", param_0.GetCx(), param_0.GetCy());
OS_REPORT("r %f\n", param_0.GetR());
OS_REPORT("px %f py %f\n", param_1, param_2);
OS_REPORT("vx %f vy %f\n", param_3, param_4);
OS_REPORT("\x1b[m");
}
JUT_ASSERT(135, ans != 0);
JUT_ASSERT(137, t >= 0.0f);
*param_5 = param_1 + (t * param_3);
*param_6 = param_2 + (t * param_4);
}
}
}
-5
View File
@@ -1347,11 +1347,6 @@ void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph* pSphere, const cM3dGTri* pTrian
}
}
inline bool cM3d_Cross_LinSph(cM3dGLin const* line, cM3dGSph const* sph) {
Vec vec;
return cM3d_Cross_LinSph(line, sph, &vec);
}
/* 8026BF04-8026C22C 266844 0328+00 1/1 4/4 0/0 .text
* cM3d_Cross_SphTri__FPC8cM3dGSphPC8cM3dGTriP3Vec */
bool cM3d_Cross_SphTri(cM3dGSph const* sph, cM3dGTri const* tri, Vec* param_2) {
+41 -15
View File
@@ -22,22 +22,26 @@ bool cM3dGAab::CrossY(const cXyz* other) const {
/* 8026ECD0-8026ECE4 0014+00 s=0 e=6 z=0 None .text UnderPlaneYUnder__8cM3dGAabCFf */
bool cM3dGAab::UnderPlaneYUnder(f32 y) const {
return mMin.y < y;
if (mMin.y < y) {
return true;
}
return false;
}
/* 8026ECE4-8026ECF8 0014+00 s=0 e=6 z=0 None .text TopPlaneYUnder__8cM3dGAabCFf */
bool cM3dGAab::TopPlaneYUnder(f32 y) const {
return mMax.y < y;
if (mMax.y < y) {
return true;
}
return false;
}
/* 8026ECF8-8026ED1C 0024+00 s=0 e=6 z=0 None .text ClearForMinMax__8cM3dGAabFv */
void cM3dGAab::ClearForMinMax() {
mMin.z = 1000000000.0f;
mMin.y = 1000000000.0f;
mMin.x = 1000000000.0f;
mMax.z = -1000000000.0f;
mMax.y = -1000000000.0f;
mMax.x = -1000000000.0f;
mMin.x = mMin.y = mMin.z = 1000000000.0f;
mMax.x = mMax.y = mMax.z = -1000000000.0f;
}
/* 8026ED1C-8026ED60 0044+00 s=1 e=3 z=0 None .text SetMinMax__8cM3dGAabFRC4cXyz */
@@ -54,21 +58,43 @@ void cM3dGAab::SetMinMax(const cM3dGAab& other) {
/* 8026EDA4-8026EDE4 0040+00 s=1 e=1 z=0 None .text SetMin__8cM3dGAabFRC4cXyz */
void cM3dGAab::SetMin(const cXyz& min) {
mMin.setMin(min);
if (mMin.x > min.x) {
mMin.x = min.x;
}
if (mMin.y > min.y) {
mMin.y = min.y;
}
if (mMin.z > min.z) {
mMin.z = min.z;
}
}
/* 8026EDE4-8026EE24 0040+00 s=1 e=1 z=0 None .text SetMax__8cM3dGAabFRC4cXyz */
void cM3dGAab::SetMax(const cXyz& max) {
mMax.setMax(max);
if (mMax.x < max.x) {
mMax.x = max.x;
}
if (mMax.y < max.y) {
mMax.y = max.y;
}
if (mMax.z < max.z) {
mMax.z = max.z;
}
}
/* 8026EE24-8026EE68 0044+00 s=0 e=1 z=0 None .text CalcCenter__8cM3dGAabCFP4cXyz */
void cM3dGAab::CalcCenter(cXyz* out) const {
VECAdd(&mMin, &mMax, out);
VECScale(out, out, 0.5f);
PSVECAdd(&mMin, &mMax, out);
PSVECScale(out, out, 0.5f);
}
/* 8026EE68-8026EEB4 004C+00 s=0 e=1 z=0 None .text PlusR__8cM3dGAabFf */
void cM3dGAab::PlusR(f32 r) {
mMin -= r;
mMax += r;
}
mMin.x -= r;
mMin.y -= r;
mMin.z -= r;
mMax.x += r;
mMax.y += r;
mMax.z += r;
}
+4 -6
View File
@@ -12,9 +12,7 @@ cM3dGCir::cM3dGCir() {}
cM3dGCir::~cM3dGCir() {}
/* 8026EF74-8026EF88 0014+00 s=0 e=1 z=0 None .text Set__8cM3dGCirFffff */
void cM3dGCir::Set(f32 pos_x, f32 pos_y, f32 posz, f32 radius) {
mPosX = pos_x;
mPosY = pos_y;
mRadius = radius;
mPosZ = posz;
}
void cM3dGCir::Set(f32 pos_x, f32 pos_y, f32 pos_z, f32 radius) {
cM2dGCir::Set(pos_x, pos_y, radius);
mPosZ = pos_z;
}
+4 -4
View File
@@ -14,16 +14,16 @@ cM3dGCps::~cM3dGCps() {}
/* 8026F000-8026F03C 269940 003C+00 1/1 2/2 10/10 .text Set__8cM3dGCpsFRC4cXyzRC4cXyzf */
void cM3dGCps::Set(const cXyz& start, const cXyz& end, f32 radius) {
SetStartEnd(start, end);
mRadius = radius;
SetR(radius);
}
/* 8026F03C-8026F080 26997C 0044+00 0/0 1/1 10/10 .text Set__8cM3dGCpsFRC9cM3dGCpsS */
void cM3dGCps::Set(const cM3dGCpsS& other) {
SetStartEnd(other.mStart, other.mEnd);
mRadius = other.mRadius;
SetR(other.mRadius);
}
/* 8026F080-8026F0A8 2699C0 0028+00 0/0 1/1 0/0 .text SetCps__8cM3dGCpsFRC8cM3dGCps */
void cM3dGCps::SetCps(const cM3dGCps& other) {
Set(other.GetStartP(), other.GetEndP(), other.mRadius);
}
Set(other.GetStart(), other.GetEnd(), other.GetR());
}
+11 -8
View File
@@ -6,7 +6,10 @@
#include "SSystem/SComponent/c_m3d_g_lin.h"
/* 8026F2A8-8026F2E8 0040+00 s=0 e=8 z=1 None .text __ct__8cM3dGLinFRC4cXyzRC4cXyz */
cM3dGLin::cM3dGLin(const cXyz& start, const cXyz& end) : mStart(start), mEnd(end) {}
cM3dGLin::cM3dGLin(const cXyz& start, const cXyz& end) {
mStart = start;
mEnd = end;
}
/* 8026F2E8-8026F31C 0034+00 s=0 e=8 z=10 None .text SetStartEnd__8cM3dGLinFRC4cXyzRC4cXyz */
void cM3dGLin::SetStartEnd(const cXyz& start, const cXyz& end) {
@@ -16,19 +19,19 @@ void cM3dGLin::SetStartEnd(const cXyz& start, const cXyz& end) {
/* 8026F31C-8026F350 0034+00 s=0 e=7 z=4 None .text SetStartEnd__8cM3dGLinFRC3VecRC3Vec */
void cM3dGLin::SetStartEnd(const Vec& start, const Vec& end) {
mStart = start;
mEnd = end;
mStart.set(start);
mEnd.set(end);
}
/* 8026F350-8026F3C0 0070+00 s=0 e=3 z=0 None .text CalcPos__8cM3dGLinCFP3Vecf */
void cM3dGLin::CalcPos(Vec* out, f32 scale) const {
Vec tmp;
VECSubtract(&mEnd, &mStart, &tmp);
VECScale(&tmp, &tmp, scale);
VECAdd(&tmp, &mStart, out);
cXyz tmp;
PSVECSubtract(&mEnd, &mStart, &tmp);
PSVECScale(&tmp, &tmp, scale);
PSVECAdd(&tmp, &mStart, out);
}
/* 8026F3C0-8026F3DC 001C+00 s=0 e=1 z=0 None .text SetEnd__8cM3dGLinFRC4cXyz */
void cM3dGLin::SetEnd(const cXyz& end) {
mEnd = end;
}
}
+19 -14
View File
@@ -7,38 +7,42 @@
#include "SSystem/SComponent/c_m3d.h"
/* 8026F3DC-8026F408 269D1C 002C+00 0/0 3/3 0/0 .text __ct__8cM3dGPlaFPC4cXyzf */
cM3dGPla::cM3dGPla(const cXyz* normal, f32 d) : mNormal(*normal), mD(d) {}
cM3dGPla::cM3dGPla(const cXyz* normal, f32 d) {
mNormal = *normal;
mD = d;
}
/* 8026F408-8026F4C4 269D48 00BC+00 0/0 3/3 0/0 .text crossInfLin__8cM3dGPlaCFRC4cXyzRC4cXyzR4cXyz
*/
bool cM3dGPla::crossInfLin(const cXyz& start, const cXyz& end, cXyz& out) const {
f32 tmp1 = (mD + VECDotProduct(&mNormal, &start));
f32 tmp2 = tmp1 - (mD + VECDotProduct(&mNormal, &end));
if (fabsf(tmp2) < G_CM3D_F_ABS_MIN) {
f32 tmp1 = getPlaneFunc(&start);
f32 tmp2 = getPlaneFunc(&end);
if (cM3d_IsZero(tmp1 - tmp2)) {
out = end;
return false;
} else {
cM3d_InDivPos2(&start, &end, (tmp1 / tmp2), &out);
return true;
}
f32 var_f29 = tmp1 / (tmp1 - tmp2);
cM3d_InDivPos2(&start, &end, var_f29, &out);
return true;
}
/* 8026F4C4-8026F52C 269E04 0068+00 0/0 1/1 0/0 .text SetupNP0__8cM3dGPlaFRC3VecRC3Vec */
void cM3dGPla::SetupNP0(const Vec& normal, const Vec& point) {
mNormal = normal;
VECNormalize(&mNormal, &mNormal);
mD = -VECDotProduct(&mNormal, &point);
PSVECNormalize(&mNormal, &mNormal);
mD = -PSVECDotProduct(&mNormal, &point);
}
/* 8026F52C-8026F57C 269E6C 0050+00 0/0 2/2 0/0 .text SetupNP__8cM3dGPlaFRC3VecRC3Vec */
void cM3dGPla::SetupNP(const Vec& normal, const Vec& point) {
mNormal = normal;
mD = -VECDotProduct(&mNormal, &point);
mD = -PSVECDotProduct(&mNormal, &point);
}
/* 8026F57C-8026F5D4 269EBC 0058+00 0/0 2/2 0/0 .text getCrossY__8cM3dGPlaCFRC4cXyzPf */
bool cM3dGPla::getCrossY(const cXyz& point, f32* out) const {
if (fabsf(mNormal.y) < G_CM3D_F_ABS_MIN) {
if (cM3d_IsZero(mNormal.y)) {
return false;
} else {
*out = (-mNormal.x * point.x - mNormal.z * point.z - mD) / mNormal.y;
@@ -49,7 +53,7 @@ bool cM3dGPla::getCrossY(const cXyz& point, f32* out) const {
/* 8026F5D4-8026F624 269F14 0050+00 0/0 1/1 0/0 .text getCrossYLessD__8cM3dGPlaCFRC3VecPf
*/
bool cM3dGPla::getCrossYLessD(const Vec& point, f32* out) const {
if (fabsf(mNormal.y) < G_CM3D_F_ABS_MIN) {
if (cM3d_IsZero(mNormal.y)) {
return false;
} else {
*out = (-mNormal.x * point.x - mNormal.z * point.z) / mNormal.y;
@@ -59,5 +63,6 @@ bool cM3dGPla::getCrossYLessD(const Vec& point, f32* out) const {
/* 8026F624-8026F648 269F64 0024+00 0/0 1/1 0/0 .text Set__8cM3dGPlaFPC8cM3dGPla */
void cM3dGPla::Set(const cM3dGPla* other) {
*this = *other;
}
mNormal = *other->GetNP();
mD = other->GetD();
}
+2 -3
View File
@@ -37,8 +37,7 @@ bool cM3dGSph::cross(const cM3dGSph* other, cXyz* out) const {
/* 8026F73C-8026F76C 26A07C 0030+00 0/0 1/1 0/0 .text cross__8cM3dGSphCFPC8cM3dGCylP4cXyz
*/
bool cM3dGSph::cross(const cM3dGCyl* cyl, cXyz* out) const {
f32 f;
return cM3d_Cross_CylSph(cyl, this, out, &f);
return cM3d_Cross_CylSph(cyl, this, out);
}
/* 8026F76C-8026F7B0 26A0AC 0044+00 0/0 1/1 0/0 .text GetMinMaxCube__8cM3dGSphCFR4cXyzR4cXyz */
@@ -49,4 +48,4 @@ void cM3dGSph::GetMinMaxCube(cXyz& min, cXyz& max) const {
max.x = mCenter.x + mRadius;
max.y = mCenter.y + mRadius;
max.z = mCenter.z + mRadius;
}
}
+29 -8
View File
@@ -5,6 +5,7 @@
#include "SSystem/SComponent/c_m3d_g_tri.h"
#include "SSystem/SComponent/c_m3d.h"
#include "JSystem/JUtility/JUTAssert.h"
/* 8026F7B0-8026F7DC 26A0F0 002C+00 0/0 1/1 0/0 .text cross__8cM3dGTriCFPC8cM3dGCylP3Vec
*/
@@ -17,22 +18,42 @@ void cM3dGTri::setPos(const Vec* vtx_a, const Vec* vtx_b, const Vec* vtx_c) {
mA = *vtx_a;
mB = *vtx_b;
mC = *vtx_c;
cM3d_CalcPla(&mA, &mB, &mC, &mNormal, &mD);
setUp();
JUT_ASSERT(99, !cM3d_IsZero(GetNP()->x) || !cM3d_IsZero(GetNP()->y) || !cM3d_IsZero(GetNP()->z));
}
/* 8026F85C-8026F8C8 26A19C 006C+00 0/0 2/2 0/0 .text
* setBg__8cM3dGTriFPC3VecPC3VecPC3VecPC8cM3dGPla */
void cM3dGTri::setBg(const Vec* vtx_a, const Vec* vtx_b, const Vec* vtx_c, const cM3dGPla* plane) {
mA = *vtx_a;
mB = *vtx_b;
mC = *vtx_c;
mA.x = vtx_a->x;
mA.y = vtx_a->y;
mA.z = vtx_a->z;
mB.x = vtx_b->x;
mB.y = vtx_b->y;
mB.z = vtx_b->z;
mC.x = vtx_c->x;
mC.y = vtx_c->y;
mC.z = vtx_c->z;
Set(plane);
}
/* 8026F8C8-8026F93C 26A208 0074+00 0/0 1/1 0/0 .text set__8cM3dGTriFPC3VecPC3VecPC3VecPC3Vec */
void cM3dGTri::set(const Vec* vtx_a, const Vec* vtx_b, const Vec* vtx_c, const Vec* normal) {
mA = *vtx_a;
mB = *vtx_b;
mC = *vtx_c;
mA.x = vtx_a->x;
mA.y = vtx_a->y;
mA.z = vtx_a->z;
mB.x = vtx_b->x;
mB.y = vtx_b->y;
mB.z = vtx_b->z;
mC.x = vtx_c->x;
mC.y = vtx_c->y;
mC.z = vtx_c->z;
SetupNP(*normal, *vtx_a);
}
}
+8
View File
@@ -0,0 +1,8 @@
/**
* c_m3d_g_vtx.cpp
*
*/
#include "SSystem/SComponent/c_m3d_g_vtx.h"
cM3dGVtx::~cM3dGVtx() {}
+7 -5
View File
@@ -6,7 +6,6 @@
#include "SSystem/SComponent/c_malloc.h"
#include "JSystem/JKernel/JKRHeap.h"
/* ############################################################################################## */
/* 80451150-80451158 0004+04 s=3 e=0 z=0 None .sbss Heap__3cMl */
JKRHeap* cMl::Heap;
@@ -16,12 +15,15 @@ void cMl::init(JKRHeap* heap) {
}
/* 80263228-80263260 0038+00 s=0 e=8 z=0 None .text memalignB__3cMlFiUl */
void* cMl::memalignB(int alignment, unsigned long size) {
void* cMl::memalignB(int alignment, u32 size) {
void* ret;
if (size == 0) {
return NULL;
ret = NULL;
} else {
return Heap->alloc(size, alignment);
ret = Heap->alloc(size, alignment);
}
return ret;
}
/* 80263260-8026328C 002C+00 s=0 e=4 z=0 None .text free__3cMlFPv */
@@ -29,4 +31,4 @@ void cMl::free(void* ptr) {
if (ptr != NULL) {
Heap->free(ptr);
}
}
}
+27 -23
View File
@@ -5,12 +5,11 @@
#include "SSystem/SComponent/c_math.h"
#include "SSystem/SComponent/c_m3d.h"
#include <cmath.h>
/* 802675E4-80267640 261F24 005C+00 0/0 23/23 11/11 .text cM_rad2s__Ff */
s16 cM_rad2s(float rad) {
f32 rad_mod = fmod(rad, 2 * M_PI);
s32 s = (rad_mod * (0x8000 / M_PI));
s16 cM_rad2s(f32 rad) {
s32 s = (std::fmod(rad, 2 * M_PI) * (0x8000 / M_PI));
if (s < -0x8000) {
s += 0x10000;
} else if (s > 0x7FFF) {
@@ -19,7 +18,6 @@ s16 cM_rad2s(float rad) {
return s;
}
/* ############################################################################################## */
/* 803C3778-803C3F80 020898 0802+06 1/1 0/0 0/0 .data atntable */
static u16 atntable[1025] = {
0x0000, 0x000A, 0x0014, 0x001F, 0x0029, 0x0033, 0x003D, 0x0047, 0x0051, 0x005C, 0x0066, 0x0070,
@@ -111,20 +109,21 @@ static u16 atntable[1025] = {
};
/* 80267640-80267674 261F80 0034+00 1/1 0/0 0/0 .text U_GetAtanTable__Fff */
u16 U_GetAtanTable(float f0, float f1) {
return atntable[(int)(f0 / f1 * 0x400)];
u16 U_GetAtanTable(f32 f0, f32 f1) {
int idx = f0 / f1 * 0x400;
return atntable[idx];
}
/* 80267674-80267814 261FB4 01A0+00 1/1 82/82 822/822 .text cM_atan2s__Fff */
s16 cM_atan2s(float y, float x) {
s16 cM_atan2s(f32 y, f32 x) {
u32 ret;
if (fabsf(y) < G_CM3D_F_ABS_MIN) {
if (cM3d_IsZero(y)) {
if (x >= 0.0f) {
ret = 0;
} else {
ret = 0x8000;
}
} else if (fabsf(x) < G_CM3D_F_ABS_MIN) {
} else if (cM3d_IsZero(x)) {
if (y >= 0.0f) {
ret = 0x4000;
} else {
@@ -145,7 +144,7 @@ s16 cM_atan2s(float y, float x) {
}
}
} else if (x < 0.0f) {
if (x <= y) {
if (-x >= -y) {
ret = U_GetAtanTable(-y, -x) + 0x8000;
} else {
ret = 0xC000 - U_GetAtanTable(-x, -y);
@@ -161,11 +160,12 @@ s16 cM_atan2s(float y, float x) {
}
/* 80267814-8026785C 262154 0048+00 0/0 4/4 5/5 .text cM_atan2f__Fff */
float cM_atan2f(float y, float x) {
return ((2 * M_PI) / 0x10000) * cM_atan2s(y, x);
f32 cM_atan2f(f32 y, f32 x) {
f32 atanS = cM_atan2s(y, x);
f32 ret = ((2 * M_PI) / 0x10000) * atanS;
return ret;
}
/* ############################################################################################## */
/* 80451168-8045116C 000668 0004+00 2/2 0/0 0/0 .sbss r0 */
static s32 r0;
@@ -187,11 +187,13 @@ void cM_initRnd(int s0, int s1, int s2) {
* Gets a random value
* @return a random value
*/
float cM_rnd() {
f32 cM_rnd() {
r0 = (r0 * 171) % 30269;
r1 = (r1 * 172) % 30307;
r2 = (r2 * 170) % 30323;
return fabsf(fmod(r0 / 30269.0f + r1 / 30307.0f + r2 / 30323.0f, 1.0));
f32 var_f31 = r0 / 30269.0f + r1 / 30307.0f + r2 / 30323.0f;
return fabsf(fmodf(var_f31, 1.0));
}
/* 80267954-8026798C 262294 0038+00 0/0 34/34 951/951 .text cM_rndF__Ff */
@@ -200,7 +202,7 @@ float cM_rnd() {
* @param max The upper bound the random value can be
* @return a random value between 0 and `max`
*/
float cM_rndF(float max) {
f32 cM_rndF(f32 max) {
return cM_rnd() * max;
}
@@ -210,7 +212,7 @@ float cM_rndF(float max) {
* @param max The upper and lower bound the random value can be
* @return a random value between -`max` and +`max`
*/
float cM_rndFX(float max) {
f32 cM_rndFX(f32 max) {
return max * (cM_rnd() - 0.5f) * 2.0f;
}
@@ -232,19 +234,21 @@ void cM_initRnd2(int s0, int s1, int s2) {
}
/* 802679E4-80267ACC 262324 00E8+00 2/2 0/0 0/0 .text cM_rnd2__Fv */
float cM_rnd2() {
f32 cM_rnd2() {
r02 = (r02 * 171) % 30269;
r12 = (r12 * 172) % 30307;
r22 = (r22 * 170) % 30323;
return fabsf(fmod(r02 / 30269.0f + r12 / 30307.0f + r22 / 30323.0f, 1.0));
f32 var_f31 = r02 / 30269.0f + r12 / 30307.0f + r22 / 30323.0f;
return fabsf(fmodf(var_f31, 1.0));
}
/* 80267ACC-80267B04 26240C 0038+00 0/0 0/0 14/14 .text cM_rndF2__Ff */
float cM_rndF2(float max) {
f32 cM_rndF2(f32 max) {
return cM_rnd2() * max;
}
/* 80267B04-80267B4C 262444 0048+00 0/0 0/0 7/7 .text cM_rndFX2__Ff */
float cM_rndFX2(float max) {
f32 cM_rndFX2(f32 max) {
return max * (cM_rnd2() - 0.5f) * 2.0f;
}
}
+6 -7
View File
@@ -4,7 +4,7 @@
*/
#include "SSystem/SComponent/c_node.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
/* 802660D0-802660DC 000C+00 s=1 e=0 z=0 None .text cNd_Join__FP10node_classP10node_class */
void cNd_Join(node_class* node_a, node_class* node_b) {
@@ -51,9 +51,8 @@ node_class* cNd_Order(node_class* node, int idx) {
i++;
node = NODE_GET_NEXT(node);
}
if (i < idx)
return ret;
return NULL;
return i < idx ? ret : NULL;
}
/* 802661BC-802661F0 0034+00 s=0 e=1 z=0 None .text cNd_SingleCut__FP10node_class */
@@ -85,10 +84,10 @@ void cNd_Addition(node_class* node_a, node_class* node_b) {
/* 80266244-802662B0 006C+00 s=0 e=1 z=0 None .text cNd_Insert__FP10node_classP10node_class */
void cNd_Insert(node_class* node_a, node_class* node_b) {
node_class* prev = node_a->mpPrevNode;
if (prev == NULL) {
if (node_a->mpPrevNode == NULL) {
cNd_Addition(node_b, node_a);
} else {
node_class* prev = node_a->mpPrevNode;
cNd_Cut(node_a);
cNd_Addition(prev, node_b);
cNd_Addition(node_b, node_a);
@@ -120,4 +119,4 @@ void cNd_Create(node_class* node, void* data) {
node->mpPrevNode = NULL;
node->mpNextNode = NULL;
node->mpData = data;
}
}
+3 -4
View File
@@ -5,7 +5,7 @@
#include "SSystem/SComponent/c_node_iter.h"
#include "SSystem/SComponent/c_node.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
/* 80266324-802663B4 0090+00 s=0 e=1 z=0 None .text
* cNdIt_Method__FP10node_classPFP10node_classPv_iPv */
@@ -14,8 +14,7 @@ int cNdIt_Method(node_class* node, cNdIt_MethodFunc method, void* data) {
node_class* pNext = NODE_GET_NEXT(node);
while (node) {
int methodRet = method(node, data);
if (!methodRet)
if (!method(node, data))
ret = 0;
node = pNext;
pNext = NODE_GET_NEXT(pNext);
@@ -38,4 +37,4 @@ void* cNdIt_Judge(node_class* node, cNdIt_JudgeFunc judge, void* data) {
}
return NULL;
}
}
+10 -5
View File
@@ -35,13 +35,14 @@ int cPhs_Compleate(request_of_phase_process_class* phase) {
/* 80266678-802666D8 0060+00 s=1 e=0 z=0 None .text cPhs_Next__FP30request_of_phase_process_class
*/
int cPhs_Next(request_of_phase_process_class* phase) {
if (const cPhs__Handler* handlerTable = phase->mpHandlerTable) {
if (phase->mpHandlerTable != NULL) {
cPhs__Handler* handler = phase->mpHandlerTable;
phase->id++;
cPhs__Handler handler = handlerTable[phase->id];
handler += phase->id;
// Double null check here actually matters for emitted assembly.
// Wee old compilers.
if (handler == NULL || handler == NULL) {
if (*handler == NULL || *handler == NULL) {
return cPhs_Compleate(phase);
} else {
return cPhs_LOADING_e;
@@ -64,7 +65,11 @@ int cPhs_Do(request_of_phase_process_class* phase, void* data) {
case cPhs_LOADING_e:
return cPhs_Next(phase);
case cPhs_NEXT_e:
return cPhs_Next(phase) == cPhs_LOADING_e ? cPhs_NEXT_e : cPhs_COMPLEATE_e;
if (cPhs_Next(phase) == cPhs_LOADING_e) {
return cPhs_NEXT_e;
} else {
return cPhs_COMPLEATE_e;
}
case cPhs_COMPLEATE_e:
return cPhs_Compleate(phase);
case cPhs_UNK3_e:
@@ -87,4 +92,4 @@ int cPhs_Do(request_of_phase_process_class* phase, void* data) {
int cPhs_Handler(request_of_phase_process_class* phase, cPhs__Handler* handlerTbl, void* data) {
phase->mpHandlerTable = handlerTbl;
return cPhs_Do(phase, data);
}
}
+4 -4
View File
@@ -57,10 +57,10 @@ node_class* cTg_GetFirst(node_list_class* list) {
create_tag_class* tag = (create_tag_class*)cLs_GetFirst(list);
if (tag != NULL) {
tag->mbIsUse = false;
} else {
tag = NULL;
return &tag->mpNode;
}
return &tag->mpNode;
return NULL;
}
/* 802669A4-802669E4 0040+00 s=0 e=7 z=0 None .text cTg_SingleCut__FP16create_tag_class */
@@ -93,4 +93,4 @@ void cTg_Create(create_tag_class* tag, void* data) {
cNd_Create(&tag->mpNode, NULL);
tag->mpTagData = data;
tag->mbIsUse = false;
}
}
+7 -5
View File
@@ -7,7 +7,7 @@
#include "SSystem/SComponent/c_list.h"
#include "SSystem/SComponent/c_list_iter.h"
#include "SSystem/SComponent/c_tree.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
/* 80266540-802665B4 0074+00 s=0 e=2 z=0 None .text
* cTrIt_Method__FP21node_lists_tree_classPFP10node_classPv_iPv */
@@ -16,8 +16,7 @@ int cTrIt_Method(node_lists_tree_class* tree, cNdIt_MethodFunc method, void* dat
int i = tree->mNumLists;
int ret = 1;
while (i-- > 0) {
int sub = cLsIt_Method(list++, method, data);
if (sub == 0)
if (cLsIt_Method(list++, method, data) == 0)
ret = 0;
}
return ret;
@@ -28,10 +27,13 @@ int cTrIt_Method(node_lists_tree_class* tree, cNdIt_MethodFunc method, void* dat
void* cTrIt_Judge(node_lists_tree_class* tree, cNdIt_JudgeFunc judge, void* data) {
node_list_class* list = tree->mpLists;
int i = tree->mNumLists;
void* pJudgeRet;
while (i-- > 0) {
void* pJudgeRet = cLsIt_Judge(list++, judge, data);
pJudgeRet = cLsIt_Judge(list++, judge, data);
if (pJudgeRet != NULL)
return pJudgeRet;
}
return NULL;
}
}
+34 -36
View File
@@ -5,26 +5,27 @@
#include "SSystem/SComponent/c_xyz.h"
#include "SSystem/SComponent/c_math.h"
#include "JSystem/JUtility/JUTAssert.h"
/* 80266AE4-80266B34 0050+00 s=0 e=103 z=300 None .text __pl__4cXyzCFRC3Vec */
cXyz cXyz::operator+(const Vec& vec) const {
Vec ret;
VECAdd(this, &vec, &ret);
return cXyz(ret);
PSVECAdd(this, &vec, &ret);
return ret;
}
/* 80266B34-80266B84 0050+00 s=0 e=196 z=1082 None .text __mi__4cXyzCFRC3Vec */
cXyz cXyz::operator-(const Vec& vec) const {
Vec ret;
VECSubtract(this, &vec, &ret);
return cXyz(ret);
PSVECSubtract(this, &vec, &ret);
return ret;
}
/* 80266B84-80266BD0 004C+00 s=1 e=99 z=158 None .text __ml__4cXyzCFf */
cXyz cXyz::operator*(f32 scale) const {
Vec ret;
VECScale(this, &ret, scale);
return cXyz(ret);
PSVECScale(this, &ret, scale);
return ret;
}
/* 80266BD0-80266C18 0048+00 s=0 e=7 z=0 None .text __ml__4cXyzCFRC3Vec */
@@ -33,21 +34,21 @@ cXyz cXyz::operator*(const Vec& vec) const {
ret.x = this->x * vec.x;
ret.y = this->y * vec.y;
ret.z = this->z * vec.z;
return cXyz(ret);
return ret;
}
/* 80266C18-80266C6C 0054+00 s=0 e=3 z=12 None .text __dv__4cXyzCFf */
cXyz cXyz::operator/(f32 scale) const {
Vec ret;
VECScale(this, &ret, 1.0f / scale);
return cXyz(ret);
PSVECScale(this, &ret, 1.0f / scale);
return ret;
}
/* 80266C6C-80266CBC 0050+00 s=1 e=0 z=0 None .text getCrossProduct__4cXyzCFRC3Vec */
cXyz cXyz::getCrossProduct(const Vec& vec) const {
Vec ret;
VECCrossProduct(this, &vec, &ret);
return cXyz(ret);
PSVECCrossProduct(this, &vec, &ret);
return ret;
}
/* 80266CBC-80266CE4 0028+00 s=0 e=7 z=6 None .text outprod__4cXyzCFRC3Vec */
@@ -58,54 +59,52 @@ cXyz cXyz::outprod(const Vec& vec) const {
/* 80266CE4-80266D30 004C+00 s=0 e=10 z=1 None .text norm__4cXyzCFv */
cXyz cXyz::norm() const {
Vec ret;
VECNormalize(this, &ret);
return cXyz(ret);
JUT_CONFIRM(251, isNearZeroSquare() == 0);
PSVECNormalize(this, &ret);
return ret;
}
/* 80266D30-80266DC4 0094+00 s=1 e=4 z=0 None .text normZP__4cXyzCFv */
cXyz cXyz::normZP() const {
Vec vec;
if (this->isNearZeroSquare() == false) {
VECNormalize(this, &vec);
PSVECNormalize(this, &vec);
} else {
vec = cXyz::Zero;
}
return cXyz(vec);
}
// doesn't exist in debug rom, but needed to match?
inline void normToUpZIfNearZero(Vec& vec) {
if (cXyz(vec).isNearZeroSquare()) {
vec.x = 0.0f;
vec.y = 0.0f;
vec.z = 1.0f;
const Vec v = {0, 0, 1};
vec = v;
}
return vec;
}
/* 80266DC4-80266EF4 0130+00 s=0 e=0 z=2 None .text normZC__4cXyzCFv */
cXyz cXyz::normZC() const {
Vec outVec;
if (this->isNearZeroSquare() == false) {
VECNormalize(this, &outVec);
if (isNearZeroSquare() == 0) {
PSVECNormalize(this, &outVec);
} else {
outVec = (*this * 1.25f * 1000000.0f).normZP();
normToUpZIfNearZero(outVec);
if (isNearZeroSquare(outVec)) {
outVec.x = 0.0f;
outVec.y = 0.0f;
outVec.z = 1.0f;
outVec = (Vec){0,0,1};
}
}
return outVec;
}
/* 80266EF4-80266F48 0054+00 s=0 e=13 z=17 None .text normalize__4cXyzFv */
cXyz cXyz::normalize() {
VECNormalize(this, this);
JUT_ASSERT(285, isNearZeroSquare() == 0);
PSVECNormalize(this, this);
return *this;
}
/* 80266F48-80266FDC 0094+00 s=0 e=19 z=59 None .text normalizeZP__4cXyzFv */
cXyz cXyz::normalizeZP() {
if (this->isNearZeroSquare() == false) {
VECNormalize(this, this);
PSVECNormalize(this, this);
} else {
*this = cXyz::Zero;
}
@@ -117,7 +116,7 @@ bool cXyz::normalizeRS() {
if (this->isNearZeroSquare()) {
return false;
} else {
VECNormalize(this, this);
PSVECNormalize(this, this);
return true;
}
}
@@ -129,7 +128,7 @@ bool cXyz::operator==(const Vec& vec) const {
/* 8026706C-802670AC 0040+00 s=0 e=6 z=6 None .text __ne__4cXyzCFRC3Vec */
bool cXyz::operator!=(const Vec& vec) const {
return !(this->x == vec.x && this->y == vec.y && this->z == vec.z);
return this->x != vec.x || this->y != vec.y || this->z != vec.z;
}
/* 802670AC-80267128 007C+00 s=0 e=4 z=7 None .text isZero__4cXyzCFv */
@@ -145,8 +144,7 @@ s16 cXyz::atan2sX_Z() const {
/* 80267150-80267290 0140+00 s=0 e=21 z=33 None .text atan2sY_XZ__4cXyzCFv */
s16 cXyz::atan2sY_XZ() const {
f32 mag = this->getMagXZ();
return cM_atan2s(-this->y, sqrtf(mag));
return cM_atan2s(-this->y, absXZ());
}
const cXyz cXyz::Zero(0, 0, 0);
@@ -156,4 +154,4 @@ const cXyz cXyz::BaseZ(0, 0, 1);
const cXyz cXyz::BaseXY(1, 1, 0);
const cXyz cXyz::BaseXZ(1, 0, 1);
const cXyz cXyz::BaseYZ(0, 1, 1);
const cXyz cXyz::BaseXYZ(1, 1, 1);
const cXyz cXyz::BaseXYZ(1, 1, 1);