RavEngine
Loading...
Searching...
No Matches
PxRenderBuffer.h
1// Redistribution and use in source and binary forms, with or without
2// modification, are permitted provided that the following conditions
3// are met:
4// * Redistributions of source code must retain the above copyright
5// notice, this list of conditions and the following disclaimer.
6// * Redistributions in binary form must reproduce the above copyright
7// notice, this list of conditions and the following disclaimer in the
8// documentation and/or other materials provided with the distribution.
9// * Neither the name of NVIDIA CORPORATION nor the names of its
10// contributors may be used to endorse or promote products derived
11// from this software without specific prior written permission.
12//
13// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
14// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
17// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21// OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24//
25// Copyright (c) 2008-2022 NVIDIA Corporation. All rights reserved.
26// Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
27// Copyright (c) 2001-2004 NovodeX AG. All rights reserved.
28
29#ifndef PX_RENDER_BUFFER_H
30#define PX_RENDER_BUFFER_H
31
36#include "common/PxPhysXCommonConfig.h"
37#include "foundation/PxVec3.h"
38#include "foundation/PxMat33.h"
39#include "foundation/PxBounds3.h"
40
41#if !PX_DOXYGEN
42namespace physx
43{
44#endif
45
50{
51 enum Enum
52 {
53 eARGB_BLACK = 0xff000000,
54 eARGB_RED = 0xffff0000,
55 eARGB_GREEN = 0xff00ff00,
56 eARGB_BLUE = 0xff0000ff,
57 eARGB_YELLOW = 0xffffff00,
58 eARGB_MAGENTA = 0xffff00ff,
59 eARGB_CYAN = 0xff00ffff,
60 eARGB_WHITE = 0xffffffff,
61 eARGB_GREY = 0xff808080,
62 eARGB_DARKRED = 0xff880000,
63 eARGB_DARKGREEN = 0xff008800,
64 eARGB_DARKBLUE = 0xff000088
65 };
66};
67
68
73{
74 PxDebugPoint(const PxVec3& p, const PxU32& c)
75 : pos(p), color(c) {}
76
77 PxVec3 pos;
78 PxU32 color;
79};
80
85{
86 PxDebugLine(const PxVec3& p0, const PxVec3& p1, const PxU32& c)
87 : pos0(p0), color0(c), pos1(p1), color1(c) {}
88
89 PxVec3 pos0;
90 PxU32 color0;
91 PxVec3 pos1;
92 PxU32 color1;
93};
94
99{
100 PxDebugTriangle(const PxVec3& p0, const PxVec3& p1, const PxVec3& p2, const PxU32& c)
101 : pos0(p0), color0(c), pos1(p1), color1(c), pos2(p2), color2(c) {}
102
103 PxVec3 pos0;
104 PxU32 color0;
105 PxVec3 pos1;
106 PxU32 color1;
107 PxVec3 pos2;
108 PxU32 color2;
109};
110
115{
116 PxDebugText() : string(0)
117 {
118 }
119
120 PxDebugText(const PxVec3& pos, const PxReal& sz, const PxU32& clr, const char* str)
121 : position(pos), size(sz), color(clr), string(str)
122 {
123 }
124
125 PxVec3 position;
126 PxReal size;
127 PxU32 color;
128 const char* string;
129};
130
131
136{
137public:
138 virtual ~PxRenderBuffer() {}
139
140 virtual PxU32 getNbPoints() const = 0;
141 virtual const PxDebugPoint* getPoints() const = 0;
142 virtual void addPoint(const PxDebugPoint& point) = 0;
143
144 virtual PxU32 getNbLines() const = 0;
145 virtual const PxDebugLine* getLines() const = 0;
146 virtual void addLine(const PxDebugLine& line) = 0;
147 virtual PxDebugLine* reserveLines(const PxU32 nbLines) = 0;
148 virtual PxDebugPoint* reservePoints(const PxU32 nbLines) = 0;
149
150 virtual PxU32 getNbTriangles() const = 0;
151 virtual const PxDebugTriangle* getTriangles() const = 0;
152 virtual void addTriangle(const PxDebugTriangle& triangle) = 0;
153
154 virtual void append(const PxRenderBuffer& other) = 0;
155 virtual void clear() = 0;
156
157 virtual void shift(const PxVec3& delta) = 0;
158
159 virtual bool empty() const = 0;
160};
161
162#if !PX_DOXYGEN
163} // namespace physx
164#endif
165
167#endif
Interface for points, lines, triangles, and text buffer.
Definition PxRenderBuffer.h:136
3 Element vector class.
Definition PxVec3.h:50
Sorts an array of objects in ascending order, assuming that the predicate implements the < operator:
Definition PxBoxController.h:39
Default color values used for debug rendering.
Definition PxRenderBuffer.h:50
Used to store a single line and colour for debug rendering.
Definition PxRenderBuffer.h:85
Used to store a single point and colour for debug rendering.
Definition PxRenderBuffer.h:73
Used to store a text for debug rendering. Doesn't own 'string' array.
Definition PxRenderBuffer.h:115
Used to store a single triangle and colour for debug rendering.
Definition PxRenderBuffer.h:99