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

#include <g3d_ShapeObj.h>

Classes

class  InitArg
class  Sizer

Public Types

enum  Alignment { BUFFER_ALIGNMENT = CACHE_BLOCK_SIZE , BLOCK_BUFFER_ALIGNMENT = GX2_UNIFORM_BLOCK_ALIGNMENT }

Public Member Functions

 ShapeObj ()
bool Init (const InitArg &arg, void *pBuffer, size_t bufferSize)
size_t CalcBlockBufferSize () const
bool SetupBlockBuffer (void *pBuffer, size_t bufferSize)
void CleanupBlockBuffer ()
void CalcBounding (const SkeletonObj *pSkeleton)
void CalcSubBounding (const SkeletonObj *pSkeleton)
void CalcShpBlock (int viewIndex, const Mtx34 &worldMtx, int bufferIndex=0)
ResShapeGetResource ()
const ResShapeGetResource () const
void * GetBufferPtr ()
void * GetBlockBufferPtr ()
bool IsBlockBufferValid () const
int GetMaterialIndex () const
int GetBoneIndex () const
int GetVertexIndex () const
int GetVtxSkinCount () const
bool IsRigidBody () const
bool IsRigidSkinning () const
bool IsSmoothSkinning () const
ResMeshGetResMesh (int meshIndex=0)
const ResMeshGetResMesh (int meshIndex=0) const
int GetMeshCount () const
int GetViewCount () const
int GetSubMeshCount () const
bool IsViewDependent () const
int GetShpBlockCount () const
GfxBufferGetShpBlock (int viewIndex)
const GfxBufferGetShpBlock (int viewIndex) 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
ResVertexGetResVertex ()
const ResVertexGetResVertex () const
int GetVtxAttribCount () const
ResVtxAttribGetResVtxAttrib (int attribIndex)
const ResVtxAttribGetResVtxAttrib (int attribIndex) const
ResVtxAttribGetResVtxAttrib (const char *name)
const ResVtxAttribGetResVtxAttrib (const char *name) const
const char * GetVtxAttribName (int attribIndex) const
int GetVtxAttribIndex (const char *name) const
int GetVertexBufferCount () const
GfxBufferGetVertexBuffer (int bufferIndex)
const GfxBufferGetVertexBuffer (int bufferIndex) const
SphereGetBounding ()
const SphereGetBounding () const
const AABBGetSubBoundingArray () const
const u16 * GetSubMeshIndexArray () const
bool TestSubMeshIntersection (CullingContext *pCtx, const ViewVolume &volume) const
int GetKeyShapeCount () const
ResKeyShapeGetResKeyShape (int keyShapeIndex)
const ResKeyShapeGetResKeyShape (int keyShapeIndex) const
ResKeyShapeGetResKeyShape (const char *name)
const ResKeyShapeGetResKeyShape (const char *name) const
const char * GetKeyShapeName (int keyShapeIndex) const
int GetKeyShapeIndex (const char *name) const
int GetTargetAttribCount () const
void ClearBlendWeights ()
 NW_G3D_DEPRECATED_FUNCTION (bool IsBlendWeightValid() const)
bool HasValidBlendWeight () const
void SetBlendWeight (int keyShapeIndex, float weight)
float GetBlendWeight (int keyShapeIndex) const

Static Public Member Functions

static size_t CalcBufferSize (const InitArg &arg)

Protected Types

enum  Flag { BLOCK_BUFFER_VALID = 0x1 << 0 , BLOCK_BUFFER_SWAP = 0x1 << 1 , BLEND_WEIGHT_VALID = 0x1 << 2 }
enum  BoundingCoord { WORLD_COORD = 0 , LOCAL_COORD = 1 , NUM_COORD }

Private Member Functions

 NW_G3D_DISALLOW_COPY_AND_ASSIGN (ShapeObj)

Private Attributes

ResShapem_pRes
bit32 m_Flag
u8 m_NumView
u8 m_ViewDependent
u8 m_NumShpBlock
u8 m_NumBuffering
GfxBufferm_pShpBlockArray
float * m_pBlendWeightArray
Spherem_pBounding
AABBm_pSubBounding
void * m_pUserPtr
void * m_pBufferPtr
void * m_pBlockBuffer

Member Enumeration Documentation

◆ Alignment

Enumerator
BUFFER_ALIGNMENT 
BLOCK_BUFFER_ALIGNMENT 

◆ Flag

enum nw::g3d::ShapeObj::Flag
protected
Enumerator
BLOCK_BUFFER_VALID 
BLOCK_BUFFER_SWAP 
BLEND_WEIGHT_VALID 

◆ BoundingCoord

Enumerator
WORLD_COORD 
LOCAL_COORD 
NUM_COORD 

Constructor & Destructor Documentation

◆ ShapeObj()

nw::g3d::ShapeObj::ShapeObj ( )
inline

Member Function Documentation

◆ CalcBufferSize()

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

◆ Init()

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

◆ CalcBlockBufferSize()

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

◆ SetupBlockBuffer()

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

◆ CleanupBlockBuffer()

void nw::g3d::ShapeObj::CleanupBlockBuffer ( )

◆ CalcBounding()

void nw::g3d::ShapeObj::CalcBounding ( const SkeletonObj * pSkeleton)

◆ CalcSubBounding()

void nw::g3d::ShapeObj::CalcSubBounding ( const SkeletonObj * pSkeleton)

◆ CalcShpBlock()

void nw::g3d::ShapeObj::CalcShpBlock ( int viewIndex,
const Mtx34 & worldMtx,
int bufferIndex = 0 )

◆ GetResource() [1/2]

ResShape * nw::g3d::ShapeObj::GetResource ( )
inline

◆ GetResource() [2/2]

const ResShape * nw::g3d::ShapeObj::GetResource ( ) const
inline

◆ GetBufferPtr()

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

◆ GetBlockBufferPtr()

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

◆ IsBlockBufferValid()

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

◆ GetMaterialIndex()

int nw::g3d::ShapeObj::GetMaterialIndex ( ) const
inline

◆ GetBoneIndex()

int nw::g3d::ShapeObj::GetBoneIndex ( ) const
inline

◆ GetVertexIndex()

int nw::g3d::ShapeObj::GetVertexIndex ( ) const
inline

◆ GetVtxSkinCount()

int nw::g3d::ShapeObj::GetVtxSkinCount ( ) const
inline

◆ IsRigidBody()

bool nw::g3d::ShapeObj::IsRigidBody ( ) const
inline

◆ IsRigidSkinning()

bool nw::g3d::ShapeObj::IsRigidSkinning ( ) const
inline

◆ IsSmoothSkinning()

bool nw::g3d::ShapeObj::IsSmoothSkinning ( ) const
inline

◆ GetResMesh() [1/2]

ResMesh * nw::g3d::ShapeObj::GetResMesh ( int meshIndex = 0)
inline

◆ GetResMesh() [2/2]

const ResMesh * nw::g3d::ShapeObj::GetResMesh ( int meshIndex = 0) const
inline

◆ GetMeshCount()

int nw::g3d::ShapeObj::GetMeshCount ( ) const
inline

◆ GetViewCount()

int nw::g3d::ShapeObj::GetViewCount ( ) const
inline

◆ GetSubMeshCount()

int nw::g3d::ShapeObj::GetSubMeshCount ( ) const
inline

◆ IsViewDependent()

bool nw::g3d::ShapeObj::IsViewDependent ( ) const
inline

◆ GetShpBlockCount()

int nw::g3d::ShapeObj::GetShpBlockCount ( ) const
inline

◆ GetShpBlock() [1/2]

GfxBuffer & nw::g3d::ShapeObj::GetShpBlock ( int viewIndex)
inline

◆ GetShpBlock() [2/2]

const GfxBuffer & nw::g3d::ShapeObj::GetShpBlock ( int viewIndex) const
inline

◆ GetBufferingCount()

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

◆ EnableBlockSwap()

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

◆ DisableBlockSwap()

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

◆ IsBlockSwapEnabled()

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

◆ SetUserPtr()

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

◆ GetUserPtr() [1/4]

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

◆ GetUserPtr() [2/4]

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

◆ GetUserPtr() [3/4]

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

◆ GetUserPtr() [4/4]

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

◆ GetResVertex() [1/2]

ResVertex * nw::g3d::ShapeObj::GetResVertex ( )
inline

◆ GetResVertex() [2/2]

const ResVertex * nw::g3d::ShapeObj::GetResVertex ( ) const
inline

◆ GetVtxAttribCount()

int nw::g3d::ShapeObj::GetVtxAttribCount ( ) const
inline

◆ GetResVtxAttrib() [1/4]

ResVtxAttrib * nw::g3d::ShapeObj::GetResVtxAttrib ( int attribIndex)
inline

◆ GetResVtxAttrib() [2/4]

const ResVtxAttrib * nw::g3d::ShapeObj::GetResVtxAttrib ( int attribIndex) const
inline

◆ GetResVtxAttrib() [3/4]

ResVtxAttrib * nw::g3d::ShapeObj::GetResVtxAttrib ( const char * name)
inline

◆ GetResVtxAttrib() [4/4]

const ResVtxAttrib * nw::g3d::ShapeObj::GetResVtxAttrib ( const char * name) const
inline

◆ GetVtxAttribName()

const char * nw::g3d::ShapeObj::GetVtxAttribName ( int attribIndex) const
inline

◆ GetVtxAttribIndex()

int nw::g3d::ShapeObj::GetVtxAttribIndex ( const char * name) const
inline

◆ GetVertexBufferCount()

int nw::g3d::ShapeObj::GetVertexBufferCount ( ) const
inline

◆ GetVertexBuffer() [1/2]

GfxBuffer & nw::g3d::ShapeObj::GetVertexBuffer ( int bufferIndex)
inline

◆ GetVertexBuffer() [2/2]

const GfxBuffer & nw::g3d::ShapeObj::GetVertexBuffer ( int bufferIndex) const
inline

◆ GetBounding() [1/2]

Sphere * nw::g3d::ShapeObj::GetBounding ( )
inline

◆ GetBounding() [2/2]

const Sphere * nw::g3d::ShapeObj::GetBounding ( ) const
inline

◆ GetSubBoundingArray()

const AABB * nw::g3d::ShapeObj::GetSubBoundingArray ( ) const
inline

◆ GetSubMeshIndexArray()

const u16 * nw::g3d::ShapeObj::GetSubMeshIndexArray ( ) const
inline

◆ TestSubMeshIntersection()

bool nw::g3d::ShapeObj::TestSubMeshIntersection ( CullingContext * pCtx,
const ViewVolume & volume ) const

◆ GetKeyShapeCount()

int nw::g3d::ShapeObj::GetKeyShapeCount ( ) const
inline

◆ GetResKeyShape() [1/4]

ResKeyShape * nw::g3d::ShapeObj::GetResKeyShape ( int keyShapeIndex)
inline

◆ GetResKeyShape() [2/4]

const ResKeyShape * nw::g3d::ShapeObj::GetResKeyShape ( int keyShapeIndex) const
inline

◆ GetResKeyShape() [3/4]

ResKeyShape * nw::g3d::ShapeObj::GetResKeyShape ( const char * name)
inline

◆ GetResKeyShape() [4/4]

const ResKeyShape * nw::g3d::ShapeObj::GetResKeyShape ( const char * name) const
inline

◆ GetKeyShapeName()

const char * nw::g3d::ShapeObj::GetKeyShapeName ( int keyShapeIndex) const
inline

◆ GetKeyShapeIndex()

int nw::g3d::ShapeObj::GetKeyShapeIndex ( const char * name) const
inline

◆ GetTargetAttribCount()

int nw::g3d::ShapeObj::GetTargetAttribCount ( ) const
inline

◆ ClearBlendWeights()

void nw::g3d::ShapeObj::ClearBlendWeights ( )

◆ NW_G3D_DEPRECATED_FUNCTION()

nw::g3d::ShapeObj::NW_G3D_DEPRECATED_FUNCTION ( bool IsBlendWeightValid() const )
inline

◆ HasValidBlendWeight()

bool nw::g3d::ShapeObj::HasValidBlendWeight ( ) const
inline

◆ SetBlendWeight()

void nw::g3d::ShapeObj::SetBlendWeight ( int keyShapeIndex,
float weight )
inline

◆ GetBlendWeight()

float nw::g3d::ShapeObj::GetBlendWeight ( int keyShapeIndex) const
inline

◆ NW_G3D_DISALLOW_COPY_AND_ASSIGN()

nw::g3d::ShapeObj::NW_G3D_DISALLOW_COPY_AND_ASSIGN ( ShapeObj )
private

Member Data Documentation

◆ m_pRes

ResShape* nw::g3d::ShapeObj::m_pRes
private

◆ m_Flag

bit32 nw::g3d::ShapeObj::m_Flag
private

◆ m_NumView

u8 nw::g3d::ShapeObj::m_NumView
private

◆ m_ViewDependent

u8 nw::g3d::ShapeObj::m_ViewDependent
private

◆ m_NumShpBlock

u8 nw::g3d::ShapeObj::m_NumShpBlock
private

◆ m_NumBuffering

u8 nw::g3d::ShapeObj::m_NumBuffering
private

◆ m_pShpBlockArray

GfxBuffer* nw::g3d::ShapeObj::m_pShpBlockArray
private

◆ m_pBlendWeightArray

float* nw::g3d::ShapeObj::m_pBlendWeightArray
private

◆ m_pBounding

Sphere* nw::g3d::ShapeObj::m_pBounding
private

◆ m_pSubBounding

AABB* nw::g3d::ShapeObj::m_pSubBounding
private

◆ m_pUserPtr

void* nw::g3d::ShapeObj::m_pUserPtr
private

◆ m_pBufferPtr

void* nw::g3d::ShapeObj::m_pBufferPtr
private

◆ m_pBlockBuffer

void* nw::g3d::ShapeObj::m_pBlockBuffer
private