My Project
|
for drawing special element object(like particles, lines, etc) in the scene. More...
#include <BatchedElementDraw.h>
Classes | |
struct | BatchedThickLines |
Public Member Functions | |
IParaDebugDraw * | GetDebugDrawInterface () |
deprecated: interface | |
virtual void | DrawLine (const PARAVECTOR3 &from, const PARAVECTOR3 &to, const PARAVECTOR3 &color) |
draw a line with a given color. More... | |
virtual void | DrawPredefinedLines (const PARAVECTOR3 *lines, int nLineCount, const PARAVECTOR3 &color) |
draw multiple lines with a given color using the predefined index order. More... | |
virtual void | DrawContactPoint (const PARAVECTOR3 &PointOnB, const PARAVECTOR3 &normalOnB, float distance, int lifeTime, const PARAVECTOR3 &color) |
draw a contact point with a given color. More... | |
virtual void | ReportErrorWarning (const char *warningString) |
draw a contact point with a given color. More... | |
virtual void | Draw3dText (const PARAVECTOR3 &location, const char *textString) |
draw a text with a given color. More... | |
virtual void | SetRenderOffset (const PARAVECTOR3 &vOffset) |
set a render offset. More... | |
virtual PARAVECTOR3 | GetRenderOffset () |
get current render offset. More... | |
virtual void | SetDebugDrawMode (int debugMode) |
bitwise fields of IParaDebugDraw::DebugDrawModes | |
virtual int | GetDebugDrawMode () |
bitwise fields of PhysicsDebugDrawModes | |
virtual void | SetDefaultColor (const PARAVECTOR3 &color) |
get the current draw color. More... | |
virtual PARAVECTOR3 | GetDefaultColor () |
set the current draw color. More... | |
virtual void | AddThickLine (const PARAVECTOR3 &from, const PARAVECTOR3 &to, const PARAVECTOR4 &color, float fThickness=0.f, float DepthBias=0.f) |
draw line with thickness | |
virtual void | AddThickLines (const PARAVECTOR3 *points, int nPointCount, const PARAVECTOR4 &color, float fThickness=0.f, float DepthBias=0.f) |
nPointCount-1 lines segment is drawn | |
virtual void | AddParticle (CParticleElement *particle) |
add a particle. More... | |
void | ClearParticles () |
void | ClearAll () |
call this before scene is reset. More... | |
void | ClearLines () |
clear all cached drawing. More... | |
void | DrawAll (bool bClear=true) |
void | DrawBatchedLines (bool bClear=true) |
draw all cached line primitives since last Clear() call. More... | |
void | DrawBatchedThickLines (bool bClear=true) |
void | DrawBatchedParticles (bool bClear=true) |
int | GetLineCount () |
get the total number of line primitives in the cached render list. More... | |
bool | IsEmpty () |
Protected Member Functions | |
void | SortParticles () |
sort particle into render passes according to texture. More... | |
Protected Attributes | |
Vector3 | m_vOffset |
int | m_nDrawMode |
PARAVECTOR3 | m_vDefaultColor |
std::vector< LINEVERTEX > | m_lines_vertex_array |
std::vector< int16 > | m_lines_index_array |
int | m_nLineCount |
std::vector< BatchedThickLines > | m_listThickLines |
unordered_ref_array< CParticleElement * > | m_listParticles |
std::vector< ParticleRenderPass > | m_ParticleRenderPasses |
Static Protected Attributes | |
static std::vector< char > | s_VertexData |
tessellation vertex buffer data | |
Additional Inherited Members | |
![]() | |
enum | BatchDrawModes { BDM_NoDebug =0, BDM_DrawWireframe = 1, BDM_DrawAabb =2, BDM_DrawFeaturesText =4, BDM_DrawContactPoints =8, BDM_NoDeactivation =16, BDM_NoHelpText = 32, BDM_DrawText =64, BDM_ProfileTimings = 128, BDM_EnableSatComparison = 256, BDM_DisableBulletLCP = 512, BDM_EnableCCD = 1024, BDM_DrawConstraints = (1 << 11), BDM_DrawConstraintLimits = (1 << 12), BDM_FastWireframe = (1<<13), BDM_MAX_DRAW_MODE } |
![]() | |
enum | DebugDrawModes { DDM_NoDebug =0, DDM_DrawWireframe = 1, DDM_DrawAabb =2, DDM_DrawFeaturesText =4, DDM_DrawContactPoints =8, DDM_NoDeactivation =16, DDM_NoHelpText = 32, DDM_DrawText =64, DDM_ProfileTimings = 128, DDM_EnableSatComparison = 256, DDM_DisableBulletLCP = 512, DDM_EnableCCD = 1024, DDM_DrawConstraints = (1 << 11), DDM_DrawConstraintLimits = (1 << 12), DDM_FastWireframe = (1<<13), DDM_MAX_DEBUG_DRAW_MODE } |
for drawing special element object(like particles, lines, etc) in the scene.
this is usually a singleton associated with a scene object. And is always rendered after 3d scene is rendered but before GUI object.
|
virtual |
add a particle.
although we will sort by texture in a special way, for better performance, it is recommended that particles with same textures are added in sequence or close to one another.
particle | the pointer must be valid until the end of the frame. |
Implements ParaEngine::IBatchedElementDraw.
void ParaEngine::CBatchedElementDraw::ClearAll | ( | ) |
call this before scene is reset.
void ParaEngine::CBatchedElementDraw::ClearLines | ( | ) |
clear all cached drawing.
|
virtual |
draw a text with a given color.
Implements ParaEngine::IBatchedElementDraw.
void ParaEngine::CBatchedElementDraw::DrawBatchedLines | ( | bool | bClear = true | ) |
draw all cached line primitives since last Clear() call.
bClear | if true(default), it will clear the render list after draw. |
|
virtual |
draw a contact point with a given color.
Implements ParaEngine::IBatchedElementDraw.
|
virtual |
draw a line with a given color.
Implements ParaEngine::IBatchedElementDraw.
|
virtual |
draw multiple lines with a given color using the predefined index order.
it can be used to render a quad(4 lines) or box(12 lines). 0,1,1,2,2,3,3,0, // bottom 4,5,5,6,6,7,7,4, // top 0,4,1,5,2,6,3,7, // sides
lines | vertex arrays |
nLineCount | it can be 4 or 12. the index order is given above. |
color | color to draw the line. |
Implements ParaEngine::IBatchedElementDraw.
|
inlinevirtual |
set the current draw color.
some object may reply on this value when drawing the primitives.
Implements ParaEngine::IBatchedElementDraw.
int ParaEngine::CBatchedElementDraw::GetLineCount | ( | ) |
get the total number of line primitives in the cached render list.
|
inlinevirtual |
get current render offset.
It only takes effect when calling one of the above Draw functions.
Implements ParaEngine::IBatchedElementDraw.
|
virtual |
draw a contact point with a given color.
Implements ParaEngine::IBatchedElementDraw.
|
inlinevirtual |
get the current draw color.
some object may reply on this value when drawing the primitives.
Implements ParaEngine::IBatchedElementDraw.
|
virtual |
set a render offset.
Implements ParaEngine::IBatchedElementDraw.
|
protected |
sort particle into render passes according to texture.