Newton Dynamics  4.00
ndPolygonSoupDatabase.h
1 /* Copyright (c) <2003-2022> <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 __ND_POLYGONSOUP_DATABASE_H_
23 #define __ND_POLYGONSOUP_DATABASE_H_
24 
25 #include "ndCoreStdafx.h"
26 #include "ndTypes.h"
27 #include "ndClassAlloc.h"
28 
30 {
31  public:
32  ndFloat32 GetRadius() const;
33  ndInt32 GetVertexCount() const;
34  ndInt32 GetStrideInBytes() const;
35  ndFloat32* GetLocalVertexPool() const;
36 
37  ndUnsigned32 GetTagId(const ndInt32* const face, ndInt32 indexCount) const;
38  void SetTagId(const ndInt32* const face, ndInt32 indexCount, ndUnsigned32 newID) const;
39 
40  protected:
41  ndPolygonSoupDatabase(const char* const name = nullptr);
42  virtual ~ndPolygonSoupDatabase ();
43 
44  ndInt32 m_vertexCount;
45  ndInt32 m_strideInBytes;
46  ndFloat32* m_localVertex;
47 };
48 
49 inline ndInt32 ndPolygonSoupDatabase::GetVertexCount() const
50 {
51  return m_vertexCount;
52 }
53 
54 inline ndFloat32* ndPolygonSoupDatabase::GetLocalVertexPool() const
55 {
56  return m_localVertex;
57 }
58 
59 inline ndInt32 ndPolygonSoupDatabase::GetStrideInBytes() const
60 {
61  return m_strideInBytes;
62 }
63 
64 inline ndFloat32 ndPolygonSoupDatabase::GetRadius() const
65 {
66  return ndFloat32 (0.0f);
67 }
68 
69 inline ndUnsigned32 ndPolygonSoupDatabase::GetTagId(const ndInt32* const face, ndInt32 indexCount) const
70 {
71  return ndUnsigned32(face[indexCount]);
72 }
73 
74 #endif
75 
ndClassAlloc
Base class for providing memory allocation for all other engine classes.
Definition: ndClassAlloc.h:30
ndPolygonSoupDatabase
Definition: ndPolygonSoupDatabase.h:30