1 | #ifndef NX_FOUNDATION_NXDEBUGRENDERABLE
|
---|
2 | #define NX_FOUNDATION_NXDEBUGRENDERABLE
|
---|
3 | /*----------------------------------------------------------------------------*\
|
---|
4 | |
|
---|
5 | | Public Interface to NovodeX Technology
|
---|
6 | |
|
---|
7 | | www.novodex.com
|
---|
8 | |
|
---|
9 | \*----------------------------------------------------------------------------*/
|
---|
10 | /** \addtogroup foundation
|
---|
11 | @{
|
---|
12 | */
|
---|
13 |
|
---|
14 | #include "Nx.h"
|
---|
15 | #include "NxBox.h"
|
---|
16 | #include "NxBounds3.h"
|
---|
17 |
|
---|
18 | /**
|
---|
19 | \brief Default color values used for debug rendering.
|
---|
20 | */
|
---|
21 | enum NxDebugColor
|
---|
22 | {
|
---|
23 | NX_ARGB_BLACK = 0xff000000,
|
---|
24 | NX_ARGB_RED = 0xffff0000,
|
---|
25 | NX_ARGB_GREEN = 0xff00ff00,
|
---|
26 | NX_ARGB_BLUE = 0xff0000ff,
|
---|
27 | NX_ARGB_YELLOW = 0xffffff00,
|
---|
28 | NX_ARGB_MAGENTA = 0xffff00ff,
|
---|
29 | NX_ARGB_CYAN = 0xff00ffff,
|
---|
30 | NX_ARGB_WHITE = 0xffffffff,
|
---|
31 | };
|
---|
32 |
|
---|
33 | /**
|
---|
34 | \brief Used to store a single point and colour for debug rendering.
|
---|
35 | */
|
---|
36 | struct NxDebugPoint
|
---|
37 | {
|
---|
38 | NxVec3 p;
|
---|
39 | NxU32 color;
|
---|
40 | };
|
---|
41 |
|
---|
42 | /**
|
---|
43 | \brief Used to store a single line and colour for debug rendering.
|
---|
44 | */
|
---|
45 | struct NxDebugLine
|
---|
46 | {
|
---|
47 | NxVec3 p0;
|
---|
48 | NxVec3 p1;
|
---|
49 | NxU32 color;
|
---|
50 | };
|
---|
51 |
|
---|
52 | /**
|
---|
53 | \brief Used to store a single triangle and colour for debug rendering.
|
---|
54 | */
|
---|
55 | struct NxDebugTriangle
|
---|
56 | {
|
---|
57 | NxVec3 p0;
|
---|
58 | NxVec3 p1;
|
---|
59 | NxVec3 p2;
|
---|
60 | NxU32 color;
|
---|
61 | };
|
---|
62 |
|
---|
63 | /**
|
---|
64 | \brief This class references buffers with points, lines, and triangles. They represent visualizations
|
---|
65 | of SDK objects to help with debugging the user's code.
|
---|
66 |
|
---|
67 | The user should not have to instance this class.
|
---|
68 |
|
---|
69 | <h3>Example</h3>
|
---|
70 |
|
---|
71 | \include NxUserDebugRenderer_Example.cpp
|
---|
72 | */
|
---|
73 | class NxDebugRenderable
|
---|
74 | {
|
---|
75 | public:
|
---|
76 | NX_INLINE NxDebugRenderable(NxU32 np, const NxDebugPoint* p, NxU32 nl, const NxDebugLine* l, NxU32 nt, const NxDebugTriangle* t)
|
---|
77 | : numPoints(np), numLines(nl), numTriangles(nt), points(p), lines(l), triangles(t) { }
|
---|
78 |
|
---|
79 | /**
|
---|
80 | \brief Retrieve the number of points to render.
|
---|
81 | \return Point count.
|
---|
82 | */
|
---|
83 | NX_INLINE NxU32 getNbPoints() const { return numPoints; }
|
---|
84 |
|
---|
85 | /**
|
---|
86 | \brief Retrieve an array of points.
|
---|
87 | \return Array of #NxDebugPoint
|
---|
88 | */
|
---|
89 | NX_INLINE const NxDebugPoint* getPoints() const { return points; }
|
---|
90 |
|
---|
91 |
|
---|
92 |
|
---|
93 | /**
|
---|
94 | \brief Retrieve the number of lines to render.
|
---|
95 | \return Line Count.
|
---|
96 | */
|
---|
97 | NX_INLINE NxU32 getNbLines() const { return numLines; }
|
---|
98 |
|
---|
99 | /**
|
---|
100 | \brief Retrieve an array of lines to render.
|
---|
101 | \return Array of #NxDebugLine
|
---|
102 | */
|
---|
103 | NX_INLINE const NxDebugLine* getLines() const { return lines; }
|
---|
104 |
|
---|
105 | /**
|
---|
106 | \brief Retrieve the number of triangles to render.
|
---|
107 | \return Array of #NxDebugTriangle
|
---|
108 | */
|
---|
109 | NX_INLINE NxU32 getNbTriangles() const { return numTriangles; }
|
---|
110 |
|
---|
111 | /**
|
---|
112 | \brief Retrieve an array of triangles to render.
|
---|
113 | \return Array of #NxDebugTriangle
|
---|
114 | */
|
---|
115 | NX_INLINE const NxDebugTriangle* getTriangles() const { return triangles; }
|
---|
116 |
|
---|
117 | private:
|
---|
118 | NxU32 numPoints;
|
---|
119 | NxU32 numLines;
|
---|
120 | NxU32 numTriangles;
|
---|
121 |
|
---|
122 | const NxDebugPoint* points;
|
---|
123 | const NxDebugLine* lines;
|
---|
124 | const NxDebugTriangle* triangles;
|
---|
125 | };
|
---|
126 |
|
---|
127 | /** @} */
|
---|
128 | #endif
|
---|
129 |
|
---|
130 |
|
---|
131 | //AGCOPYRIGHTBEGIN
|
---|
132 | ///////////////////////////////////////////////////////////////////////////
|
---|
133 | // Copyright © 2005 AGEIA Technologies.
|
---|
134 | // All rights reserved. www.ageia.com
|
---|
135 | ///////////////////////////////////////////////////////////////////////////
|
---|
136 | //AGCOPYRIGHTEND
|
---|
137 |
|
---|