Newton Dynamics  4.00
dPolygonSoupDatabase.h
1 /* Copyright (c) <2003-2019> <Julio Jerez, Newton Game Dynamics>
2 *
3 * This software is provided 'as-is', without any express or implied
4 * warranty. In no event will the authors be held liable for any damages
5 * arising from the use of this software.
6 *
7 * Permission is granted to anyone to use this software for any purpose,
8 * including commercial applications, and to alter it and redistribute it
9 * freely, subject to the following restrictions:
10 *
11 * 1. The origin of this software must not be misrepresented; you must not
12 * claim that you wrote the original software. If you use this software
13 * in a product, an acknowledgment in the product documentation would be
14 * appreciated but is not required.
15 *
16 * 2. Altered source versions must be plainly marked as such, and must not be
17 * misrepresented as being the original software.
18 *
19 * 3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 #ifndef __D_POLYGONSOUP_DATABASE_H_
23 #define __D_POLYGONSOUP_DATABASE_H_
24 
25 #include "dCoreStdafx.h"
26 #include "dTypes.h"
27 #include "dClassAlloc.h"
28 
30 {
31  public:
32  dFloat32 GetRadius() const;
33  dInt32 GetVertexCount() const;
34  dInt32 GetStrideInBytes() const;
35  dFloat32* GetLocalVertexPool() const;
36 
37  dUnsigned32 GetTagId(const dInt32* const face, dInt32 indexCount) const;
38  void SetTagId(const dInt32* const face, dInt32 indexCount, dUnsigned32 newID) const;
39 
40  protected:
41  dPolygonSoupDatabase(const char* const name = nullptr);
42  virtual ~dPolygonSoupDatabase ();
43 
44  dInt32 m_vertexCount;
45  dInt32 m_strideInBytes;
46  dFloat32* m_localVertex;
47 };
48 
49 inline dInt32 dPolygonSoupDatabase::GetVertexCount() const
50 {
51  return m_vertexCount;
52 }
53 
54 inline dFloat32* dPolygonSoupDatabase::GetLocalVertexPool() const
55 {
56  return m_localVertex;
57 }
58 
59 inline dInt32 dPolygonSoupDatabase::GetStrideInBytes() const
60 {
61  return m_strideInBytes;
62 }
63 
64 inline dFloat32 dPolygonSoupDatabase::GetRadius() const
65 {
66  return dFloat32 (0.0f);
67 }
68 
69 inline dUnsigned32 dPolygonSoupDatabase::GetTagId(const dInt32* const face, dInt32 indexCount) const
70 {
71  return dUnsigned32(face[indexCount]);
72 }
73 
74 #endif
75 
dClassAlloc
Base class for providing memory allocation for all other engine classes.
Definition: dClassAlloc.h:29
dPolygonSoupDatabase
Definition: dPolygonSoupDatabase.h:30