gwnavruntime/collision/indexedmesh.h Source File

indexedmesh.h
Go to the documentation of this file.
1 /*
2 * Copyright 2015 Autodesk, Inc. All rights reserved.
3 * Use of this software is subject to the terms of the Autodesk license agreement and any attachments or Appendices thereto provided at the time of installation or download,
4 * or which otherwise accompanies this software in either electronic or hard copy form, or which is signed by you and accepted by Autodesk.
5 */
6 
7 
8 #ifndef Navigation_InputMesh_H
9 #define Navigation_InputMesh_H
10 
12 
13 namespace Kaim
14 {
15 
16 class File;
17 
21 
22 class IndexedMesh : public RefCountBase<IndexedMesh, MemStat_CollisionData>
23 {
24 public:
25  IndexedMesh() : m_blob(KY_NULL) {}
26 
27  void InitFromBuilder(IndexedMeshBlobBuilder& builder);
28  void InitFromHandler(Ptr<BlobHandler<IndexedMeshBlob> > handler);
29 
30  KyUInt32 GetTriangleCount() const { return m_blob->m_indices.GetCount() / 3; }
31  KyUInt32 GetVertexCount() const { return m_blob->m_vertices.GetCount(); }
32  KyUInt32 GetIndexCount() const { return m_blob->m_indices.GetCount(); }
33 
34  KyUInt32 GetIndexAt(const KyUInt32 i) const { return m_blob->m_indices.GetValues()[i]; }
35  Vec3f GetVertexAt(const KyUInt32 i) const { return m_blob->m_vertices.GetValues()[i]; }
36 
37  const UByte* GetIndicesDataPtr() const { return m_blob->GetIndexBase(); }
38  const UByte* GetVerticesDataPtr() const { return m_blob->GetVertexBase(); }
39 
40  KyUInt32 GetIndexStride() const { return 3 * sizeof(KyUInt32); }
41  KyUInt32 GetVertexStride() const { return 3 * sizeof(KyFloat32); }
42 
43  KyResult WriteToObjFile(File* objFile) const;
44 
45  BlobHandler<IndexedMeshBlob> * GetBlobHandler() { return m_blobHandler; }
46 
47 private:
48  Ptr<BlobHandler<IndexedMeshBlob> > m_blobHandler;
49  IndexedMeshBlob* m_blob;
50 };
51 
52 }
53 
54 #endif // Navigation_InputMesh_H
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
The IndexedMesh class represents a 3D Triangle Mesh with Indexing.
Definition: indexedmesh.h:24
#define KY_NULL
Null value.
Definition: types.h:247
Definition: gamekitcrowddispersion.h:20
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43