Open 3D Engine Atom Gem API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::RPI::AuxGeomDraw Class Referenceabstract

#include <AuxGeomDraw.h>

Inherited by AZ::Render::AuxGeomDrawQueue.

Classes

struct  AuxGeomDynamicDrawArguments
 Common arguments for free polygon (point, line, Triangle) draws. More...
 
struct  AuxGeomDynamicIndexedDrawArguments
 Common arguments for free polygon (point, line, Triangle) indexed draws. More...
 

Public Types

enum class  DrawStyle : uint8_t { Point , Line , Solid , Shaded }
 
enum class  DepthTest : uint8_t { On , Off }
 
enum class  DepthWrite : uint8_t { On , Off }
 
enum class  FaceCullMode : uint8_t { None , Front , Back }
 
enum class  PolylineEnd : uint8_t { Open , Closed }
 
enum class  OpacityType : uint8_t { Opaque , Translucent }
 

Public Member Functions

virtual int32_t AddViewProjOverride (const AZ::Matrix4x4 &viewProj)=0
 
virtual int32_t GetOrAdd2DViewProjOverride ()=0
 
virtual void SetPointSize (float pointSize)=0
 
virtual float GetPointSize ()=0
 
virtual void DrawPoints (const AuxGeomDynamicDrawArguments &args)=0
 
virtual void DrawLines (const AuxGeomDynamicDrawArguments &args)=0
 
virtual void DrawLines (const AuxGeomDynamicIndexedDrawArguments &args)=0
 
virtual void DrawPolylines (const AuxGeomDynamicDrawArguments &args, PolylineEnd end=PolylineEnd::Open)=0
 
virtual void DrawTriangles (const AuxGeomDynamicDrawArguments &args, FaceCullMode faceCull=FaceCullMode::None)=0
 
virtual void DrawTriangles (const AuxGeomDynamicIndexedDrawArguments &args, FaceCullMode faceCull=FaceCullMode::None)=0
 
virtual void DrawQuad (float width, float height, const AZ::Matrix3x4 &transform, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawSphere (const AZ::Vector3 &center, float radius, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawSphere (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawHemisphere (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawDisk (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawCone (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, float height, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawCylinder (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, float height, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawCylinderNoEnds (const AZ::Vector3 &center, const AZ::Vector3 &direction, float radius, float height, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawAabb (const AZ::Aabb &aabb, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawAabb (const AZ::Aabb &aabb, const AZ::Matrix3x4 &transform, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawObb (const AZ::Obb &obb, const AZ::Vector3 &position, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawObb (const AZ::Obb &obb, const AZ::Matrix3x4 &transform, const AZ::Color &color, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 
virtual void DrawFrustum (const AZ::Frustum &frustum, const AZ::Color &color, bool drawNormals=true, DrawStyle style=DrawStyle::Shaded, DepthTest depthTest=DepthTest::On, DepthWrite depthWrite=DepthWrite::On, FaceCullMode faceCull=FaceCullMode::Back, int32_t viewProjOverrideIndex=-1)=0
 

Detailed Description

The drawing interface of the AuxGeom system, which is used for drawing Auxiliary Geometry, both for debug and things like editor manipulators. An object implementing this interface can have internal state indicating which scene it is drawing to and whether it is immediate mode or persistent. To get a pointer to an AuxGeomDraw interface use a helper function like AuxGeomFeatureProcessorInterface::GetDrawQueueForScene.

Translucency: If a geometry is considered translucent that then it will be depth sorted. Also translucent geometry will not be combined with any other geometry to reduce draw calls. For functions where a single color is provided, the given color is used to determine if the geometry is opaque or translucent. If multiple colors are provided then a separate parameter of type OpacityType is used to indicate if the geometry is opaque or translucent.

Member Enumeration Documentation

◆ DrawStyle

enum class AZ::RPI::AuxGeomDraw::DrawStyle : uint8_t
strong
Enumerator
Point 

render each vertex as a point

Line 

Wireframe geometry.

Solid 

Solid geometry.

Shaded 

Solid geometry with fake lighting.

◆ OpacityType

enum class AZ::RPI::AuxGeomDraw::OpacityType : uint8_t
strong

Used to indicate whether geometry should be considered opaque or translucent. This is only used when more than one color is provided. If there is a single color then the alpha is used to determine whether it is opaque.

Member Function Documentation

◆ DrawAabb() [1/2]

virtual void AZ::RPI::AuxGeomDraw::DrawAabb ( const AZ::Aabb &  aabb,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw an axis-aligned bounding box with no transform.

Parameters
aabbThe AABB (typically the bounding box of a set of world space points).
colorThe color to draw the box.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawAabb() [2/2]

virtual void AZ::RPI::AuxGeomDraw::DrawAabb ( const AZ::Aabb &  aabb,
const AZ::Matrix3x4 &  transform,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual
Parameters
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawCone()

virtual void AZ::RPI::AuxGeomDraw::DrawCone ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
float  height,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a cone.

Parameters
centerThe center of the cone base.
directionThe direction vector. This is the vector from the center of the base to the point at the tip.
radiusThe radius.
heightThe height of the cone (the distance from the base center to the tip).
colorThe color to draw the cone.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawCylinder()

virtual void AZ::RPI::AuxGeomDraw::DrawCylinder ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
float  height,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a cylinder (with flat disks on the end).

Parameters
centerThe center of the base circle.
directionThe direction vector. The top end cap of the cylinder will face along this vector.
radiusThe radius.
heightThe height of the cylinder.
colorThe color to draw the cylinder.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawCylinderNoEnds()

virtual void AZ::RPI::AuxGeomDraw::DrawCylinderNoEnds ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
float  height,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a cylinder without flat disk on the end.

Parameters
centerThe center of the base circle.
directionThe direction vector. The top end cap of the cylinder will face along this vector.
radiusThe radius.
heightThe height of the cylinder.
colorThe color to draw the cylinder.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawDisk()

virtual void AZ::RPI::AuxGeomDraw::DrawDisk ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a disk.

Parameters
centerThe center of the disk.
directionThe direction vector. The disk will be orthogonal this vector.
radiusThe radius of the disk.
colorThe color to draw the disk.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawFrustum()

virtual void AZ::RPI::AuxGeomDraw::DrawFrustum ( const AZ::Frustum &  frustum,
const AZ::Color &  color,
bool  drawNormals = true,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a frustum.

Parameters
frustumThe frustum
colorThe color to draw the frustum
drawNormalsIf true, frustum plane normals will be drawn as lines
styleThe draw style (point, wireframe, solid) Shaded not currently supported.
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawHemisphere()

virtual void AZ::RPI::AuxGeomDraw::DrawHemisphere ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a hemisphere.

Parameters
centerThe center of the sphere.
directionThe direction vector. The Pole of the hemisphere will point along this vector.
radiusThe radius.
colorThe color to draw the sphere.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawObb() [1/2]

virtual void AZ::RPI::AuxGeomDraw::DrawObb ( const AZ::Obb &  obb,
const AZ::Matrix3x4 &  transform,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual
Parameters
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawObb() [2/2]

virtual void AZ::RPI::AuxGeomDraw::DrawObb ( const AZ::Obb &  obb,
const AZ::Vector3 &  position,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw an oriented bounding box with a given position.

Parameters
obbThe OBB (typically an oriented bounding box in model space).
positionThe position to translate the origin of the OBB to.
colorThe color to draw the box.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawPolylines()

virtual void AZ::RPI::AuxGeomDraw::DrawPolylines ( const AuxGeomDynamicDrawArguments args,
PolylineEnd  end = PolylineEnd::Open 
)
pure virtual
Parameters
closedIf true then a line will be drawn from the last point to the first.

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawQuad()

virtual void AZ::RPI::AuxGeomDraw::DrawQuad ( float  width,
float  height,
const AZ::Matrix3x4 &  transform,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a quad.

Parameters
widthThe width of the quad.
heightThe height of the quad.
transformThe world space transform for the quad.
colorThe color to draw the quad.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawSphere() [1/2]

virtual void AZ::RPI::AuxGeomDraw::DrawSphere ( const AZ::Vector3 &  center,
const AZ::Vector3 &  direction,
float  radius,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a sphere.

Parameters
centerThe center of the sphere.
directionThe direction vector. The Pole of the hemisphere will point along this vector.
radiusThe radius.
colorThe color to draw the sphere.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawSphere() [2/2]

virtual void AZ::RPI::AuxGeomDraw::DrawSphere ( const AZ::Vector3 &  center,
float  radius,
const AZ::Color &  color,
DrawStyle  style = DrawStyle::Shaded,
DepthTest  depthTest = DepthTest::On,
DepthWrite  depthWrite = DepthWrite::On,
FaceCullMode  faceCull = FaceCullMode::Back,
int32_t  viewProjOverrideIndex = -1 
)
pure virtual

Draw a sphere.

Parameters
centerThe center of the sphere.
radiusThe radius.
colorThe color to draw the sphere.
styleThe draw style (point, wireframe, solid, shaded etc).
depthTestIf depth testing should be enabled
depthWriteIf depth writing should be enabled
faceCullWhich (if any) facing triangles should be culled
viewProjOverrideIndexWhich view projection override entry to use, -1 if unused

Implemented in AZ::Render::AuxGeomDrawQueue.

◆ DrawTriangles()

virtual void AZ::RPI::AuxGeomDraw::DrawTriangles ( const AuxGeomDynamicDrawArguments args,
FaceCullMode  faceCull = FaceCullMode::None 
)
pure virtual
Parameters
faceCullWhich (if any) facing triangles should be culled

Implemented in AZ::Render::AuxGeomDrawQueue.


The documentation for this class was generated from the following file: