class
SceneGizmos
Records commands for rendering gizmos for a particular scene.
Draws the recorded commands using a renderer extension. See GizmoDrawing.
Public
Constructors
SceneGizmos
Methods
~SceneGizmos
SetTransform
Changes the transform of any future recorded draw commands.
AddDrawCubeCommand
Adds a command that draws an axis aligned cuboid.
AddDrawSphereCommand
Adds a command that draws a sphere.
AddDrawConeCommand
Adds a command that draws a solid cone.
AddDrawDiscCommand
Adds a command that draws a solid disc.
AddDrawWireCubeCommand
Adds a command that draws a wireframe axis aligned cuboid.
AddDrawWireSphereCommand
Adds a command that draws a wireframe sphere represented by three discs.
AddDrawWireHemisphereCommand
Adds a command that draws a wireframe hemisphere represented by three arcs.
AddDrawWireConeCommand
Adds a command that draws a wireframe cone.
AddDrawLineCommand
Adds a command that draws a line between two points.
AddDrawLineListCommand
Adds a command that draws a list of lines.
Provided array must contain pairs of the line start point followed by an end point.
AddDrawWireDiscCommand
Adds a command that draws a wireframe disc.
AddDrawWireArcCommand
Adds a command that draws a wireframe arc.
AddDrawWireMeshCommand
Adds a command that draws a wireframe mesh.
AddDrawFrustumCommand
Adds a command that draws a wireframe frustum.
AddDrawIconCommand
Adds a command that draws an icon that always faces the camera.
AddDrawTextCommand
Adds a command that draws a mesh representing 2D text with the specified properties.
ClearDrawCommands
Clears all draw commands, but doesn't update the render data.
This means that current gizmos will continue drawing until Draw() is called.
ClearRenderData
Clears gizmo render data like meshes, so anything specified by the last Draw() call stops drawing.
Does not clear the draw commands, so the following Draw() call will re-queue the previous commands for drawing and re-generate the render data.
GetSceneObject
Returns a scene object that was attached to a specific gizmo.
- gizmoIdx
- Index of the gizmo to look for.
Draw
Sends all the draw commands since the last call to ClearRenderData() for drawing on the provided camera.
staticCreate
Creates a new scene gizmos object associated with the provided scene.
Internal
Methods
GeneratePickingInformation
Generates information required for rendering gizmos for picking purposes.
- camera
- Camera to draw the gizmos on.
- drawSettings
- Settings used to control icon drawing.
- fnIndexToColorCallback
- Callback that assigns a unique color to each gizmo index.
Returns: Object that can be passed to gizmo renderer.
GetGizmoRenderer
Returns an object that may be used for gizmo rendering.
staticSetFactory
Sets the object that will be used for creating new SceneGizmos objects when Create() is called.
If null is provided, then Create() will output default SceneGizmos object types.
Protected
Methods
BuildIconMesh
Builds a brand new mesh that can be used for rendering all icon gizmos.
- camera
- Camera the mesh will be rendered to.
- drawSettings
- Settings used to control icon drawing.
- iconData
- A list of all icons and their properties.
- forPicking
- Whether the icons will be rendered normally, or with a special material for picking.
- outRenderData
- Output data that outlines the structure of the returned mesh. It tells us which portions of the mesh use which icon texture.
Returns: A mesh containing all of the visible icons.
LimitIconSize
Resizes the icon width/height so it is always scaled to optimal size (with preserved aspect).
CreateMeshProxyData
Converts mesh data from DrawHelper into mesh data usable by the gizmo renderer.
CalculateIconColors
Calculates colors for an icon based on its position in the camera.
For example icons too close to too far might be faded.
- tint
- Primary tint for the icon.
- camera
- Camera in which the icon will be rendered in.
- drawSettings
- Settings used to control icon drawing.
- iconHeight
- Height of the icon in pixels.
- fixedScale
- Whether the icon size changes depending on distance from the camera.
- normalColor
- Normal color of the icon.
- fadedColor
- Faded color to be used when icon is occluded by geometry.
PrepareForDraw
Called just before rendering gizmos.
Allows derived classes to add gizmos for drawing.