PxRenderBuffer.h

Go to the documentation of this file.
00001 //
00002 // Redistribution and use in source and binary forms, with or without
00003 // modification, are permitted provided that the following conditions
00004 // are met:
00005 //  * Redistributions of source code must retain the above copyright
00006 //    notice, this list of conditions and the following disclaimer.
00007 //  * Redistributions in binary form must reproduce the above copyright
00008 //    notice, this list of conditions and the following disclaimer in the
00009 //    documentation and/or other materials provided with the distribution.
00010 //  * Neither the name of NVIDIA CORPORATION nor the names of its
00011 //    contributors may be used to endorse or promote products derived
00012 //    from this software without specific prior written permission.
00013 //
00014 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
00015 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017 // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00018 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 //
00026 // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_FOUNDATION_PXRENDERBUFFER_H
00032 #define PX_FOUNDATION_PXRENDERBUFFER_H
00033 
00038 #include "common/PxPhysXCommonConfig.h"
00039 #include "foundation/PxVec3.h"
00040 #include "foundation/PxMat33.h"
00041 #include "foundation/PxBounds3.h"
00042 
00043 #if !PX_DOXYGEN
00044 namespace physx
00045 {
00046 #endif
00047 
00051 struct PxDebugColor
00052 {
00053     enum Enum
00054     {
00055         eARGB_BLACK     = 0xff000000,
00056         eARGB_RED       = 0xffff0000,
00057         eARGB_GREEN     = 0xff00ff00,
00058         eARGB_BLUE      = 0xff0000ff,
00059         eARGB_YELLOW    = 0xffffff00,
00060         eARGB_MAGENTA   = 0xffff00ff,
00061         eARGB_CYAN      = 0xff00ffff,
00062         eARGB_WHITE     = 0xffffffff,
00063         eARGB_GREY      = 0xff808080,
00064         eARGB_DARKRED   = 0x88880000,
00065         eARGB_DARKGREEN = 0x88008800,
00066         eARGB_DARKBLUE  = 0x88000088
00067     };
00068 };
00069 
00073 struct PxDebugPoint
00074 {
00075     PxDebugPoint(const PxVec3& p, const PxU32& c)
00076         : pos(p), color(c) {}
00077 
00078     PxVec3  pos;
00079     PxU32   color;
00080 };
00081 
00085 struct PxDebugLine
00086 {
00087     PxDebugLine(const PxVec3& p0, const PxVec3& p1, const PxU32& c)
00088         : pos0(p0), color0(c), pos1(p1), color1(c) {}
00089 
00090     PxVec3  pos0;
00091     PxU32   color0;
00092     PxVec3  pos1;
00093     PxU32   color1;
00094 };
00095 
00099 struct PxDebugTriangle
00100 {
00101     PxDebugTriangle(const PxVec3& p0, const PxVec3& p1, const PxVec3& p2, const PxU32& c)
00102         : pos0(p0), color0(c), pos1(p1), color1(c), pos2(p2), color2(c) {}
00103 
00104     PxVec3  pos0;
00105     PxU32   color0;
00106     PxVec3  pos1;
00107     PxU32   color1;
00108     PxVec3  pos2;
00109     PxU32   color2;
00110 };
00111 
00115 struct PxDebugText
00116 {
00117     PxDebugText() : string(0) {}
00118 
00119     PxDebugText(const PxVec3& p, const PxReal& s, const PxU32& c, const char* str)
00120         : position(p), size(s), color(c), string(str) {}
00121 
00122     PxVec3      position;
00123     PxReal      size;
00124     PxU32       color;
00125     const char* string;
00126 };
00127 
00131 class PxRenderBuffer
00132 {
00133 public:
00134     virtual ~PxRenderBuffer() {}
00135 
00136     virtual PxU32 getNbPoints() const = 0;
00137     virtual const PxDebugPoint* getPoints() const = 0;
00138 
00139     virtual PxU32 getNbLines() const = 0;
00140     virtual const PxDebugLine* getLines() const = 0;
00141 
00142     virtual PxU32 getNbTriangles() const = 0;
00143     virtual const PxDebugTriangle* getTriangles() const = 0;
00144 
00145     virtual PxU32 getNbTexts() const = 0;
00146     virtual const PxDebugText* getTexts() const = 0;
00147 
00148     virtual void append(const PxRenderBuffer& other) = 0;
00149     virtual void clear() = 0;
00150 };
00151 
00152 #if !PX_DOXYGEN
00153 } // namespace physx
00154 #endif
00155 
00157 #endif


Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com