mirror of
https://github.com/encounter/tp.git
synced 2026-07-11 06:18:46 -07:00
Split SComponent (#45)
* split c_math * split c_angle * split c_API_controller_pad * split c_API_graphic * split c_bg_s_chk * c_bg_s_gnd_chk split * more c_bg split * split c_cc_d * delete asm * split c_cc_s * split c_lib * split c_m2d and c_m3d_g_aab * split c_m3d_g_cir * split c_m3d_g_cps * split rest of c_m3d_g * split c_m3d * split c_malloc * split c_request * split c_sxyz * split and partly decompile c_xyz * format * c_angle.h * begin c_angle decomp * c_angle * progress adding stub classes for SComponent * more c_m3d * remove some asm and format * more m3d headers * more c_angle decomp * c_lib headers * add public to classes * fix csXyz member names * c_sxyz partly OK * move Zero csXyz to c_sxyz header * c_API_graphic * delete some unused asm * move math extern data, decompile some functions * delete unused asm * fix duplicated c_angle.h * fix an inlined function name, add more inlined functions for c_angle.h (currently unused) * format Co-authored-by: Pheenoh <pheenoh@gmail.com>
This commit is contained in:
@@ -1,9 +1,73 @@
|
||||
#ifndef __C_XYZ_H_
|
||||
#define __C_XYZ_H_
|
||||
|
||||
#include "SComponent/c_math.h"
|
||||
#include "global.h"
|
||||
|
||||
class cXyz : public Vec {};
|
||||
extern float /* 1.0 */ lbl_80455070;
|
||||
extern float /* epsilon */ lbl_80455074;
|
||||
extern float lbl_80455078;
|
||||
extern float lbl_8045507C;
|
||||
extern float lbl_80455080;
|
||||
extern float /* 32.0 */ lbl_80455084;
|
||||
extern double lbl_80455088;
|
||||
extern double lbl_80455090;
|
||||
extern double lbl_80455098;
|
||||
extern u8 lbl_80430CE8;
|
||||
|
||||
class cXyz : public Vec {
|
||||
public:
|
||||
~cXyz(){};
|
||||
cXyz() {}
|
||||
cXyz(float x, float y, float z) {
|
||||
this->x = x;
|
||||
this->y = y;
|
||||
this->z = z;
|
||||
}
|
||||
cXyz(const cXyz& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
cXyz(const Vec& vec) {
|
||||
this->x = vec.x;
|
||||
this->y = vec.y;
|
||||
this->z = vec.z;
|
||||
}
|
||||
cXyz operator=(const Vec& vec) {
|
||||
cXyz ret;
|
||||
ret.x = vec.x;
|
||||
ret.y = vec.y;
|
||||
ret.z = vec.z;
|
||||
return ret;
|
||||
}
|
||||
cXyz operator+(const Vec& vec) const;
|
||||
cXyz operator-(const Vec& vec) const;
|
||||
cXyz operator*(float scale) const;
|
||||
cXyz operator*(const Vec& vec) const;
|
||||
cXyz operator/(float) const;
|
||||
cXyz getCrossProduct(const Vec&) const;
|
||||
cXyz outprod(const Vec&) const;
|
||||
cXyz norm(void) const;
|
||||
cXyz normZP(void) const;
|
||||
cXyz normZC(void) const;
|
||||
cXyz normalize(void);
|
||||
cXyz normalizeZP(void);
|
||||
bool normalizeRS(void);
|
||||
bool operator==(const Vec&) const;
|
||||
bool operator!=(const Vec&) const;
|
||||
bool isZero(void) const;
|
||||
s16 atan2sX_Z(void) const;
|
||||
s16 atan2sY_XZ(void) const;
|
||||
|
||||
void baseZ() {
|
||||
this->x = lbl_80455080;
|
||||
this->y = lbl_80455080;
|
||||
this->z = lbl_80455070;
|
||||
}
|
||||
|
||||
bool checkEpsilon() const { return !(PSVECSquareMag(this) < lbl_80455074); }
|
||||
};
|
||||
|
||||
extern cXyz lbl_80430CF4; // SComponent::cXyz::Zero
|
||||
extern cXyz lbl_80430D0C; // SComponent::cXyz::BaseX
|
||||
|
||||
Reference in New Issue
Block a user