class SceneHandleDrawing

Allows you to easily draw various kinds of simple shapes, primarily used for drawing handles in the scene view.

All draw commands are recorded in the SceneHandles object that is provided to the BeginDraw() method.

Public

Constructors

SceneHandleDrawing

SceneHandleDrawing()

Methods

BeginDraw

void BeginDraw(const SPtr<SceneHandles> &sceneHandles)

Begins drawing a scene handle.

All Draw* commands must be between Begin/EndDraw calls.

EndDraw

void EndDraw()

Ends drawing a scene handle.

SetColor

void SetColor(const Color &color)

Sets the color of all the following Draw* calls.

SetTransform

void SetTransform(const Matrix4 &transform)

Sets the transform matrix that will be applied to all following Draw* calls.

SetLayer

void SetLayer(u64 layer)

Sets the layer bitfield that controls whether a handle is considered visible in a specific camera.

Handle layer must match camera layer in order for the camera to render it

DrawCube

void DrawCube(const Vector3 &position, const Vector3 &extents, float size = 1.F)

Draws a solid cuboid.

position
Center of the cuboid.
extents
Radius of the cuboid in all directions.
size
Uniform scale of the object.

DrawSphere

void DrawSphere(const Vector3 &position, float radius, float size = 1.F)

Draws a solid sphere.

position
Center of the sphere.
radius
Radius of the sphere.
size
Uniform scale of the object.

DrawWireCube

void DrawWireCube(const Vector3 &position, const Vector3 &extents, float size = 1.F)

Draws a wireframe cuboid.

position
Center of the cuboid.
extents
Radius of the cuboid in all directions.
size
Uniform scale of the object.

DrawWireSphere

void DrawWireSphere(const Vector3 &position, float radius, float size = 1.F)

Draws a wireframe sphere.

position
Center of the sphere.
radius
Radius of the sphere.
size
Uniform scale of the object.

DrawCone

void DrawCone(const Vector3 &baseCenter, const Vector3 &normal, float height, float radius, float size = 1.F)

Draws a solid cone.

baseCenter
Position of the center of the base of the cone.
normal
Orientation of the cone, pointing from center base to the tip of the cone.
height
Height of the cone (along the normal).
radius
Radius of the base of the cone.
size
Uniform scale of the object.

DrawLine

void DrawLine(const Vector3 &start, const Vector3 &end, float size = 1.F)

Draws a line.

start
Starting point for the line.
end
Ending point for the line.
size
Uniform scale of the object.

DrawDisc

void DrawDisc(const Vector3 &position, const Vector3 &normal, float radius, float size = 1.F)

Draws a double-sided solid disc.

position
Center of the disc.
normal
Orientation of the disc, pointing in the direction the disc is visible in.
radius
Radius of the disc.
size
Uniform scale of the object.

DrawWireDisc

void DrawWireDisc(const Vector3 &position, const Vector3 &normal, float radius, float size = 1.F)

Draws a wireframe disc.

position
Center of the disc.
normal
Orientation of the disc, pointing in the direction the disc is visible in.
radius
Radius of the disc.
size
Uniform scale of the object.

DrawArc

void DrawArc(const Vector3 &position, const Vector3 &normal, float radius, Degree startAngle, Degree amountAngle, float size = 1.F)

Draws a double-sided solid arc.

position
Center of the arc.
normal
Orientation of the arc, pointing in the direction the arc is visible in.
radius
Radius of the arc.
startAngle
Angle at which to start the arc.
amountAngle
Length of the arc.
size
Uniform scale of the object.

DrawWireArc

void DrawWireArc(const Vector3 &position, const Vector3 &normal, float radius, Degree startAngle, Degree amountAngle, float size = 1.F)

Draws a wireframe arc.

position
Center of the arc.
normal
Orientation of the arc, pointing in the direction the arc is visible in.
radius
Radius of the arc.
startAngle
Angle at which to start the arc.
amountAngle
Length of the arc.
size
Uniform scale of the object.

DrawRect

void DrawRect(const Rect3 &area, float size = 1.F)

Draws a double-sided solid rectangle.

area
Position and size of the rectangle.
size
Uniform scale of the object.

DrawText

void DrawText(const Vector3 &position, const String &text, const HFont &font, float fontSize = 16.F)

Draws a mesh representing 2D text with the specified properties.

position
Position to render the text at. Text will be centered around this point.
text
Text to draw.
font
Font to use for rendering the text's characters.
fontSize
Size of the characters, in points.

staticInstance

static T &Instance()

Returns a reference to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticInstancePtr

static T *InstancePtr()

Returns a pointer to the module instance.

Module has to have been started up first otherwise an exception will be thrown.

staticShutDown

static void ShutDown()

Shuts down this module and frees any resources it is using.

staticIsStarted

static bool IsStarted()

Query if the module has been started.

Protected

Methods

~Module<T>

virtual ~Module<T>() = default

OnStartUp

virtual void OnStartUp()

Override if you want your module to be notified once it has been constructed and started.

OnShutDown

virtual void OnShutDown()

Override if you want your module to be notified just before it is deleted.

staticInstanceInternal

static T *&InstanceInternal()

Returns a singleton instance of this module.

staticIsDestroyed

static bool &IsDestroyed()

Checks has the Module been shut down.

staticIsStartedUp

static bool &IsStartedUp()

Checks has the Module been started up.

Private

Fields

mSceneHandles

SPtr<SceneHandles> mSceneHandles

mTransform

Matrix4 mTransform