NSMBW-Decomp
A decompilation of New Super Mario Bros. Wii
Loading...
Searching...
No Matches
nw4r::g3d::ScnObj Class Referenceabstract
Inheritance diagram for nw4r::g3d::ScnObj:
[legend]

Description

Definition at line 39 of file g3d_scnobj.h.

Public Types

enum  ForEachResult {
  FOREACHRESULT_OK ,
  FOREACHRESULT_CONTINUE ,
  FOREACHRESULT_RETURN ,
  FOREACHRESULT_GOBACK
}
 
enum  ScnObjMtxType {
  MTX_LOCAL ,
  MTX_WORLD ,
  MTX_VIEW ,
  MTX_TYPE_MAX
}
 
enum  ScnObjBoundingVolumeType {
  BOUNDINGVOLUME_AABB_LOCAL ,
  BOUNDINGVOLUME_AABB_WORLD ,
  BOUNDINGVOLUME_MAX
}
 
enum  ScnObjOption {
  OPTID_NONE = (0x00000 | (0)) ,
  OPTID_DISABLE_GATHER_SCNOBJ = (0x00000 | (1)) ,
  OPTID_DISABLE_CALC_WORLD = (0x00000 | (2)) ,
  OPTID_DISABLE_CALC_MAT = (0x00000 | (3)) ,
  OPTID_DISABLE_CALC_VTX = (0x00000 | (4)) ,
  OPTID_DISABLE_CALC_VIEW = (0x00000 | (5)) ,
  OPTID_DISABLE_DRAW_OPA = (0x00000 | (6)) ,
  OPTID_DISABLE_DRAW_XLU = (0x00000 | (7)) ,
  OPTID_DISABLE_UPDATEFRAME = (0x00000 | (8)) ,
  OPTID_ENABLE_CULLING = (0x00000 | (9))
}
 
enum  Timing {
  CALLBACK_TIMING_A = (1 << 0) ,
  CALLBACK_TIMING_B = (1 << 1) ,
  CALLBACK_TIMING_C = (1 << 2) ,
  CALLBACK_TIMING_ALL = (CALLBACK_TIMING_A | CALLBACK_TIMING_B | CALLBACK_TIMING_C)
}
 
enum  ExecOp {
  EXECOP_CALC_WORLD = (1 << 0) ,
  EXECOP_CALC_MAT = (1 << 1) ,
  EXECOP_CALC_VIEW = (1 << 2) ,
  EXECOP_DRAW_OPA = (1 << 4) ,
  EXECOP_DRAW_XLU = (1 << 5)
}
 
typedef ForEachResult(* ForEachFunc) (ScnObj *pParent, void *pInfo)
 
- Public Types inherited from nw4r::g3d::G3dObj
enum  G3dProcTask {
  G3DPROC_NONE = 0x00000 ,
  G3DPROC_CALC_WORLD = 0x00001 ,
  G3DPROC_CALC_MAT = 0x00002 ,
  G3DPROC_CALC_VTX = 0x00003 ,
  G3DPROC_CALC_VIEW = 0x00004 ,
  G3DPROC_GATHER_SCNOBJ = 0x00005 ,
  G3DPROC_DRAW_OPA = 0x00006 ,
  G3DPROC_DRAW_XLU = 0x00007 ,
  G3DPROC_UPDATEFRAME = 0x00008 ,
  __G3DPROC_OPTIONAL_END ,
  G3DPROC_CHILD_DETACHED = 0x10001 ,
  G3DPROC_ATTACH_PARENT = 0x10002 ,
  G3DPROC_DETACH_PARENT = 0x10003 ,
  G3DPROC_ZSORT = 0x10004
}
 

Public Member Functions

 ScnObj (MEMAllocator *pAllocator)
 
virtual void G3dProc (ulong task, ulong param, void *pInfo)=0
 
virtual ForEachResult ForEach (ForEachFunc pFunc, void *pInfo, bool postOrder)=0
 
virtual bool SetScnObjOption (ulong option, ulong value)
 
virtual bool GetScnObjOption (ulong option, ulong *pValue) const
 
virtual f32 GetValueForSortOpa () const
 
virtual f32 GetValueForSortXlu () const
 
virtual void CalcWorldMtx (const math::MTX34 *pParent, ulong *pParam)
 
void CalcViewMtx (const math::MTX34 *pCamera)
 
bool SetMtx (ScnObjMtxType type, const math::MTX34 *pMtx)
 
bool GetMtx (ScnObjMtxType type, math::MTX34 *pMtx) const
 
const math::MTX34GetMtxPtr (ScnObjMtxType type) const
 
void SetPriorityDrawOpa (int prio)
 
int GetPriorityDrawOpa () const
 
void SetPriorityDrawXlu (int prio)
 
int GetPriorityDrawXlu () const
 
void EnableScnObjCallbackTiming (Timing timing)
 
void EnableScnObjCallbackExecOp (ExecOp op)
 
bool SetBoundingVolume (ScnObjBoundingVolumeType type, const math::AABB *pAABB)
 
bool GetBoundingVolume (ScnObjBoundingVolumeType type, math::AABB *pAABB) const
 
bool SetBoundingVolume (const math::AABB *pAABB)
 
- Public Member Functions inherited from nw4r::g3d::G3dObj
virtual bool IsDerivedFrom (TypeObj other) const
 
virtual const TypeObj GetTypeObj () const
 
virtual const char * GetTypeName () const
 
 G3dObj (MEMAllocator *pAllocator, G3dObj *pParent)
 
G3dObjGetParent () const
 
void SetParent (G3dObj *pParent)
 
void DetachFromParent ()
 
void Destroy ()
 

Protected Types

enum  ScnObjFlag {
  SCNOBJFLAG_DISABLE_CALC_WORLD = (1 << 0) ,
  SCNOBJFLAG_DISABLE_CALC_MAT = (1 << 1) ,
  SCNOBJFLAG_DISABLE_CALC_VTX = (1 << 2) ,
  SCNOBJFLAG_DISABLE_CALC_VIEW = (1 << 3) ,
  SCNOBJFLAG_DISABLE_GATHER_SCNOBJ = (1 << 4) ,
  SCNOBJFLAG_DISABLE_DRAW_OPA = (1 << 5) ,
  SCNOBJFLAG_DISABLE_DRAW_XLU = (1 << 6) ,
  SCNOBJFLAG_DISABLE_UPDATEFRAME = (1 << 7) ,
  SCNOBJFLAG_IGNORE_ANMCHR_TRANS = (1 << 8) ,
  SCNOBJFLAG_ENABLE_CULLING = (1 << 28) ,
  SCNOBJFLAG_NOT_GATHER_DRAW_OPA = (1 << 29) ,
  SCNOBJFLAG_NOT_GATHER_DRAW_XLU = (1 << 30) ,
  SCNOBJFLAG_MTX_LOCAL_IDENTITY = (1 << 31) ,
  SCNOBJFLAG_DISABLE_DRAW
}
 

Protected Member Functions

void SetScnObjFlag (ScnObjFlag flag, ulong on)
 
ulong TestScnObjFlag (ScnObjFlag flag) const
 
bool IsG3dProcDisabled (ulong task) const
 
void CheckCallback_CALC_VIEW (Timing timing, ulong param, void *pInfo)
 
void CheckCallback_CALC_MAT (Timing timing, ulong param, void *pInfo)
 
void CheckCallback_CALC_WORLD (Timing timing, ulong param, void *pInfo)
 
void CheckCallback_DRAW_OPA (Timing timing, ulong param, void *pInfo)
 
void CheckCallback_DRAW_XLU (Timing timing, ulong param, void *pInfo)
 

Protected Attributes

math::MTX34 mMtxArray [MTX_TYPE_MAX]
 
math::AABB mAABB [BOUNDINGVOLUME_MAX]
 

Private Member Functions

 NW4R_G3D_RTTI_DECL_DERIVED (ScnObj, G3dObj)
 

Private Attributes

ulong mScnObjFlags
 
u8 mPriorityDrawOpa
 
u8 mPriorityDrawXlu
 
u8 PADDING_0xD2
 
u8 PADDING_0xD3
 
IScnObjCallbackmpFuncObjExec
 
u8 mCallbackTiming
 
u8 mCallbackDeleteOption
 
u16 mCallbackExecOpMask
 

Additional Inherited Members

- Static Public Member Functions inherited from nw4r::g3d::G3dObj
static const G3dObj::TypeObj GetTypeObjStatic ()
 
static void * Alloc (MEMAllocator *pAllocator, ulong size)
 
static void Dealloc (MEMAllocator *pAllocator, void *pBlock)
 
static void * operator new (size_t, void *pBlock)
 
static void operator delete (void *)
 
template<typename TTo>
static TTo * DynamicCast (G3dObj *pObj)
 

Member Typedef Documentation

◆ ForEachFunc

typedef ForEachResult(* nw4r::g3d::ScnObj::ForEachFunc) (ScnObj *pParent, void *pInfo)

Definition at line 48 of file g3d_scnobj.h.

Member Enumeration Documentation

◆ ForEachResult

enum nw4r::g3d::ScnObj::ForEachResult

Definition at line 41 of file g3d_scnobj.h.

◆ ScnObjMtxType

enum nw4r::g3d::ScnObj::ScnObjMtxType

Definition at line 50 of file g3d_scnobj.h.

◆ ScnObjBoundingVolumeType

enum nw4r::g3d::ScnObj::ScnObjBoundingVolumeType

Definition at line 52 of file g3d_scnobj.h.

◆ ScnObjOption

enum nw4r::g3d::ScnObj::ScnObjOption

Definition at line 59 of file g3d_scnobj.h.

◆ Timing

enum nw4r::g3d::ScnObj::Timing

Definition at line 73 of file g3d_scnobj.h.

◆ ExecOp

enum nw4r::g3d::ScnObj::ExecOp

Definition at line 80 of file g3d_scnobj.h.

◆ ScnObjFlag

enum nw4r::g3d::ScnObj::ScnObjFlag
protected

Definition at line 137 of file g3d_scnobj.h.

Member Function Documentation

◆ G3dProc()

virtual void nw4r::g3d::ScnObj::G3dProc ( ulong task,
ulong param,
void * pInfo )
pure virtual

Implements nw4r::g3d::G3dObj.

◆ GetMtxPtr()

const math::MTX34 * nw4r::g3d::ScnObj::GetMtxPtr ( ScnObjMtxType type) const
inline

Definition at line 110 of file g3d_scnobj.h.

◆ GetPriorityDrawOpa()

int nw4r::g3d::ScnObj::GetPriorityDrawOpa ( ) const
inline

Definition at line 115 of file g3d_scnobj.h.

◆ GetPriorityDrawXlu()

int nw4r::g3d::ScnObj::GetPriorityDrawXlu ( ) const
inline

Definition at line 120 of file g3d_scnobj.h.

◆ SetBoundingVolume()

bool nw4r::g3d::ScnObj::SetBoundingVolume ( const math::AABB * pAABB)
inline

Definition at line 132 of file g3d_scnobj.h.

◆ SetScnObjFlag()

void nw4r::g3d::ScnObj::SetScnObjFlag ( ScnObjFlag flag,
ulong on )
inlineprotected

Definition at line 158 of file g3d_scnobj.h.

◆ TestScnObjFlag()

ulong nw4r::g3d::ScnObj::TestScnObjFlag ( ScnObjFlag flag) const
inlineprotected

Definition at line 165 of file g3d_scnobj.h.

◆ IsG3dProcDisabled()

bool nw4r::g3d::ScnObj::IsG3dProcDisabled ( ulong task) const
inlineprotected

Definition at line 169 of file g3d_scnobj.h.

◆ CheckCallback_CALC_VIEW()

void nw4r::g3d::ScnObj::CheckCallback_CALC_VIEW ( Timing timing,
ulong param,
void * pInfo )
inlineprotected

Defined elsewhere to resolve circular dependency with IScnObjCallback

Definition at line 270 of file g3d_scnobj.h.

◆ CheckCallback_CALC_MAT()

void nw4r::g3d::ScnObj::CheckCallback_CALC_MAT ( Timing timing,
ulong param,
void * pInfo )
inlineprotected

Definition at line 278 of file g3d_scnobj.h.

◆ CheckCallback_CALC_WORLD()

void nw4r::g3d::ScnObj::CheckCallback_CALC_WORLD ( Timing timing,
ulong param,
void * pInfo )
inlineprotected

Definition at line 286 of file g3d_scnobj.h.

◆ CheckCallback_DRAW_OPA()

void nw4r::g3d::ScnObj::CheckCallback_DRAW_OPA ( Timing timing,
ulong param,
void * pInfo )
inlineprotected

Definition at line 294 of file g3d_scnobj.h.

◆ CheckCallback_DRAW_XLU()

void nw4r::g3d::ScnObj::CheckCallback_DRAW_XLU ( Timing timing,
ulong param,
void * pInfo )
inlineprotected

Definition at line 302 of file g3d_scnobj.h.

Member Data Documentation

◆ mMtxArray

math::MTX34 nw4r::g3d::ScnObj::mMtxArray[MTX_TYPE_MAX]
protected

Definition at line 187 of file g3d_scnobj.h.

◆ mAABB

math::AABB nw4r::g3d::ScnObj::mAABB[BOUNDINGVOLUME_MAX]
protected

Definition at line 188 of file g3d_scnobj.h.

◆ mScnObjFlags

ulong nw4r::g3d::ScnObj::mScnObjFlags
private

Definition at line 191 of file g3d_scnobj.h.

◆ mPriorityDrawOpa

u8 nw4r::g3d::ScnObj::mPriorityDrawOpa
private

Definition at line 192 of file g3d_scnobj.h.

◆ mPriorityDrawXlu

u8 nw4r::g3d::ScnObj::mPriorityDrawXlu
private

Definition at line 193 of file g3d_scnobj.h.

◆ PADDING_0xD2

u8 nw4r::g3d::ScnObj::PADDING_0xD2
private

Definition at line 194 of file g3d_scnobj.h.

◆ PADDING_0xD3

u8 nw4r::g3d::ScnObj::PADDING_0xD3
private

Definition at line 195 of file g3d_scnobj.h.

◆ mpFuncObjExec

IScnObjCallback* nw4r::g3d::ScnObj::mpFuncObjExec
private

Definition at line 196 of file g3d_scnobj.h.

◆ mCallbackTiming

u8 nw4r::g3d::ScnObj::mCallbackTiming
private

Definition at line 197 of file g3d_scnobj.h.

◆ mCallbackDeleteOption

u8 nw4r::g3d::ScnObj::mCallbackDeleteOption
private

Definition at line 198 of file g3d_scnobj.h.

◆ mCallbackExecOpMask

u16 nw4r::g3d::ScnObj::mCallbackExecOpMask
private

Definition at line 199 of file g3d_scnobj.h.