gwnavruntime/collision/collisiondataindex.h Source File

collisiondataindex.h
Go to the documentation of this file.
1 /*
2 * Copyright 2016 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 #pragma once
9 
15 
16 namespace Kaim
17 {
18 
19 class FileOpenerBase;
20 
21 class ColDataDescriptor
22 {
23  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
24  KY_CLASS_WITHOUT_COPY(ColDataDescriptor)
25 public:
26  ColDataDescriptor() {}
27  const char* GetFileName() const { return m_fileName.GetValues(); }
28 
29  BlobArray<char> m_fileName;
30  KyGuid m_guid;
31  Box2f m_boundingBox;
32 };
33 inline void SwapEndianness(Endianness::Target e, ColDataDescriptor& self)
34 {
35  SwapEndianness(e, self.m_fileName);
36  SwapEndianness(e, self.m_guid);
37  SwapEndianness(e, self.m_boundingBox);
38 }
39 
40 
41 class ColDataIndex
42 {
43  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
44  KY_ROOT_BLOB_CLASS(CollisionData, ColDataIndex, 0)
45  KY_CLASS_WITHOUT_COPY(ColDataIndex)
46 public:
47  ColDataIndex() {}
48  KyUInt32 GetDescriptorsCount() const { return m_descriptors.GetCount(); }
49  const ColDataDescriptor& GetDescriptor(KyUInt32 index) const { return m_descriptors.GetValues()[index]; }
50  BlobArray<ColDataDescriptor> m_descriptors;
51 };
52 
53 inline void SwapEndianness(Endianness::Target e, ColDataIndex& self)
54 {
55  SwapEndianness(e, self.m_descriptors);
56 }
57 
58 class ColDataIndexLoader
59 {
60  KY_DEFINE_NEW_DELETE_OPERATORS(MemStat_CollisionData)
61 
62 public:
63  static Ptr< BlobHandler<ColDataIndex> > LoadColDataIndex(const char* filename, FileOpenerBase* fileOpener = nullptr);
64 };
65 
66 
67 } // namespace Kaim
68 
std::uint32_t KyUInt32
uint32_t
Definition: types.h:29
#define KY_CLASS_WITHOUT_COPY(ClassName)
Define to forbid copy constructor and copy assignment.
Definition: types.h:196
#define KY_DEFINE_NEW_DELETE_OPERATORS(MemStat)
This macro defines new and delete operators.
Definition: memory.h:132
Target
Enumerates the possible endianness types relative to the current platform.
Definition: endianness.h:27
The Autodesk Navigation namespace.
Definition: gamekitcrowddispersion.cpp:17