NW4F G3d
Loading...
Searching...
No Matches
nw::g3d::SkeletonObj Class Reference

#include <g3d_SkeletonObj.h>

Classes

class  Impl
class  InitArg
class  Sizer

Public Types

enum  Flag {
  BLOCK_BUFFER_VALID = 0x1 << 0 , BLOCK_BUFFER_SWAP = 0x1 << 1 , CACHE_LOCAL_MTX = 0x1 << 2 , INVALID_LOCAL_MTX = 0x1 << 3 ,
  MASK_LOCAL_MTX = CACHE_LOCAL_MTX | INVALID_LOCAL_MTX , CACHE_WORLD_MTX = 0x1 << 4 , INVALID_WORLD_MTX = 0x1 << 5 , MASK_WORLD_MTX = CACHE_WORLD_MTX | INVALID_WORLD_MTX ,
  SCALE_SHIFT = ResSkeleton::SCALE_SHIFT , SCALE_NONE = ResSkeleton::SCALE_NONE , SCALE_STD = ResSkeleton::SCALE_STD , SCALE_MAYA = ResSkeleton::SCALE_MAYA ,
  SCALE_SOFTIMAGE = ResSkeleton::SCALE_SOFTIMAGE , SCALE_MASK = ResSkeleton::SCALE_MASK , ROT_SHIFT = ResSkeleton::ROT_SHIFT , ROT_EULER_XYZ = ResSkeleton::ROT_EULER_XYZ ,
  ROT_QUAT = ResSkeleton::ROT_QUAT , ROT_MASK = ResSkeleton::ROT_MASK
}
enum  Alignment { BUFFER_ALIGNMENT = LL_CACHE_FETCH_SIZE , BLOCK_BUFFER_ALIGNMENT = GX2_UNIFORM_BLOCK_ALIGNMENT }

Public Member Functions

 SkeletonObj ()
bool Init (const InitArg &arg, void *pBuffer, size_t bufferSize)
size_t CalcBlockBufferSize () const
bool SetupBlockBuffer (void *pBuffer, size_t bufferSize)
void CleanupBlockBuffer ()
void ClearLocalMtx ()
void CalcWorldMtx (const Mtx34 &baseMtx)
void CalcBillboardMtx (Mtx34 *pMtxArray, const Mtx34 &cameraMtx, int boneIndex, bool combineWorld=false) const
void CalcMtxBlock (int bufferIndex=0)
ResSkeletonGetResource ()
const ResSkeletonGetResource () const
void * GetBufferPtr ()
void * GetBlockBufferPtr ()
bool IsBlockBufferValid () const
int GetScaleMode () const
int GetRotateMode () const
LocalMtxGetLocalMtxArray ()
const LocalMtxGetLocalMtxArray () const
Mtx34GetWorldMtxArray ()
const Mtx34GetWorldMtxArray () const
GfxBufferGetMtxBlock ()
const GfxBufferGetMtxBlock () const
int GetBufferingCount () const
void EnableBlockSwap ()
void DisableBlockSwap ()
bool IsBlockSwapEnabled () const
void SetUserPtr (void *pUserPtr)
void * GetUserPtr ()
const void * GetUserPtr () const
template<typename T>
T * GetUserPtr ()
template<typename T>
const T * GetUserPtr () const
int GetBoneCount () const
ResBoneGetBone (int boneIndex)
const ResBoneGetBone (int boneIndex) const
ResBoneGetBone (const char *name)
const ResBoneGetBone (const char *name) const
const char * GetBoneName (int boneIndex) const
int GetBoneIndex (const char *name) const
void SetCalcWorldCallback (ICalcWorldCallback *pCallback)
ICalcWorldCallbackGetCalcWorldCallback ()
const ICalcWorldCallbackGetCalcWorldCallback () const
void SetCallbackBoneIndex (int boneIndex)
int GetCallbackBoneIndex () const
size_t CalcLocalMtxLCSize () const
size_t LCMountLocalMtx (void *pLC, size_t size, bool load)
void LCUnmountLocalMtx (bool store)
bool IsLocalMtxOnCache () const
size_t CalcWorldMtxLCSize () const
size_t LCMountWorldMtx (void *pLC, size_t size, bool load)
void LCUnmountWorldMtx (bool store)
bool IsWorldMtxOnCache () const
size_t CalcMtxBlockLCSize () const
size_t LCMountMtxBlock (void *pLC, size_t size, bool load, int bufferIndex=0)
void LCUnmountMtxBlock (bool store, int bufferIndex=0)

Static Public Member Functions

static size_t CalcBufferSize (const InitArg &arg)

Protected Member Functions

template<typename CalcType, bool useCallback>
void CalcWorldImpl (const Mtx34 &baseMtx)

Private Member Functions

 NW_G3D_DISALLOW_COPY_AND_ASSIGN (SkeletonObj)

Private Attributes

ResSkeletonm_pRes
bit16 m_Flag
u8 m_NumBuffering
u8 reserved
ResBoneDatam_pBoneArray
LocalMtxDatam_pLocalMtxArray
Mtx34m_pWorldMtxArray
Vec3m_pScaleArray
GfxBuffer m_MtxBlock
u16 m_NumBone
u16 m_CallbackBone
ICalcWorldCallbackm_pCallback
void * m_pMemLocalMtxArray
void * m_pMemWorldMtxArray
void * m_pLCMtxBlock
void * m_pUserPtr
void * m_pBufferPtr
void * m_pBlockBuffer

Member Enumeration Documentation

◆ Flag

Enumerator
BLOCK_BUFFER_VALID 
BLOCK_BUFFER_SWAP 
CACHE_LOCAL_MTX 
INVALID_LOCAL_MTX 
MASK_LOCAL_MTX 
CACHE_WORLD_MTX 
INVALID_WORLD_MTX 
MASK_WORLD_MTX 
SCALE_SHIFT 
SCALE_NONE 
SCALE_STD 
SCALE_MAYA 
SCALE_SOFTIMAGE 
SCALE_MASK 
ROT_SHIFT 
ROT_EULER_XYZ 
ROT_QUAT 
ROT_MASK 

◆ Alignment

Enumerator
BUFFER_ALIGNMENT 
BLOCK_BUFFER_ALIGNMENT 

Constructor & Destructor Documentation

◆ SkeletonObj()

nw::g3d::SkeletonObj::SkeletonObj ( )
inline

Member Function Documentation

◆ CalcBufferSize()

size_t nw::g3d::SkeletonObj::CalcBufferSize ( const InitArg & arg)
static

◆ Init()

bool nw::g3d::SkeletonObj::Init ( const InitArg & arg,
void * pBuffer,
size_t bufferSize )

◆ CalcBlockBufferSize()

size_t nw::g3d::SkeletonObj::CalcBlockBufferSize ( ) const

◆ SetupBlockBuffer()

bool nw::g3d::SkeletonObj::SetupBlockBuffer ( void * pBuffer,
size_t bufferSize )

◆ CleanupBlockBuffer()

void nw::g3d::SkeletonObj::CleanupBlockBuffer ( )

◆ ClearLocalMtx()

void nw::g3d::SkeletonObj::ClearLocalMtx ( )

◆ CalcWorldMtx()

void nw::g3d::SkeletonObj::CalcWorldMtx ( const Mtx34 & baseMtx)

◆ CalcBillboardMtx()

void nw::g3d::SkeletonObj::CalcBillboardMtx ( Mtx34 * pMtxArray,
const Mtx34 & cameraMtx,
int boneIndex,
bool combineWorld = false ) const

◆ CalcMtxBlock()

void nw::g3d::SkeletonObj::CalcMtxBlock ( int bufferIndex = 0)

◆ GetResource() [1/2]

ResSkeleton * nw::g3d::SkeletonObj::GetResource ( )
inline

◆ GetResource() [2/2]

const ResSkeleton * nw::g3d::SkeletonObj::GetResource ( ) const
inline

◆ GetBufferPtr()

void * nw::g3d::SkeletonObj::GetBufferPtr ( )
inline

◆ GetBlockBufferPtr()

void * nw::g3d::SkeletonObj::GetBlockBufferPtr ( )
inline

◆ IsBlockBufferValid()

bool nw::g3d::SkeletonObj::IsBlockBufferValid ( ) const
inline

◆ GetScaleMode()

int nw::g3d::SkeletonObj::GetScaleMode ( ) const
inline

◆ GetRotateMode()

int nw::g3d::SkeletonObj::GetRotateMode ( ) const
inline

◆ GetLocalMtxArray() [1/2]

LocalMtx * nw::g3d::SkeletonObj::GetLocalMtxArray ( )
inline

◆ GetLocalMtxArray() [2/2]

const LocalMtx * nw::g3d::SkeletonObj::GetLocalMtxArray ( ) const
inline

◆ GetWorldMtxArray() [1/2]

Mtx34 * nw::g3d::SkeletonObj::GetWorldMtxArray ( )
inline

◆ GetWorldMtxArray() [2/2]

const Mtx34 * nw::g3d::SkeletonObj::GetWorldMtxArray ( ) const
inline

◆ GetMtxBlock() [1/2]

GfxBuffer & nw::g3d::SkeletonObj::GetMtxBlock ( )
inline

◆ GetMtxBlock() [2/2]

const GfxBuffer & nw::g3d::SkeletonObj::GetMtxBlock ( ) const
inline

◆ GetBufferingCount()

int nw::g3d::SkeletonObj::GetBufferingCount ( ) const
inline

◆ EnableBlockSwap()

void nw::g3d::SkeletonObj::EnableBlockSwap ( )
inline

◆ DisableBlockSwap()

void nw::g3d::SkeletonObj::DisableBlockSwap ( )
inline

◆ IsBlockSwapEnabled()

bool nw::g3d::SkeletonObj::IsBlockSwapEnabled ( ) const
inline

◆ SetUserPtr()

void nw::g3d::SkeletonObj::SetUserPtr ( void * pUserPtr)
inline

◆ GetUserPtr() [1/4]

void * nw::g3d::SkeletonObj::GetUserPtr ( )
inline

◆ GetUserPtr() [2/4]

const void * nw::g3d::SkeletonObj::GetUserPtr ( ) const
inline

◆ GetUserPtr() [3/4]

template<typename T>
T * nw::g3d::SkeletonObj::GetUserPtr ( )
inline

◆ GetUserPtr() [4/4]

template<typename T>
const T * nw::g3d::SkeletonObj::GetUserPtr ( ) const
inline

◆ GetBoneCount()

int nw::g3d::SkeletonObj::GetBoneCount ( ) const
inline

◆ GetBone() [1/4]

ResBone * nw::g3d::SkeletonObj::GetBone ( int boneIndex)
inline

◆ GetBone() [2/4]

const ResBone * nw::g3d::SkeletonObj::GetBone ( int boneIndex) const
inline

◆ GetBone() [3/4]

ResBone * nw::g3d::SkeletonObj::GetBone ( const char * name)
inline

◆ GetBone() [4/4]

const ResBone * nw::g3d::SkeletonObj::GetBone ( const char * name) const
inline

◆ GetBoneName()

const char * nw::g3d::SkeletonObj::GetBoneName ( int boneIndex) const
inline

◆ GetBoneIndex()

int nw::g3d::SkeletonObj::GetBoneIndex ( const char * name) const
inline

◆ SetCalcWorldCallback()

void nw::g3d::SkeletonObj::SetCalcWorldCallback ( ICalcWorldCallback * pCallback)
inline

◆ GetCalcWorldCallback() [1/2]

ICalcWorldCallback * nw::g3d::SkeletonObj::GetCalcWorldCallback ( )
inline

◆ GetCalcWorldCallback() [2/2]

const ICalcWorldCallback * nw::g3d::SkeletonObj::GetCalcWorldCallback ( ) const
inline

◆ SetCallbackBoneIndex()

void nw::g3d::SkeletonObj::SetCallbackBoneIndex ( int boneIndex)
inline

◆ GetCallbackBoneIndex()

int nw::g3d::SkeletonObj::GetCallbackBoneIndex ( ) const
inline

◆ CalcLocalMtxLCSize()

size_t nw::g3d::SkeletonObj::CalcLocalMtxLCSize ( ) const
inline

◆ LCMountLocalMtx()

size_t nw::g3d::SkeletonObj::LCMountLocalMtx ( void * pLC,
size_t size,
bool load )

◆ LCUnmountLocalMtx()

void nw::g3d::SkeletonObj::LCUnmountLocalMtx ( bool store)

◆ IsLocalMtxOnCache()

bool nw::g3d::SkeletonObj::IsLocalMtxOnCache ( ) const
inline

◆ CalcWorldMtxLCSize()

size_t nw::g3d::SkeletonObj::CalcWorldMtxLCSize ( ) const
inline

◆ LCMountWorldMtx()

size_t nw::g3d::SkeletonObj::LCMountWorldMtx ( void * pLC,
size_t size,
bool load )

◆ LCUnmountWorldMtx()

void nw::g3d::SkeletonObj::LCUnmountWorldMtx ( bool store)

◆ IsWorldMtxOnCache()

bool nw::g3d::SkeletonObj::IsWorldMtxOnCache ( ) const
inline

◆ CalcMtxBlockLCSize()

size_t nw::g3d::SkeletonObj::CalcMtxBlockLCSize ( ) const
inline

◆ LCMountMtxBlock()

size_t nw::g3d::SkeletonObj::LCMountMtxBlock ( void * pLC,
size_t size,
bool load,
int bufferIndex = 0 )

◆ LCUnmountMtxBlock()

void nw::g3d::SkeletonObj::LCUnmountMtxBlock ( bool store,
int bufferIndex = 0 )

◆ CalcWorldImpl()

template<typename CalcType, bool useCallback>
void nw::g3d::SkeletonObj::CalcWorldImpl ( const Mtx34 & baseMtx)
protected

◆ NW_G3D_DISALLOW_COPY_AND_ASSIGN()

nw::g3d::SkeletonObj::NW_G3D_DISALLOW_COPY_AND_ASSIGN ( SkeletonObj )
private

Member Data Documentation

◆ m_pRes

ResSkeleton* nw::g3d::SkeletonObj::m_pRes
private

◆ m_Flag

bit16 nw::g3d::SkeletonObj::m_Flag
mutableprivate

◆ m_NumBuffering

u8 nw::g3d::SkeletonObj::m_NumBuffering
private

◆ reserved

u8 nw::g3d::SkeletonObj::reserved
private

◆ m_pBoneArray

ResBoneData* nw::g3d::SkeletonObj::m_pBoneArray
private

◆ m_pLocalMtxArray

LocalMtxData* nw::g3d::SkeletonObj::m_pLocalMtxArray
private

◆ m_pWorldMtxArray

Mtx34* nw::g3d::SkeletonObj::m_pWorldMtxArray
private

◆ m_pScaleArray

Vec3* nw::g3d::SkeletonObj::m_pScaleArray
private

◆ m_MtxBlock

GfxBuffer nw::g3d::SkeletonObj::m_MtxBlock
private

◆ m_NumBone

u16 nw::g3d::SkeletonObj::m_NumBone
private

◆ m_CallbackBone

u16 nw::g3d::SkeletonObj::m_CallbackBone
private

◆ m_pCallback

ICalcWorldCallback* nw::g3d::SkeletonObj::m_pCallback
private

◆ m_pMemLocalMtxArray

void* nw::g3d::SkeletonObj::m_pMemLocalMtxArray
private

◆ m_pMemWorldMtxArray

void* nw::g3d::SkeletonObj::m_pMemWorldMtxArray
private

◆ m_pLCMtxBlock

void* nw::g3d::SkeletonObj::m_pLCMtxBlock
private

◆ m_pUserPtr

void* nw::g3d::SkeletonObj::m_pUserPtr
private

◆ m_pBufferPtr

void* nw::g3d::SkeletonObj::m_pBufferPtr
private

◆ m_pBlockBuffer

void* nw::g3d::SkeletonObj::m_pBlockBuffer
private