1#ifndef NW_G3D_RES_RESSHAPE_H_
2#define NW_G3D_RES_RESSHAPE_H_
4#include <nw/g3d/g3d_config.h>
5#include <nw/g3d/math/g3d_Vector3.h>
6#include <nw/g3d/fnd/g3d_GfxObject.h>
7#include <nw/g3d/res/g3d_ResCommon.h>
8#include <nw/g3d/res/g3d_ResDictionary.h>
10namespace nw {
namespace g3d {
namespace res {
30 return GfxBuffer::DownCast(&ref().gfxBuffer);
35 return GfxBuffer::DownCast(&ref().gfxBuffer);
40 void*
GetData() {
return ref().ofsData.to_ptr(); }
42 const void*
GetData()
const {
return ref().ofsData.to_ptr(); }
99 int GetIndex()
const {
return static_cast<
int>(ref().index); }
111 template <
typename T>
114 template <
typename T>
156 void Draw(
int instances = 1)
const
161 void DrawSubMesh(
int submeshIndex,
int submeshCount,
int instances = 1)
const;
186 return ref().targetAttribIndex[attribIndex];
282 template <
typename T>
285 template <
typename T>
304 return ref().ofsBoundingNodeArray.to_ptr<
BoundingNode>();
311 return *(ref().ofsSubBoundingArray.to_ptr<
Bounding>());
316 return ref().ofsSubMeshIndexArray.to_ptr<u16>();
Definition g3d_GfxObject.h:48
Definition g3d_Vector3.h:30
Definition g3d_ResCommon.h:109
BinPtr & set_ptr(void *ptr)
Definition g3d_ResCommon.h:143
const void * to_ptr() const
Definition g3d_ResCommon.h:121
void * to_ptr()
Definition g3d_ResCommon.h:119
Definition g3d_ResCommon.h:93
Definition g3d_ResCommon.h:62
Definition g3d_ResShape.h:21
size_t GetSize() const
Definition g3d_ResShape.h:38
void Cleanup()
Definition g3d_ResShape.cpp:15
GfxBuffer * GetGfxBuffer()
Definition g3d_ResShape.h:28
void * GetData()
Definition g3d_ResShape.h:40
const GfxBuffer * GetGfxBuffer() const
Definition g3d_ResShape.h:33
void Setup()
Definition g3d_ResShape.cpp:7
const void * GetData() const
Definition g3d_ResShape.h:42
Definition g3d_ResFile.h:62
Definition g3d_ResShape.h:180
int GetTargetAttribIndex(int attribIndex) const
Definition g3d_ResShape.h:184
Definition g3d_ResShape.h:152
GX2IndexFormat GetIndexFormat() const
Definition g3d_ResShape.h:165
u32 GetCount() const
Definition g3d_ResShape.h:167
void Draw(int instances=1) const
Definition g3d_ResShape.h:156
GX2PrimitiveType GetPrimitiveType() const
Definition g3d_ResShape.h:163
void DrawSubMesh(int submeshIndex, int submeshCount, int instances=1) const
Definition g3d_ResShape.cpp:57
Definition g3d_ResShape.h:237
bool IsVertexOwner() const
Definition g3d_ResShape.h:262
bool IsSmoothSkinning() const
Definition g3d_ResShape.h:274
const BoundingNode * GetBoundingNodeArray() const
Definition g3d_ResShape.h:302
Flag
Definition g3d_ResShape.h:244
@ OWN_VERTEX
Definition g3d_ResShape.h:245
Signature
Definition g3d_ResShape.h:241
@ SIGNATURE
Definition g3d_ResShape.h:241
void * GetUserPtr()
Definition g3d_ResShape.h:278
const void * GetUserPtr() const
Definition g3d_ResShape.h:280
void SetUserPtr(void *pUserPtr)
Definition g3d_ResShape.h:276
const u16 * GetSubMeshIndexArray() const
Definition g3d_ResShape.h:314
float GetRadius() const
Definition g3d_ResShape.h:319
int GetSkinBoneIndexCount() const
Definition g3d_ResShape.h:264
const T * GetUserPtr() const
Definition g3d_ResShape.h:286
int GetIndex() const
Definition g3d_ResShape.h:252
const u16 * GetSkinBoneIndexArray() const
Definition g3d_ResShape.h:266
int GetMaterialIndex() const
Definition g3d_ResShape.h:256
void Cleanup()
Definition g3d_ResShape.cpp:48
bool IsRigidBody() const
Definition g3d_ResShape.h:270
int GetSubMeshCount() const
Definition g3d_ResShape.h:296
int GetTargetAttribCount() const
Definition g3d_ResShape.h:300
int GetBoundingNodeCount() const
Definition g3d_ResShape.h:307
int GetBoneIndex() const
Definition g3d_ResShape.h:258
const ResMesh * GetMesh() const
Definition g3d_ResShape.h:294
const Bounding & GetBounding() const
Definition g3d_ResShape.h:309
bool IsRigidSkinning() const
Definition g3d_ResShape.h:272
int GetVertexIndex() const
Definition g3d_ResShape.h:260
ResMesh * GetMesh()
Definition g3d_ResShape.h:292
int GetVtxSkinCount() const
Definition g3d_ResShape.h:268
void Setup()
Definition g3d_ResShape.cpp:38
T * GetUserPtr()
Definition g3d_ResShape.h:283
Definition g3d_ResShape.h:129
u32 GetCount() const
Definition g3d_ResShape.h:135
u32 GetOffset() const
Definition g3d_ResShape.h:133
Definition g3d_ResShape.h:89
T * GetUserPtr()
Definition g3d_ResShape.h:112
const void * GetUserPtr() const
Definition g3d_ResShape.h:109
u32 GetCount() const
Definition g3d_ResShape.h:101
void * GetUserPtr()
Definition g3d_ResShape.h:107
Signature
Definition g3d_ResShape.h:93
@ SIGNATURE
Definition g3d_ResShape.h:93
void SetUserPtr(void *pUserPtr)
Definition g3d_ResShape.h:105
const T * GetUserPtr() const
Definition g3d_ResShape.h:115
int GetIndex() const
Definition g3d_ResShape.h:99
void Cleanup()
Definition g3d_ResShape.cpp:30
void Setup()
Definition g3d_ResShape.cpp:22
int GetVtxSkinCount() const
Definition g3d_ResShape.h:103
Definition g3d_ResShape.h:57
u32 GetOffset() const
Definition g3d_ResShape.h:67
GX2AttribFormat GetFormat() const
Definition g3d_ResShape.h:65
int GetBufferIndex() const
Definition g3d_ResShape.h:63
#define NW_G3D_RES_COMMON(class_name)
Definition g3d_ResCommon.h:30
#define NW_G3D_RES_FIELD_CLASS_NAMED_ARRAY_DECL(type, name)
Definition g3d_ResDefs.h:108
#define NW_G3D_RES_FIELD_CLASS_ARRAY_DECL(type, name)
Definition g3d_ResDefs.h:92
#define NW_G3D_RES_FIELD_CLASS_DECL(type, name)
Definition g3d_ResDefs.h:124
#define NW_G3D_RES_FIELD_STRING_DECL(name)
Definition g3d_ResDefs.h:137
#define NW_G3D_RES_FIELD_DIC_DECL(type, name)
Definition g3d_ResDefs.h:51
u32 bit32
Definition g3d_defs.h:131
#define NW_G3D_MAKE_U8X4_AS_U32(a, b, c, d)
Definition g3d_defs.h:90
Definition g3d_defs.h:122
Definition g3d_GfxManage.cpp:10
Definition g3d_GfxObject.h:25
Definition g3d_ResShape.h:191
u16 idxNext
Definition g3d_ResShape.h:195
u16 numSubMesh
Definition g3d_ResShape.h:197
u16 idxSubMesh
Definition g3d_ResShape.h:196
u16 idxLeft
Definition g3d_ResShape.h:192
u16 idxRight
Definition g3d_ResShape.h:193
u16 idxPrev
Definition g3d_ResShape.h:194
Definition g3d_ResShape.h:201
Vec3 extent
Definition g3d_ResShape.h:203
Vec3 center
Definition g3d_ResShape.h:202
Definition g3d_ResShape.h:15
GfxBuffer_t gfxBuffer
Definition g3d_ResShape.h:16
Offset ofsData
Definition g3d_ResShape.h:17
Definition g3d_ResShape.h:175
u8 targetAttribIndex[4]
Definition g3d_ResShape.h:176
Definition g3d_ResShape.h:139
GX2IndexFormat format
Definition g3d_ResShape.h:141
Offset ofsIdxBuffer
Definition g3d_ResShape.h:147
Offset ofsSubMeshArray
Definition g3d_ResShape.h:146
u16 reserved
Definition g3d_ResShape.h:145
GX2PrimitiveType primType
Definition g3d_ResShape.h:140
u16 numSubMesh
Definition g3d_ResShape.h:144
u32 offset
Definition g3d_ResShape.h:148
u32 count
Definition g3d_ResShape.h:142
Definition g3d_ResShape.h:207
Offset ofsKeyShapeDic
Definition g3d_ResShape.h:228
u16 boneIndex
Definition g3d_ResShape.h:215
BinPtr pUserPtr
Definition g3d_ResShape.h:233
bit32 flag
Definition g3d_ResShape.h:212
Offset ofsSkinBoneIndexArray
Definition g3d_ResShape.h:227
BinString ofsName
Definition g3d_ResShape.h:210
Offset ofsBoundingNodeArray
Definition g3d_ResShape.h:229
BinaryBlockHeader blockHeader
Definition g3d_ResShape.h:208
u16 materialIndex
Definition g3d_ResShape.h:214
f32 radius
Definition g3d_ResShape.h:223
Offset ofsVertex
Definition g3d_ResShape.h:225
u16 numSkinBoneIndex
Definition g3d_ResShape.h:217
Offset ofsMeshArray
Definition g3d_ResShape.h:226
u8 numMesh
Definition g3d_ResShape.h:219
u16 vertexIndex
Definition g3d_ResShape.h:216
u8 numKeyShape
Definition g3d_ResShape.h:220
u8 vtxSkinCount
Definition g3d_ResShape.h:218
Offset ofsSubMeshIndexArray
Definition g3d_ResShape.h:231
u16 index
Definition g3d_ResShape.h:213
Offset ofsSubBoundingArray
Definition g3d_ResShape.h:230
u16 numBoundingNode
Definition g3d_ResShape.h:222
u8 numTargetAttrib
Definition g3d_ResShape.h:221
Definition g3d_ResShape.h:123
u32 offset
Definition g3d_ResShape.h:124
u32 count
Definition g3d_ResShape.h:125
Definition g3d_ResShape.h:71
u8 reserved[3]
Definition g3d_ResShape.h:79
u8 numVtxAttrib
Definition g3d_ResShape.h:74
BinPtr pUserPtr
Definition g3d_ResShape.h:85
Offset ofsVtxAttribDic
Definition g3d_ResShape.h:82
u16 index
Definition g3d_ResShape.h:76
Offset ofsVtxBufferArray
Definition g3d_ResShape.h:83
u8 numVtxBuffer
Definition g3d_ResShape.h:75
u8 vtxSkinCount
Definition g3d_ResShape.h:78
u32 count
Definition g3d_ResShape.h:77
BinaryBlockHeader blockHeader
Definition g3d_ResShape.h:72
Offset ofsVtxAttribArray
Definition g3d_ResShape.h:81
Definition g3d_ResShape.h:46
u8 reserved
Definition g3d_ResShape.h:50
BinString ofsName
Definition g3d_ResShape.h:47
u8 bufferIndex
Definition g3d_ResShape.h:49
GX2AttribFormat format
Definition g3d_ResShape.h:53
u16 offset
Definition g3d_ResShape.h:51