IRenderAuxGeom

#include

Public Member Functions

virtual SAuxGeomRenderFlags SetRenderFlags (const SAuxGeomRenderFlags &renderFlags)=0
virtual SAuxGeomRenderFlags GetRenderFlags ()=0
Gets render flags.
virtual const CCamera & GetCamera () const =0
Assign current rendering camera to the Aux renderer, used for correctly projecting 3D elements.
virtual void SetCurrentDisplayContext (CryDisplayContextHandle context)=0
Set current display context for the following auxiliary rendering.
virtual void DrawPoint (const Vec3 &v, const ColorB &col, uint8 size=1)=0
virtual void DrawLine (const Vec3 &v0, const ColorB &colV0, const Vec3 &v1, const ColorB &colV1, float thickness=1.0f)=0
virtual void DrawTriangle (const Vec3 &v0, const ColorB &colV0, const Vec3 &v1, const ColorB &colV1, const Vec3 &v2, const ColorB &colV2)=0
virtual void DrawSphere (const Vec3 &pos, float radius, const ColorB &col, bool drawShaded=true)=0
virtual void DrawCone (const Vec3 &pos, const Vec3 &dir, float radius, float height, const ColorB &col, bool drawShaded=true)=0
virtual void DrawCylinder (const Vec3 &pos, const Vec3 &dir, float radius, float height, const ColorB &col, bool drawShaded=true)=0
virtual void DrawBone (const Vec3 &rParent, const Vec3 &rBone, ColorB col)=0
Draw a bone.
virtual int PushMatrix (const Matrix34 &mat)=0
virtual void PushImage (const SRender2DImageDescription &image)=0
virtual int SetTexture (int idTexture)
virtual Matrix34 * GetMatrix ()=0
virtual void SetMatrixIndex (int matID)=0
virtual void Submit (uint frames=0)=0
virtual void SetOrthographicProjection (bool enable, float l=0, float r=1, float b=0, float t=1, float n=-1e10, float f=1e10)=0
Create and set the projection matrix to orthographic projection. The orthographics projection will be used until it is set to off.
virtual void DrawPoints (const Vec3 *v, uint32 numPoints, const ColorB &col, uint8 size=1)=0
virtual void DrawPoints (const Vec3 *v, uint32 numPoints, const ColorB *col, uint8 size=1)=0
virtual void DrawLines (const Vec3 *v, uint32 numPoints, const ColorB &col, float thickness=1.0f)=0
virtual void DrawLines (const Vec3 *v, uint32 numPoints, const ColorB *col, float thickness=1.0f)=0
virtual void DrawLines (const Vec3 *v, const uint32 *packedColorARGB8888, uint32 numPoints, float thickness=1.0f, bool alphaFlag=true)=0
virtual void DrawLines (const Vec3 *v, uint32 numPoints, const vtx_idx *ind, uint32 numIndices, const ColorB &col, float thickness=1.0f)=0
virtual void DrawLines (const Vec3 *v, uint32 numPoints, const vtx_idx *ind, uint32 numIndices, const ColorB *col, float thickness=1.0f)=0
virtual void DrawLineStrip (const Vec3 *v, uint32 numPoints, const ColorB *col, float thickness=1.0f)=0
virtual void DrawPolyline (const Vec3 *v, uint32 numPoints, bool closed, const ColorB &col, float thickness=1.0f)=0
virtual void DrawPolyline (const Vec3 *v, uint32 numPoints, bool closed, const ColorB *col, float thickness=1.0f)=0
virtual void DrawTriangles (const Vec3 *v, uint32 numPoints, const ColorB &col)=0
virtual void DrawTriangles (const Vec3 *v, uint32 numPoints, const ColorB *col)=0
virtual void DrawTriangles (const Vec3 *v, uint32 numPoints, const vtx_idx *ind, uint32 numIndices, const ColorB &col)=0
virtual void DrawTriangles (const Vec3 *v, uint32 numPoints, const vtx_idx *ind, uint32 numIndices, const ColorB *col)=0
virtual void DrawBuffer (const SAuxVertex *inVertices, uint32 numVertices, bool textured)=0
virtual SAuxVertex * BeginDrawBuffer (uint32 maxVertices, bool textured)=0
virtual void EndDrawBuffer (uint32 numVertices)=0
virtual void DrawAABB (const AABB &aabb, bool bSolid, const ColorB &col, const EBoundingBoxDrawStyle &bbDrawStyle)=0
virtual void DrawAABBs (const AABB *aabbs, uint32 aabbCount, bool bSolid, const ColorB &col, const EBoundingBoxDrawStyle &bbDrawStyle)=0
virtual void DrawAABB (const AABB &aabb, const Matrix34 &matWorld, bool bSolid, const ColorB &col, const EBoundingBoxDrawStyle &bbDrawStyle)=0
virtual void DrawOBB (const OBB &obb, const Vec3 &pos, bool bSolid, const ColorB &col, const EBoundingBoxDrawStyle &bbDrawStyle)=0
virtual void DrawOBB (const OBB &obb, const Matrix34 &matWorld, bool bSolid, const ColorB &col, const EBoundingBoxDrawStyle &bbDrawStyle)=0
virtual void RenderTextQueued (Vec3 pos, const SDrawTextInfo &ti, const char *text)=0
void DrawQuad (const Vec3 &v0, const ColorB &colV0, const Vec3 &v1, const ColorB &colV1, const Vec3 &v2, const ColorB &colV2, const Vec3 &v3, const ColorB &colV3)
void RenderText (Vec3 pos, const SDrawTextInfo &ti, const char *format, va_list args)
void Draw2dLabel (float x, float y, float font_size, const ColorF &fColor, bool bCenter, const char *format, va_list args)
void Draw2dLabel (float x, float y, float font_size, const ColorF &fColor, bool bCenter, const char *label_text,...) PRINTF_PARAMS(7
void va_start (args, label_text)
Draw2dLabel (x, y, font_size, fColor, bCenter, label_text, args)
va_end (args)
void Draw2dLabel (float x, float y, float font_size, const float pfColor[4], bool bCenter, const char *label_text,...) PRINTF_PARAMS(7
void va_start (args, label_text)
Draw2dLabel (x, y, font_size, *(ColorF *) pfColor, bCenter, label_text, args)
va_end (args)

Static Public Member Functions

static IRenderAuxGeom * GetAux ()

Detailed Description

Auxiliary geometry render interface. Used mostly for debugging, editor purposes, the Auxiliary geometry render interface provide functions to render 2d geometry and also text.

Member Function Documentation

◆ BeginDrawBuffer()

virtual SAuxVertex* IRenderAuxGeom::BeginDrawBuffer ( uint32 maxVertices,
bool textured
)
pure virtual

passes a pointer to buffer of vertices for drawing n triangles.

Parameters
numVerticesMaximum number of points we want to fill.
texturedWhether the triangles are textured or not.

◆ DrawAABB()

virtual void IRenderAuxGeom::DrawAABB ( const AABB & aabb,
bool bSolid,
const ColorB & col,
const EBoundingBoxDrawStyle & bbDrawStyle
)
pure virtual

Draw a Axis-aligned Bounding Boxes (AABB).

◆ DrawBuffer()

virtual void IRenderAuxGeom::DrawBuffer ( const SAuxVertex * inVertices,
uint32 numVertices,
bool textured
)
pure virtual

Draw n triangles.

Parameters
inVerticesList of vertices belonging to the sequence of triangles we have to draw.
numVerticesNumber of the points we will find starting from the area memory defined by v.
texturedWhether the triangles are textured or not.

◆ DrawCone()

virtual void IRenderAuxGeom::DrawCone ( const Vec3 & pos,
const Vec3 & dir,
float radius,
float height,
const ColorB & col,
bool drawShaded = true
)
pure virtual

Draw a cone.

Parameters
posCenter of the base of the cone.
dirDirection of the cone.
radiusRadius of the base of the cone.
heightHeight of the cone.
colColor of the cone.
drawShadedTrue if you want to draw the cone shaded, false otherwise.

◆ DrawCylinder()

virtual void IRenderAuxGeom::DrawCylinder ( const Vec3 & pos,
const Vec3 & dir,
float radius,
float height,
const ColorB & col,
bool drawShaded = true
)
pure virtual

Draw a cylinder.

Parameters
posCenter of the base of the cylinder.
dirDirection of the cylinder.
radiusRadius of the base of the cylinder.
heightHeight of the cylinder.
colColor of the cylinder.
drawShadedTrue if you want to draw the cylinder shaded, false otherwise.

◆ DrawLine()

virtual void IRenderAuxGeom::DrawLine ( const Vec3 & v0,
const ColorB & colV0,
const Vec3 & v1,
const ColorB & colV1,
float thickness = 1.0f
)
pure virtual

Draw a line.

Parameters
v0Starting vertex of the line.
colV0Color of the first vertex.
v1Ending vertex of the line.
colV1Color of the second vertex.
thicknessThickness of the line.

◆ DrawLines() [1/3]

virtual void IRenderAuxGeom::DrawLines ( const Vec3 * v,
uint32 numPoints,
const ColorB & col,
float thickness = 1.0f
)
pure virtual

Draw n lines.

Parameters
vList of vertices belonging to the lines we want to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
colColor of the vertices.
thicknessThickness of the line.

◆ DrawLines() [2/3]

virtual void IRenderAuxGeom::DrawLines ( const Vec3 * v,
const uint32 * packedColorARGB8888,
uint32 numPoints,
float thickness = 1.0f,
bool alphaFlag = true
)
pure virtual

Draw n lines.

Parameters
vList of vertices belonging to the lines we want to draw.
packedColorList of colors belonging to each vertex we want to draw. Packed into one uint32 via ARGB8888. Is of same length as v (i.e., numPoints).
numPointsNumber of the points we will find starting from the area memory defined by v.
thicknessThickness of the line.
alphaFlagEnable/disable transparency.

◆ DrawLines() [3/3]

virtual void IRenderAuxGeom::DrawLines ( const Vec3 * v,
uint32 numPoints,
const vtx_idx * ind,
uint32 numIndices,
const ColorB & col,
float thickness = 1.0f
)
pure virtual

Draw n lines.

Parameters
vList of vertices belonging to the lines we want to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
ind
numIndices
colColor of the vertices.
thicknessThickness of the line.

◆ DrawLineStrip()

virtual void IRenderAuxGeom::DrawLineStrip ( const Vec3 * v,
uint32 numPoints,
const ColorB * col,
float thickness = 1.0f
)
pure virtual

Draw n line strips.

Parameters
vList of vertices belonging to the line strip we want to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
colColor of the vertices.
thicknessThickness of the line.

◆ DrawOBB()

virtual void IRenderAuxGeom::DrawOBB ( const OBB & obb,
const Vec3 & pos,
bool bSolid,
const ColorB & col,
const EBoundingBoxDrawStyle & bbDrawStyle
)
pure virtual

Draw a Oriented Bounding Boxes (AABB).

◆ DrawPoint()

virtual void IRenderAuxGeom::DrawPoint ( const Vec3 & v,
const ColorB & col,
uint8 size = 1
)
pure virtual

Draw a point.

Parameters
vVector storing the position of the point.
colColor used to draw the point.
sizeSize of the point drawn.

◆ DrawPoints()

virtual void IRenderAuxGeom::DrawPoints ( const Vec3 * v,
uint32 numPoints,
const ColorB & col,
uint8 size = 1
)
pure virtual

Draw n points.

Parameters
vPointer to a list of vector storing the position of the points.
numPointsNumber of point we will find starting from the area memory defined by v.
colColor used to draw the points.
sizeSize of the points drawn.

◆ DrawPolyline()

virtual void IRenderAuxGeom::DrawPolyline ( const Vec3 * v,
uint32 numPoints,
bool closed,
const ColorB & col,
float thickness = 1.0f
)
pure virtual

Draw a polyline.

Parameters
vList of vertices belonging to the polyline we want to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
closedIf true a line between the last vertex and the first one is drawn.
colColor of the vertices.
thicknessThickness of the line.

◆ DrawSphere()

virtual void IRenderAuxGeom::DrawSphere ( const Vec3 & pos,
float radius,
const ColorB & col,
bool drawShaded = true
)
pure virtual

Draw a sphere.

Parameters
posCenter of the sphere.
radiusRadius of the sphere.
colColor of the sphere.
drawShadedTrue if you want to draw the sphere shaded, false otherwise.

◆ DrawTriangle()

virtual void IRenderAuxGeom::DrawTriangle ( const Vec3 & v0,
const ColorB & colV0,
const Vec3 & v1,
const ColorB & colV1,
const Vec3 & v2,
const ColorB & colV2
)
pure virtual

Draw a triangle.

Parameters
v0First vertex of the triangle.
colV0Color of the first vertex of the triangle.
v1Second vertex of the triangle.
colV1Color of the second vertex of the triangle.
v2Third vertex of the triangle.
colV2Color of the third vertex of the triangle.

◆ DrawTriangles() [1/2]

virtual void IRenderAuxGeom::DrawTriangles ( const Vec3 * v,
uint32 numPoints,
const ColorB & col
)
pure virtual

Draw n triangles.

Parameters
vList of vertices belonging to the sequence of triangles we have to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
colColor of the vertices.

◆ DrawTriangles() [2/2]

virtual void IRenderAuxGeom::DrawTriangles ( const Vec3 * v,
uint32 numPoints,
const vtx_idx * ind,
uint32 numIndices,
const ColorB & col
)
pure virtual

Draw n triangles.

Parameters
vList of vertices belonging to the sequence of triangles we have to draw.
numPointsNumber of the points we will find starting from the area memory defined by v.
ind
numIndices
colColor of the vertices.

◆ EndDrawBuffer()

virtual void IRenderAuxGeom::EndDrawBuffer ( uint32 numVertices)
pure virtual

Signals filling the vertex buffer is done. There MUST be ONE corresponding BeginDrawBuffer call before this function call.

Parameters
numVerticesNumber of vertices that are actually drawn.

◆ GetMatrix()

virtual Matrix34* IRenderAuxGeom::GetMatrix ( )
pure virtual

Get the world matrix for the next primitives

Returns
active matrix in the matrix buffer.

◆ PushImage()

virtual void IRenderAuxGeom::PushImage ( const SRender2DImageDescription & image)
pure virtual

Adds a 2D image that should be drawn on the screen to an internal render list. The function supports placing images in stereo 3D space. The stereo params are the same that are used for the scene. A value of 0 is handled as a special case and always places the image on the screen plane. image.stereoDepth - Places image in stereo 3d space. The depth is specified in camera space.

◆ PushMatrix()

virtual int IRenderAuxGeom::PushMatrix ( const Matrix34 & mat)
pure virtual

Push a world matrix for the next primitives

Parameters
matContains the matrix that will be used for trasforms of further primitives
Returns
Index of previous used matrix index in the matrix buffer, as set internally or by SetMatrixIndex!

◆ RenderTextQueued()

virtual void IRenderAuxGeom::RenderTextQueued ( Vec3 pos,
const SDrawTextInfo & ti,
const char * text
)
pure virtual

Draw Text.

◆ SetMatrixIndex()

virtual void IRenderAuxGeom::SetMatrixIndex ( int matID)
pure virtual

Set world matrix for the next primitives based on ID. This function allows us to do push/pop semantics

Parameters
matIDmatrix ID. Should be a matrix id returned by PushMatrix

◆ SetRenderFlags()

virtual SAuxGeomRenderFlags IRenderAuxGeom::SetRenderFlags ( const SAuxGeomRenderFlags & renderFlags)
pure virtual

Sets render flags.

Returns
Previously set render flags

◆ Submit()

virtual void IRenderAuxGeom::Submit ( uint frames = 0)
pure virtual

Flushes yet unprocessed elements and notifies rendering system that issuing rendering commands for current frame is done and frame is ready to be drawn. Thus Submit() guarantees that all previously issued commands will appear on the screen. Each thread rendering AUX geometry MUST call Submit() at the end of drawing cycle/frame "frames" indicate how many frames current commands butch must be presented on screen unless there till next butch is ready. for render and main thread this parameter has no effect