Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

d_a_obj_tumble_weed mostly done #88

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config/SOUE01/rels/d_a_obj_tumble_weedNP/splits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ REL/global_destructor_chain.c:
REL/d/a/obj/d_a_obj_tumble_weed.cpp:
.text start:0x000000F0 end:0x00002278
.ctors start:0x00000000 end:0x00000004
.rodata start:0x00000000 end:0x000000AC
.data start:0x00000000 end:0x0000024C
.bss start:0x00000008 end:0x000000A0
50 changes: 25 additions & 25 deletions config/SOUE01/rels/d_a_obj_tumble_weedNP/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,42 @@ _unresolved = .text:0x00000060; // type:function size:0x4 scope:global
__register_global_object = .text:0x00000070; // type:function size:0x1C scope:global
__destroy_global_chain = .text:0x00000090; // type:function size:0x54 scope:global
dAcOTumbleWeed_c_classInit__Fv = .text:0x000000F0; // type:function size:0x118
fn_475_210 = .text:0x00000210; // type:function size:0x58
__dt__15dShadowCircle_cFv = .text:0x00000210; // type:function size:0x58 scope:weak
__dt__29sFState_c<16dAcOTumbleWeed_c>Fv = .text:0x00000270; // type:function size:0x58
__dt__32sFStateFct_c<16dAcOTumbleWeed_c>Fv = .text:0x000002D0; // type:function size:0x6C
__dt__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000340; // type:function size:0xA0
__dt__55sFStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c>Fv = .text:0x000003E0; // type:function size:0xA4
fn_475_490 = .text:0x00000490; // type:function size:0x80
fn_475_510 = .text:0x00000510; // type:function size:0x1D8
createHeap__16dAcOTumbleWeed_cFv = .text:0x00000490; // type:function size:0x80
actorCreate__16dAcOTumbleWeed_cFv = .text:0x00000510; // type:function size:0x1D8
changeState__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>FRC12sStateIDIf_c = .text:0x000006F0; // type:function size:0x10
fn_475_700 = .text:0x00000700; // type:function size:0x8
fn_475_710 = .text:0x00000710; // type:function size:0x8
fn_475_720 = .text:0x00000720; // type:function size:0x314
actorPostCreate__16dAcOTumbleWeed_cFv = .text:0x00000700; // type:function size:0x8
doDelete__16dAcOTumbleWeed_cFv = .text:0x00000710; // type:function size:0x8
actorExecute__16dAcOTumbleWeed_cFv = .text:0x00000720; // type:function size:0x314
executeState__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>Fv = .text:0x00000A40; // type:function size:0x10
fn_475_A50 = .text:0x00000A50; // type:function size:0x1C
fn_475_A70 = .text:0x00000A70; // type:function size:0xE4
calcTimer<Us>__4sLibFPUs_Us = .text:0x00000A50; // type:function size:0x1C
draw__16dAcOTumbleWeed_cFv = .text:0x00000A70; // type:function size:0xE4
initializeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000B60; // type:function size:0xC
executeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000B70; // type:function size:0xD4
finalizeState_Wait__16dAcOTumbleWeed_cFv = .text:0x00000C50; // type:function size:0x4
initializeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000C60; // type:function size:0x4
executeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000C70; // type:function size:0xA0
finalizeState_Slope__16dAcOTumbleWeed_cFv = .text:0x00000D10; // type:function size:0x4
fn_475_D20 = .text:0x00000D20; // type:function size:0x118
fn_475_E40 = .text:0x00000E40; // type:function size:0x1C
fn_475_E60 = .text:0x00000E60; // type:function size:0x11C
fn_475_F80 = .text:0x00000F80; // type:function size:0x6C
fn_475_FF0 = .text:0x00000FF0; // type:function size:0x58
fn_475_1050 = .text:0x00001050; // type:function size:0x6C
fn_475_10C0 = .text:0x000010C0; // type:function size:0x684
fn_475_1750 = .text:0x00001750; // type:function size:0x58
fn_475_17B0 = .text:0x000017B0; // type:function size:0x1A8
fn_475_1960 = .text:0x00001960; // type:function size:0x68
fn_475_19D0 = .text:0x000019D0; // type:function size:0xA0
fn_475_1A70 = .text:0x00001A70; // type:function size:0x88
fn_475_1B00 = .text:0x00001B00; // type:function size:0x4C
fn_475_1B50 = .text:0x00001B50; // type:function size:0xD0
fn_475_1C20 = .text:0x00001C20; // type:function size:0x1C
fn_475_1C40 = .text:0x00001C40; // type:function size:0xAC
checkBreak__16dAcOTumbleWeed_cFv = .text:0x00000D20; // type:function size:0x118
fn_475_E40__16dAcOTumbleWeed_cCFv = .text:0x00000E40; // type:function size:0x1C
checkSlope__16dAcOTumbleWeed_cFv = .text:0x00000E60; // type:function size:0x11C
checkCollect__16dAcOTumbleWeed_cFv = .text:0x00000F80; // type:function size:0x6C
checkInvalidGround__16dAcOTumbleWeed_cCFv = .text:0x00000FF0; // type:function size:0x58
doBreak__16dAcOTumbleWeed_cFv = .text:0x00001050; // type:function size:0x6C
calcMatrix__16dAcOTumbleWeed_cFv = .text:0x000010C0; // type:function size:0x684
adjustAngle__16dAcOTumbleWeed_cFv = .text:0x00001750; // type:function size:0x58
adjustSpeed__16dAcOTumbleWeed_cFv = .text:0x000017B0; // type:function size:0x1A8
tumbleBounceMaybe__16dAcOTumbleWeed_cFv = .text:0x00001960; // type:function size:0x68
adjustTimeScale__16dAcOTumbleWeed_cFv = .text:0x000019D0; // type:function size:0xA0
adjustTumble__16dAcOTumbleWeed_cFRC7mVec3_c = .text:0x00001A70; // type:function size:0x88
setWind__16dAcOTumbleWeed_cFRC7mVec3_c = .text:0x00001B00; // type:function size:0x4C
calcWind__16dAcOTumbleWeed_cFv = .text:0x00001B50; // type:function size:0xD0
calcTimer<Uc>__4sLibFPUc_Uc = .text:0x00001C20; // type:function size:0x1C
getPosition__16dAcOTumbleWeed_cCFv = .text:0x00001C40; // type:function size:0xAC
__dt__16dAcOTumbleWeed_cFv = .text:0x00001CF0; // type:function size:0x10C
getStateID__85sStateMgr_c<16dAcOTumbleWeed_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x00001E00; // type:function size:0x10
build__32sFStateFct_c<16dAcOTumbleWeed_c>FRC12sStateIDIf_c = .text:0x00001E10; // type:function size:0x60
Expand Down Expand Up @@ -83,5 +83,5 @@ __global_destructor_chain = .bss:0x00000000; // type:object size:0x4 scope:globa
lbl_475_bss_8 = .bss:0x00000008; // type:object size:0x10 data:4byte
lbl_475_bss_18 = .bss:0x00000018; // type:object size:0x40 data:4byte
lbl_475_bss_58 = .bss:0x00000058; // type:object size:0x30 data:4byte
lbl_475_bss_88 = .bss:0x00000088; // type:object size:0x8 data:byte
@GUARD@draw__16dAcOTumbleWeed_cFv@shadowRot = .bss:0x00000088; // type:object size:0x8 data:byte
lbl_475_bss_90 = .bss:0x00000090; // type:object size:0x10 data:float
15 changes: 14 additions & 1 deletion config/SOUE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43853,7 +43853,20 @@ PARTICLE_RESOURCE_ID_MAPPING_721_ = .sdata2:0x8057A952; // type:object size:0x8
PARTICLE_RESOURCE_ID_MAPPING_725_ = .sdata2:0x8057A95A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_726_ = .sdata2:0x8057A95C; // type:object size:0x1A data:2byte
PARTICLE_RESOURCE_ID_MAPPING_739_ = .sdata2:0x8057A976; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_740_ = .sdata2:0x8057A978; // type:object size:0x1C data:2byte
PARTICLE_RESOURCE_ID_MAPPING_740_ = .sdata2:0x8057A978; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_741_ = .sdata2:0x8057A97A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_742_ = .sdata2:0x8057A97C; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_743_ = .sdata2:0x8057A97E; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_744_ = .sdata2:0x8057A980; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_745_ = .sdata2:0x8057A982; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_746_ = .sdata2:0x8057A984; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_747_ = .sdata2:0x8057A986; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_748_ = .sdata2:0x8057A988; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_749_ = .sdata2:0x8057A98A; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_750_ = .sdata2:0x8057A98C; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_751_ = .sdata2:0x8057A98E; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_752_ = .sdata2:0x8057A990; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_753_ = .sdata2:0x8057A992; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_754_ = .sdata2:0x8057A994; // type:object size:0x18 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_766_ = .sdata2:0x8057A9AC; // type:object size:0x2 data:2byte
PARTICLE_RESOURCE_ID_MAPPING_767_ = .sdata2:0x8057A9AE; // type:object size:0x2 data:2byte
Expand Down
2 changes: 1 addition & 1 deletion include/d/a/d_a_player.h
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class dAcPy_c : public dAcObjBase_c {
/* vt 0x284 */ virtual bool isUsingBugnet() const;
/* vt 0x288 */ virtual const mVec3_c &getBugNetPos() const;
/* vt 0x28C */ virtual void isUsingBugnet1();
/* vt 0x290 */ virtual void bugNetCollectTreasure();
/* vt 0x290 */ virtual void bugNetCollectTreasure(u32 itemId);
/* vt 0x294 */ virtual void somethingSwitchDials();
/* vt 0x298 */ virtual void vt_0x298();
/* vt 0x29C */ virtual void getDieLargeDamageDir();
Expand Down
10 changes: 9 additions & 1 deletion include/d/a/obj/d_a_obj_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
#include "d/a/d_a_base.h"
#include "d/col/c/c_cc_d.h"
#include "d/col/c/c_m3d_g_aab.h"
#include "egg/math/eggMath.h"
#include "m/m3d/m_shadow.h"
#include "m/m3d/m_smdl.h"
#include "m/m_angle.h"
#include "m/m_mtx.h"
#include "m/m_vec.h"
#include "m/types_m.h"


// Size: 0xA8
struct ActorCarryStruct {
/* 0x00 */ fLiNdBa_c actorLink;
Expand Down Expand Up @@ -89,6 +89,14 @@ class dAcObjBase_c : public dAcBase_c {
return angle;
}

f32 getVelocityMag() const {
return fabsf(nw4r::math::VEC3LenSq(velocity));
}

bool isStopped() const {
return getVelocityMag() <= EGG::Math<f32>::epsilon();
}

// could be their own thing?
/* 8002de40 */ static void *getOarcFile(const char *oarcName, const char *fileName);
/* 8002de60 */ static void *getOarcSubEntry(const char *oarcName, const char *fileName);
Expand Down
76 changes: 73 additions & 3 deletions include/d/a/obj/d_a_obj_tumble_weed.h
Original file line number Diff line number Diff line change
@@ -1,20 +1,90 @@
#ifndef D_A_OBJ_TUMBLE_WEED_H
#define D_A_OBJ_TUMBLE_WEED_H

#include "common.h"
#include "d/a/obj/d_a_obj_base.h"
#include "d/col/bg/d_bg_s_acch.h"
#include "d/col/cc/d_cc_d.h"
#include "d/d_shadow.h"
#include "m/m3d/m_smdl.h"
#include "m/m_mtx.h"
#include "m/m_quat.h"
#include "m/m_vec.h"
#include "nw4r/g3d/g3d_resfile.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"
#include "toBeSorted/dowsing_target.h"
#include "toBeSorted/time_area_mgr.h"

class dAcOTumbleWeed_c : public dAcObjBase_c {
public:
dAcOTumbleWeed_c() : mStateMgr(*this, sStateID::null) {}
dAcOTumbleWeed_c() : mDowsingTarget(this, DowsingTarget::SLOT_NONE), mStateMgr(*this, sStateID::null) {}
virtual ~dAcOTumbleWeed_c() {}

virtual int doDelete() override;
virtual int draw() override;
virtual bool createHeap() override;
virtual int actorCreate() override;
virtual int actorPostCreate() override;
virtual int actorExecute() override;

bool checkCollect();
bool checkBreak();
void doBreak();

void adjustTimeScale();
void adjustTumble(const mVec3_c &dir);
void calcWind();
mVec3_c getPosition() const;
void calcMatrix();

void adjustAngle();
void adjustSpeed();
void tumbleBounceMaybe();

void setWind(const mVec3_c &);

bool checkSlope();

bool fn_475_E40() const;
bool checkInvalidGround() const;

// Look at `isStopped` in dAcObjBase. This may be a diff inline
f32 getWindMag() const {
return fabsf(nw4r::math::VEC3LenSq(mWind));
}
bool isWindStop() const {
return getWindMag() <= EGG::Math<f32>::epsilon();
}

STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Wait);
STATE_FUNC_DECLARE(dAcOTumbleWeed_c, Slope);

private:
/* 0x??? */ STATE_MGR_DECLARE(dAcOTumbleWeed_c);
/* 0x330 */ nw4r::g3d::ResFile mResFile;
/* 0x334 */ m3d::smdl_c mMdl;
/* 0x350 */ dShadowCircle_c mShdw;
/* 0x358 */ dCcD_Sph mSph;
/* 0x4A8 */ dBgS_AcchCir mAcchCir;
/* 0x504 */ dBgS_ObjAcch mObjAcch;
/* 0x8B4 */ DowsingTarget mDowsingTarget;
/* 0x8D4 */ STATE_MGR_DECLARE(dAcOTumbleWeed_c);
/* 0x910 */ mQuat_c mField_0x910;
/* 0x920 */ TimeAreaStruct mTimeArea;
/* 0x92C */ mMtx_c mShadowMtx;
/* 0x95C */ mVec3_c mWind;
/* 0x968 */ mVec3_c mField_0x968;
/* 0x974 */ f32 mField_0x974;
/* 0x978 */ f32 mField_0x978;
/* 0x97C */ f32 mField_0x97C;
/* 0x980 */ f32 mField_0x980;
/* 0x984 */ f32 mSpeedTarget;
/* 0x988 */ u16 mTumbleTimer;
/* 0x98A */ u8 mWindTimer;
/* 0x98B */ u8 mField_0x98B;
/* 0x98C */ u8 mField_0x98C;
/* 0x98D */ bool mbOnGround;

static dCcD_SrcSph sSphSrc;
};

#endif
12 changes: 12 additions & 0 deletions include/d/col/bg/d_bg_pc.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,18 @@ enum dBgPc_ECode {
/* 0x80000000 */ CODE_UNUSED_8000_0000 = 0x80000000,
};

enum dBgPc_Attribute {
POLY_ATTR_NORMAL = 0,
POLY_ATTR_SLOPE = 1,
POLY_ATTR_LAVA = 7,
POLY_ATTR_SAND_SHALLOW = 9,
POLY_ATTR_SAND_MED = 10,
POLY_ATTR_SAND_DEEP_INSTANT = 11,
POLY_ATTR_WATER = 12,
POLY_ATTR_DAMAGE = 13,
POLY_ATTR_SLOPE_RUN = 15,
POLY_ATTR_SAND_DEEP_SLOW = 16,
};
class dBgPc {
public:
void setCode(sBgPc &);
Expand Down
40 changes: 37 additions & 3 deletions include/d/col/c/c_cc_d.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ class cCcD_Stts {
dAcObjBase_c *GetAc() {
return mpActor;
}

const mVec3_c &GetCcMove() const {
return mCcMove;
}
};

struct cCcD_SrcGObjTgInfo {
Expand All @@ -323,6 +327,36 @@ struct cCcD_SrcGObjTg {
/* 0x0E */ u16 mField_0x0E;
};

enum cCcD_AtType_e {
/* 0x 0000 0001 */ AT_TYPE_0x1 = (1 << 0),
/* 0x 0000 0002 */ AT_TYPE_0x2 = (1 << 1),
/* 0x 0000 0004 */ AT_TYPE_0x4 = (1 << 2),
/* 0x 0000 0008 */ AT_TYPE_0x8 = (1 << 3),
/* 0x 0000 0010 */ AT_TYPE_0x10 = (1 << 4),
/* 0x 0000 0020 */ AT_TYPE_0x20 = (1 << 5),
/* 0x 0000 0040 */ AT_TYPE_0x40 = (1 << 6),
/* 0x 0000 0080 */ AT_TYPE_0x80 = (1 << 7),
/* 0x 0000 0100 */ AT_TYPE_0x100 = (1 << 8),
/* 0x 0000 0200 */ AT_TYPE_0x200 = (1 << 9),
/* 0x 0000 0400 */ AT_TYPE_0x400 = (1 << 10),
/* 0x 0000 0800 */ AT_TYPE_0x800 = (1 << 11),
/* 0x 0000 1000 */ AT_TYPE_0x1000 = (1 << 12),
/* 0x 0000 2000 */ AT_TYPE_0x2000 = (1 << 13),
/* 0x 0000 4000 */ AT_TYPE_0x4000 = (1 << 14),
/* 0x 0000 8000 */ AT_TYPE_0x8000 = (1 << 15),
/* 0x 0001 0000 */ AT_TYPE_0x10000 = (1 << 16),
/* 0x 0002 0000 */ AT_TYPE_0x20000 = (1 << 17),
/* 0x 0004 0000 */ AT_TYPE_0x40000 = (1 << 18),
/* 0x 0008 0000 */ AT_TYPE_0x80000 = (1 << 19),
/* 0x 0010 0000 */ AT_TYPE_0x100000 = (1 << 20),
/* 0x 0020 0000 */ AT_TYPE_0x200000 = (1 << 21),
/* 0x 0040 0000 */ AT_TYPE_0x400000 = (1 << 22),
/* 0x 0080 0000 */ AT_TYPE_0x800000 = (1 << 23),
/* 0x 0100 0000 */ AT_TYPE_BUGNET = (1 << 24),
/* 0x 0200 0000 */ AT_TYPE_0x2000000 = (1 << 25),
/* 0x 0400 0000 */ AT_TYPE_0x4000000 = (1 << 26),
/* 0x 0800 0000 */ AT_TYPE_0x8000000 = (1 << 27),
};
enum cCcD_AtModifiers_e {
/* 0x 0000 0001 */ AT_MOD_FIRE = (1 << 0),
/* 0x 0000 0002 */ AT_MOD_0x2 = (1 << 1),
Expand Down Expand Up @@ -758,13 +792,13 @@ class cCcD_Obj {
}

bool ChkTgHit() {
return mTg.MskSPrm(1) != 0 && mTg.GetActor() != nullptr;
return mTg.MskRPrm(1) != 0 && mTg.GetActor() != nullptr;
}
bool ChkAtHit() {
return mAt.MskSPrm(1) != 0 && mAt.GetActor() != nullptr;
return mAt.MskRPrm(1) != 0 && mAt.GetActor() != nullptr;
}
bool ChkCoHit() {
return mCo.MskSPrm(1) != 0 && mCo.GetActor() != nullptr;
return mCo.MskRPrm(1) != 0 && mCo.GetActor() != nullptr;
}

dAcObjBase_c *GetAc() {
Expand Down
4 changes: 2 additions & 2 deletions include/d/col/c/c_m3d_g_pla.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ class cM3dGPla {
return EGG::Math<f32>::sqrt(mNormal.x * mNormal.x + mNormal.z * mNormal.z);
}

mAng GetAngleY() const {
return cM::atan2s(mNormal.x, mNormal.z);
s32 GetAngleY() const {
return mAng(cM::atan2s(mNormal.x, mNormal.z));
}
};

Expand Down
4 changes: 4 additions & 0 deletions include/d/col/c/c_m3d_g_sph.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ class cM3dGSph {
void SetR(f32);
void SetC(f32, f32, f32);

void SetC(const mVec3_c &p) {
SetC(&p);
}

f32 GetYDist(f32) const;
bool Cross(const cM3dGTri *, f32 *, mVec3_c *);
void Clamp(const mVec3_c &, mVec3_c &) const;
Expand Down
6 changes: 2 additions & 4 deletions include/d/t/d_t_tumble_weed.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
#ifndef D_T_TUMBLE_WEED_H
#define D_T_TUMBLE_WEED_H

#include "d/a/obj/d_a_obj_tumble_weed.h"
#include "d/t/d_tg.h"
#include "f/f_list_nd.h"
#include "s/s_State.hpp"
#include "s/s_StateMgr.hpp"

class dTgTumbleWeed_c : public dTg_c {
public:
Expand All @@ -29,8 +28,7 @@ class dTgTumbleWeed_c : public dTg_c {
u16 tumbleweedTimer;
u16 padding;
u16 windTimer;
// TODO dAcObjTumbleWeed
dAcRef_c<dAcBase_c> childTumbleweed;
dAcRef_c<dAcOTumbleWeed_c> childTumbleweed;
u16 someField;
};

Expand Down
4 changes: 4 additions & 0 deletions include/egg/math/eggMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class Math {
return (T)0;
}

static T clamp(T x, T low, T high) {
return (x < low ? low : (x > high ? high : x));
}

static T sqrt(T);
static T sin(T);
static T cos(T);
Expand Down
Loading