mirror of
https://github.com/zeldaret/ss
synced 2026-08-22 06:44:26 -04:00
Get the thing building again after Eggification
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
#include "math.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
|
||||
// TODO - a lot of this has been moved to nw4r and egg. Kept for reference for now.
|
||||
|
||||
namespace JGeometry {
|
||||
|
||||
template<typename T>
|
||||
|
||||
@@ -41,6 +41,12 @@ struct JPABaseShapeData {
|
||||
/* 0x30 */ u8 mTexAnmRndmMask;
|
||||
};
|
||||
|
||||
struct JPABaseShapeAlphaArg {
|
||||
GXTevAlphaArg mArg[4];
|
||||
GXTevOp mOp;
|
||||
GXTevScale mScale;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup jsystem-jparticle
|
||||
*
|
||||
@@ -56,7 +62,7 @@ public:
|
||||
static GXCompare st_c[8];
|
||||
static GXAlphaOp st_ao[4];
|
||||
static GXTevColorArg st_ca[6][4];
|
||||
static GXTevAlphaArg st_aa[2][4];
|
||||
static JPABaseShapeAlphaArg st_aa[5];
|
||||
|
||||
GXBlendMode getBlendMode() const { return st_bm[mpData->mBlendModeCfg & 0x03]; }
|
||||
GXBlendFactor getBlendSrc() const { return st_bf[(mpData->mBlendModeCfg >> 2) & 0x0F]; }
|
||||
@@ -75,14 +81,14 @@ public:
|
||||
u8 getAlphaRef1() const { return mpData->mAlphaRef1; }
|
||||
|
||||
const GXTevColorArg* getTevColorArg() const { return st_ca[(mpData->mFlags >> 0x0F) & 0x07]; }
|
||||
const GXTevAlphaArg* getTevAlphaArg() const { return st_aa[(mpData->mFlags >> 0x12) & 0x01]; }
|
||||
const JPABaseShapeAlphaArg* getTevAlphaArg() const { return &st_aa[(mpData->mFlags >> 0x12) & 0x07]; }
|
||||
|
||||
u32 getType() const { return (mpData->mFlags >> 0) & 0x0F; }
|
||||
u32 getDirType() const { return (mpData->mFlags >> 4) & 0x07; }
|
||||
u32 getRotType() const { return (mpData->mFlags >> 7) & 0x07; }
|
||||
u32 getBasePlaneType() const { return (mpData->mFlags >> 10) & 0x01; }
|
||||
u32 getTilingS() const { return (mpData->mFlags >> 25) & 0x01; }
|
||||
u32 getTilingT() const { return (mpData->mFlags >> 26) & 0x01; }
|
||||
u32 getTilingS() const { return (mpData->mFlags >> 27) & 0x01; } // was 25
|
||||
u32 getTilingT() const { return (mpData->mFlags >> 28) & 0x01; } // was 26
|
||||
BOOL isGlblClrAnm() const { return mpData->mFlags & 0x00001000; }
|
||||
BOOL isGlblTexAnm() const { return mpData->mFlags & 0x00004000; }
|
||||
BOOL isPrjTex() const { return mpData->mFlags & 0x00100000; }
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
@@ -19,9 +20,9 @@ struct JPADynamicsBlockData {
|
||||
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ u32 mResUserWork;
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mEmitterScl;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> mEmitterTrs;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> mEmitterDir;
|
||||
/* 0x10 */ EGG::Vector3f mEmitterScl;
|
||||
/* 0x1C */ EGG::Vector3f mEmitterTrs;
|
||||
/* 0x28 */ EGG::Vector3f mEmitterDir;
|
||||
/* 0x34 */ f32 mInitialVelOmni;
|
||||
/* 0x38 */ f32 mInitialVelAxis;
|
||||
/* 0x3C */ f32 mInitialVelRndm;
|
||||
@@ -73,13 +74,13 @@ public:
|
||||
u32 getVolumeType() const { return (mpData->mFlags >> 8) & 0x07; }
|
||||
u16 getDivNumber() const { return mpData->mDivNumber; }
|
||||
f32 getRateRndm() const { return mpData->mRateRndm; }
|
||||
void getEmitterScl(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterScl(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterScl.x, mpData->mEmitterScl.y, mpData->mEmitterScl.z);
|
||||
}
|
||||
void getEmitterTrs(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterTrs(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterTrs.x, mpData->mEmitterTrs.y, mpData->mEmitterTrs.z);
|
||||
}
|
||||
void getEmitterDir(JGeometry::TVec3<f32>* vec) const {
|
||||
void getEmitterDir(EGG::Vector3f* vec) const {
|
||||
vec->set(mpData->mEmitterDir.x, mpData->mEmitterDir.y, mpData->mEmitterDir.z);
|
||||
}
|
||||
void getEmitterRot(JGeometry::TVec3<s16>* vec) const {
|
||||
|
||||
@@ -21,9 +21,9 @@ class JPAParticleCallBack;
|
||||
*/
|
||||
struct JPAEmitterWorkData {
|
||||
struct JPAVolumeCalcData {
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mVolumePos;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mVelOmni;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mVelAxis;
|
||||
/* 0x00 */ EGG::Vector3f mVolumePos;
|
||||
/* 0x0C */ EGG::Vector3f mVelOmni;
|
||||
/* 0x18 */ EGG::Vector3f mVelAxis;
|
||||
};
|
||||
|
||||
JPAEmitterWorkData() : mRndm(0) {}
|
||||
@@ -42,11 +42,11 @@ struct JPAEmitterWorkData {
|
||||
/* 0x78 */ Mtx mRotationMtx;
|
||||
/* 0xA8 */ Mtx mGlobalRot;
|
||||
/* 0xD8 */ Mtx mGlobalSR;
|
||||
/* 0x108 */ JGeometry::TVec3<f32> mEmitterPos;
|
||||
/* 0x114 */ JGeometry::TVec3<f32> mGlobalScl;
|
||||
/* 0x120 */ JGeometry::TVec3<f32> mGlobalEmtrDir;
|
||||
/* 0x12C */ JGeometry::TVec3<f32> mPublicScale;
|
||||
/* 0x138 */ JGeometry::TVec3<f32> mGlobalPos;
|
||||
/* 0x108 */ EGG::Vector3f mEmitterPos;
|
||||
/* 0x114 */ EGG::Vector3f mGlobalScl;
|
||||
/* 0x120 */ EGG::Vector3f mGlobalEmtrDir;
|
||||
/* 0x12C */ EGG::Vector3f mPublicScale;
|
||||
/* 0x138 */ EGG::Vector3f mGlobalPos;
|
||||
/* 0x144 */ JGeometry::TVec2<f32> mGlobalPtclScl;
|
||||
/* 0x14C */ JGeometry::TVec2<f32> mPivot;
|
||||
/* 0x154 */ Mtx mYBBCamMtx;
|
||||
@@ -105,7 +105,7 @@ public:
|
||||
/* 8027E6EC */ void init(JPAEmitterManager*, JPAResource*);
|
||||
/* 8027EDD4 */ bool processTillStartFrame();
|
||||
/* 8027EE14 */ bool processTermination();
|
||||
/* 8027EEB0 */ void calcEmitterGlobalPosition(JGeometry::TVec3<f32>*) const;
|
||||
/* 8027EEB0 */ void calcEmitterGlobalPosition(EGG::Vector3f*) const;
|
||||
/* 8027EC60 */ void deleteAllParticle();
|
||||
/* 8027EB60 */ JPABaseParticle* createChild(JPABaseParticle*);
|
||||
/* 8027EA40 */ JPABaseParticle* createParticle();
|
||||
@@ -134,13 +134,13 @@ public:
|
||||
mGlobalPScl.y = mGlobalScl.y;
|
||||
}
|
||||
void setGlobalTranslation(f32 x, f32 y, f32 z) { mGlobalTrs.set(x, y, z); }
|
||||
void setGlobalTranslation(const JGeometry::TVec3<f32>& trs) { mGlobalTrs.set(trs); }
|
||||
void getLocalTranslation(JGeometry::TVec3<f32>& vec) { vec.set(mLocalTrs); }
|
||||
void setGlobalTranslation(const EGG::Vector3f& trs) { mGlobalTrs.set(trs); }
|
||||
void getLocalTranslation(EGG::Vector3f& vec) { vec.set(mLocalTrs); }
|
||||
void setGlobalRotation(const JGeometry::TVec3<s16>& rot) {
|
||||
JPAGetXYZRotateMtx(rot.x, rot.y, rot.z, mGlobalRot);
|
||||
}
|
||||
void getGlobalTranslation(JGeometry::TVec3<f32>* out) const { out->set(mGlobalTrs); }
|
||||
void setGlobalDynamicsScale(const JGeometry::TVec3<f32>& i_scale) { mGlobalScl.set(i_scale); }
|
||||
void getGlobalTranslation(EGG::Vector3f* out) const { out->set(mGlobalTrs); }
|
||||
void setGlobalDynamicsScale(const EGG::Vector3f& i_scale) { mGlobalScl.set(i_scale); }
|
||||
void setGlobalAlpha(u8 alpha) { mGlobalPrmClr.a = alpha; }
|
||||
u8 getGlobalAlpha() { return mGlobalPrmClr.a; }
|
||||
void getGlobalPrmColor(GXColor& color) { color = mGlobalPrmClr; }
|
||||
@@ -151,23 +151,23 @@ public:
|
||||
void setAwayFromCenterSpeed(f32 i_speed) { mAwayFromCenterSpeed = i_speed; }
|
||||
void setAwayFromAxisSpeed(f32 i_speed) { mAwayFromAxisSpeed = i_speed; }
|
||||
void setSpread(f32 i_spread) { mSpread = i_spread; }
|
||||
void setLocalTranslation(const JGeometry::TVec3<f32>& i_trans) { mLocalTrs.set(i_trans); }
|
||||
void setLocalTranslation(const EGG::Vector3f& i_trans) { mLocalTrs.set(i_trans); }
|
||||
void setLocalRotation(const JGeometry::TVec3<s16>& i_rot) { mLocalRot.set(i_rot.x * 0.005493248f, i_rot.y * 0.005493248f, i_rot.z * 0.005493248f); }
|
||||
void setRateStep(u8 i_step) { mRateStep = i_step; }
|
||||
|
||||
void setGlobalParticleHeightScale(f32 height) {
|
||||
mGlobalPScl.y = height;
|
||||
}
|
||||
void setGlobalParticleScale(const JGeometry::TVec3<f32>& scale) {
|
||||
void setGlobalParticleScale(const EGG::Vector3f& scale) {
|
||||
mGlobalPScl.set(scale.x, scale.y);
|
||||
}
|
||||
void setGlobalParticleScale(f32 scaleX, f32 scaleY) {
|
||||
mGlobalPScl.set(scaleX, scaleY);
|
||||
}
|
||||
void getGlobalParticleScale(JGeometry::TVec3<f32>& scale) {
|
||||
void getGlobalParticleScale(EGG::Vector3f& scale) {
|
||||
scale.set(mGlobalPScl.x, mGlobalPScl.y, 1.0f);
|
||||
}
|
||||
void setGlobalScale(const JGeometry::TVec3<f32>& scale) {
|
||||
void setGlobalScale(const EGG::Vector3f& scale) {
|
||||
mGlobalScl.set(scale);
|
||||
mGlobalPScl.set(scale.x ,scale.y);
|
||||
}
|
||||
@@ -175,11 +175,11 @@ public:
|
||||
JPASetRMtxSTVecfromMtx(matrix, mGlobalRot, &mGlobalScl, &mGlobalTrs);
|
||||
mGlobalPScl.set(mGlobalScl.x, mGlobalScl.y);
|
||||
}
|
||||
void setDirection(const JGeometry::TVec3<f32>& direction) {
|
||||
void setDirection(const EGG::Vector3f& direction) {
|
||||
mLocalDir.set(direction);
|
||||
}
|
||||
|
||||
void setLocalScale(const JGeometry::TVec3<f32>& scale) {
|
||||
void setLocalScale(const EGG::Vector3f& scale) {
|
||||
mLocalScl.set(scale);
|
||||
}
|
||||
|
||||
@@ -219,9 +219,9 @@ public:
|
||||
u32 getAge() const { return mTick; }
|
||||
|
||||
public:
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mLocalScl;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mLocalTrs;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mLocalDir;
|
||||
/* 0x00 */ EGG::Vector3f mLocalScl;
|
||||
/* 0x0C */ EGG::Vector3f mLocalTrs;
|
||||
/* 0x18 */ EGG::Vector3f mLocalDir;
|
||||
/* 0x24 */ s32 mMaxFrame;
|
||||
/* 0x28 */ f32 mRate;
|
||||
/* 0x2C */ f32 mVolumeSweep;
|
||||
@@ -238,8 +238,8 @@ public:
|
||||
/* 0x56 */ u8 mRateStep;
|
||||
/* 0x58 */ JSULink<JPABaseEmitter> mLink;
|
||||
/* 0x68 */ Mtx mGlobalRot;
|
||||
/* 0x98 */ JGeometry::TVec3<f32> mGlobalScl;
|
||||
/* 0xA4 */ JGeometry::TVec3<f32> mGlobalTrs;
|
||||
/* 0x98 */ EGG::Vector3f mGlobalScl;
|
||||
/* 0xA4 */ EGG::Vector3f mGlobalTrs;
|
||||
/* 0xB0 */ JGeometry::TVec2<f32> mGlobalPScl;
|
||||
/* 0xB8 */ GXColor mGlobalPrmClr;
|
||||
/* 0xBC */ GXColor mGlobalEnvClr;
|
||||
|
||||
@@ -22,7 +22,7 @@ struct JPAEmitterWorkData;
|
||||
class JPAEmitterManager {
|
||||
public:
|
||||
/* 8027DCA0 */ JPAEmitterManager(u32, u32, EGG::Heap*, u8, u8);
|
||||
/* 8027DEBC */ JPABaseEmitter* createSimpleEmitterID(JGeometry::TVec3<f32> const&, u16, u8, u8,
|
||||
/* 8027DEBC */ JPABaseEmitter* createSimpleEmitterID(EGG::Vector3f const&, u16, u8, u8,
|
||||
JPAEmitterCallBack*, JPAParticleCallBack*);
|
||||
/* 8027DFA0 */ void calc(u8);
|
||||
/* 8027E028 */ void draw(JPADrawInfo const*, u8);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "egg/egg_types.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPAEmitterWorkData;
|
||||
class JPABaseParticle;
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
/* 80276A8C */ virtual void prepare(JPAEmitterWorkData*, JPAFieldBlock*) {}
|
||||
virtual void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*) = 0;
|
||||
|
||||
/* 0x04 */ JGeometry::TVec3<f32> mAccel;
|
||||
/* 0x04 */ EGG::Vector3f mAccel;
|
||||
};
|
||||
|
||||
class JPAFieldVortex : public JPAFieldBase {
|
||||
@@ -27,7 +27,7 @@ public:
|
||||
/* 8027C674 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D564 */ ~JPAFieldVortex() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ f32 field_0x1c;
|
||||
/* 0x20 */ f32 field_0x20;
|
||||
};
|
||||
@@ -38,9 +38,9 @@ public:
|
||||
/* 8027CFA8 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D3F4 */ ~JPAFieldSpin() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> field_0x1c;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> field_0x28;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
class JPAFieldRandom : public JPAFieldBase {
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
/* 8027C3E0 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D5C0 */ ~JPAFieldNewton() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
/* 0x1C */ f32 mCutoff;
|
||||
};
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
/* 8027C29C */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D61C */ ~JPAFieldMagnet() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mDir;
|
||||
};
|
||||
|
||||
class JPAFieldGravity : public JPAFieldBase {
|
||||
@@ -87,9 +87,9 @@ public:
|
||||
/* 8027CA94 */ void calc(JPAEmitterWorkData*, JPAFieldBlock*, JPABaseParticle*);
|
||||
/* 8027D508 */ ~JPAFieldConvection() {}
|
||||
|
||||
/* 0x10 */ JGeometry::TVec3<f32> field_0x10;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> field_0x1c;
|
||||
/* 0x28 */ JGeometry::TVec3<f32> field_0x28;
|
||||
/* 0x10 */ EGG::Vector3f field_0x10;
|
||||
/* 0x1C */ EGG::Vector3f field_0x1c;
|
||||
/* 0x28 */ EGG::Vector3f field_0x28;
|
||||
};
|
||||
|
||||
class JPAFieldAir : public JPAFieldBase {
|
||||
@@ -105,8 +105,8 @@ public:
|
||||
/* 0x00 */ u8 mMagic[4];
|
||||
/* 0x04 */ u32 mSize;
|
||||
/* 0x08 */ u32 mFlags;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mPos;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x0C */ EGG::Vector3f mPos;
|
||||
/* 0x18 */ EGG::Vector3f mDir;
|
||||
/* 0x24 */ f32 mMag;
|
||||
/* 0x28 */ f32 mMagRndm;
|
||||
/* 0x2C */ f32 mVal1;
|
||||
@@ -135,11 +135,11 @@ public:
|
||||
u8 getCycle() { return mpData->mCycle; }
|
||||
f32 getFadeInRate() { return mFadeInRate; }
|
||||
f32 getFadeOutRate() { return mFadeOutRate; }
|
||||
JGeometry::TVec3<f32>& getPos() { return mPos; }
|
||||
JGeometry::TVec3<f32>& getDir() { return mDir; }
|
||||
EGG::Vector3f& getPos() { return mPos; }
|
||||
EGG::Vector3f& getDir() { return mDir; }
|
||||
f32 getMag() const { return mMag; }
|
||||
void getPosOrig(JGeometry::TVec3<f32>* pos) { pos->set(mpData->mPos); }
|
||||
void getDirOrig(JGeometry::TVec3<f32>* dir) { dir->set(mpData->mDir); }
|
||||
void getPosOrig(EGG::Vector3f* pos) { pos->set(mpData->mPos); }
|
||||
void getDirOrig(EGG::Vector3f* dir) { dir->set(mpData->mDir); }
|
||||
f32 getMagOrig() { return mpData->mMag; }
|
||||
void initOpParam() {
|
||||
getPosOrig(&mPos);
|
||||
@@ -154,8 +154,8 @@ private:
|
||||
/* 0x04 */ JPAFieldBase* mpField;
|
||||
/* 0x08 */ f32 mFadeInRate;
|
||||
/* 0x0C */ f32 mFadeOutRate;
|
||||
/* 0x10 */ JGeometry::TVec3<f32> mPos;
|
||||
/* 0x1C */ JGeometry::TVec3<f32> mDir;
|
||||
/* 0x10 */ EGG::Vector3f mPos;
|
||||
/* 0x1C */ EGG::Vector3f mDir;
|
||||
/* 0x28 */ f32 mMag;
|
||||
|
||||
enum Type {
|
||||
|
||||
@@ -2,15 +2,14 @@
|
||||
#define JPAMATH_H
|
||||
|
||||
#include "common.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
void JPAGetDirMtx(JGeometry::TVec3<f32> const& param_0, f32 (*param_1)[4]);
|
||||
void JPAGetDirMtx(EGG::Vector3f const& param_0, f32 (*param_1)[4]);
|
||||
void JPAGetYZRotateMtx(s16 angleY, s16 angleZ, f32 (*param_2)[4]);
|
||||
void JPAGetXYZRotateMtx(s16 x, s16 y, s16 z, Mtx dst);
|
||||
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4],
|
||||
JGeometry::TVec3<f32>* param_2);
|
||||
void JPASetRMtxTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4], EGG::Vector3f *param_2);
|
||||
f32 JPACalcKeyAnmValue(f32 param_0, u16 param_1, f32 const* param_2);
|
||||
void JPASetRMtxSTVecfromMtx(f32 const (*param_0)[4], f32 (*param_1)[4],
|
||||
JGeometry::TVec3<f32>* param_2, JGeometry::TVec3<f32>* param_3);
|
||||
EGG::Vector3f* param_2, EGG::Vector3f* param_3);
|
||||
|
||||
#endif /* JPAMATH_H */
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "rvl/GX.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
#include "egg/math/eggVector.h"
|
||||
|
||||
class JPABaseEmitter;
|
||||
class JPABaseParticle;
|
||||
@@ -28,11 +28,11 @@ public:
|
||||
/* 80280548 */ f32 getWidth(JPABaseEmitter const*) const;
|
||||
/* 80280568 */ f32 getHeight(JPABaseEmitter const*) const;
|
||||
int getAge() { return mAge; }
|
||||
void setOffsetPosition(const JGeometry::TVec3<f32>& pos) { mOffsetPosition.set(pos); }
|
||||
void setOffsetPosition(const EGG::Vector3f& pos) { mOffsetPosition.set(pos); }
|
||||
void setOffsetPosition(f32 x, f32 y, f32 z) { mOffsetPosition.set(x, y, z); }
|
||||
void getOffsetPosition(JGeometry::TVec3<f32>& pos) { pos.set(mOffsetPosition); }
|
||||
void getOffsetPosition(EGG::Vector3f& pos) { pos.set(mOffsetPosition); }
|
||||
u16 getRotateAngle() const { return mRotateAngle; }
|
||||
void getGlobalPosition(JGeometry::TVec3<f32>& pos) const { pos.set(mPosition); }
|
||||
void getGlobalPosition(EGG::Vector3f& pos) const { pos.set(mPosition); }
|
||||
f32 getParticleScaleX() const { return mParticleScaleX; }
|
||||
f32 getParticleScaleY() const { return mParticleScaleY; }
|
||||
void setStatus(u32 flag) { mStatus |= flag; }
|
||||
@@ -40,19 +40,19 @@ public:
|
||||
void initStatus(u32 status) { mStatus = status; }
|
||||
void setInvisibleParticleFlag() { setStatus(8); }
|
||||
void setDeleteParticleFlag() { setStatus(2); }
|
||||
void getVelVec(JGeometry::TVec3<f32>& vec) const { vec.set(mVelocity); }
|
||||
void getLocalPosition(JGeometry::TVec3<f32>& vec) const { vec.set(mLocalPosition); }
|
||||
void getBaseAxis(JGeometry::TVec3<f32>& vec) const { vec.set(mBaseAxis); }
|
||||
void getVelVec(EGG::Vector3f& vec) const { vec.set(mVelocity); }
|
||||
void getLocalPosition(EGG::Vector3f& vec) const { vec.set(mLocalPosition); }
|
||||
void getBaseAxis(EGG::Vector3f& vec) const { vec.set(mBaseAxis); }
|
||||
|
||||
public:
|
||||
/* 0x00 */ JGeometry::TVec3<f32> mPosition;
|
||||
/* 0x0C */ JGeometry::TVec3<f32> mLocalPosition;
|
||||
/* 0x18 */ JGeometry::TVec3<f32> mOffsetPosition;
|
||||
/* 0x24 */ JGeometry::TVec3<f32> mVelocity;
|
||||
/* 0x30 */ JGeometry::TVec3<f32> mVelType1;
|
||||
/* 0x3C */ JGeometry::TVec3<f32> mVelType0;
|
||||
/* 0x48 */ JGeometry::TVec3<f32> mVelType2;
|
||||
/* 0x54 */ JGeometry::TVec3<f32> mBaseAxis;
|
||||
/* 0x00 */ EGG::Vector3f mPosition;
|
||||
/* 0x0C */ EGG::Vector3f mLocalPosition;
|
||||
/* 0x18 */ EGG::Vector3f mOffsetPosition;
|
||||
/* 0x24 */ EGG::Vector3f mVelocity;
|
||||
/* 0x30 */ EGG::Vector3f mVelType1;
|
||||
/* 0x3C */ EGG::Vector3f mVelType0;
|
||||
/* 0x48 */ EGG::Vector3f mVelType2;
|
||||
/* 0x54 */ EGG::Vector3f mBaseAxis;
|
||||
/* 0x60 */ f32 mParticleScaleX;
|
||||
/* 0x64 */ f32 mParticleScaleY;
|
||||
/* 0x68 */ f32 mScaleOut;
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
#ifndef TPOSITION3_H
|
||||
#define TPOSITION3_H
|
||||
|
||||
#include "dolphin/mtx.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "JSystem/JGeometry.h"
|
||||
|
||||
namespace JGeometry {
|
||||
|
||||
template <typename T>
|
||||
struct SMatrix34C {
|
||||
T data[3][4];
|
||||
};
|
||||
|
||||
template <>
|
||||
struct SMatrix34C<f32> {
|
||||
f32 data[3][4];
|
||||
|
||||
void identity() { MTXIdentity(data); }
|
||||
|
||||
typedef f32 ArrType[4];
|
||||
void set(const ArrType* src) {
|
||||
JMath::gekko_ps_copy12(data, src);
|
||||
}
|
||||
|
||||
operator ArrType*() { return data; }
|
||||
operator const ArrType*() const { return data; }
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct SMatrix33C {
|
||||
T data[3][3];
|
||||
|
||||
inline T& ref(int i, int j) {
|
||||
return data[i][j];
|
||||
}
|
||||
|
||||
inline T at(int i, int j) const {
|
||||
return data[i][j];
|
||||
}
|
||||
|
||||
inline void set(T param_1, T param_2, T param_3, T param_4, T param_5,
|
||||
T param_6, T param_7, T param_8, T param_9) {
|
||||
ref(0,0) = param_1;
|
||||
ref(0,1) = param_2;
|
||||
ref(0,2) = param_3;
|
||||
ref(1,0) = param_4;
|
||||
ref(1,1) = param_5;
|
||||
ref(1,2) = param_6;
|
||||
ref(2,0) = param_7;
|
||||
ref(2,1) = param_8;
|
||||
ref(2,2) = param_9;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TMatrix34 : public T {};
|
||||
|
||||
template <typename T>
|
||||
struct TRotation3 : public T {};
|
||||
|
||||
template<typename T>
|
||||
struct TRotation3<SMatrix33C<T> > : public SMatrix33C<T> {
|
||||
inline void getEulerXYZ(TVec3<T>* param_1) const {
|
||||
if (at(2, 0) - TUtil<T>::one() >= -TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(-at(0, 1), at(1, 1)), -TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
if (at(2, 0) + TUtil<T>::one() <= TUtil<T>::epsilon()) {
|
||||
param_1->set(TUtil<T>::atan2(at(0, 1), at(1, 1)), TUtil<T>::halfPI(), 0.0);
|
||||
} else {
|
||||
param_1->x = TUtil<T>::atan2(at(2, 1), at(2, 2));
|
||||
param_1->z = TUtil<T>::atan2(at(1, 0), at(0, 0));
|
||||
param_1->y = TUtil<T>::asin(-at(2, 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct TPosition3 : public T {};
|
||||
|
||||
typedef TPosition3<TRotation3<TMatrix34<SMatrix34C<f32> > > > TPosition3f32;
|
||||
|
||||
} // namespace JGeometry
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user