Class Gizmos

The Gizmos class provides rendering and picking of gizmo elements.

Gizmos are icons and 3D objects usually rendered in scene view for various visualization purposes. For example a Camera component will have a gizmo that draws a camera icon since otherwise it has no visual representation. Aside from being rendered, gizmos can also be selected by the user as if they were normal scene elements.

To add a gizmo to a scene, apply the @drawGizmo decorator to a static method.

Constructors

  • Returns Gizmos

Accessors

  • get color(): Immutable<Color>
  • Changes the color of any further gizmo draw calls.

    Returns Immutable<Color>

  • set color(value): void
  • Parameters

    Returns void

  • get isDepthTestEnabled(): boolean
  • Determines if depth-testing is enabled (Default: Enabled)

    Returns boolean

  • set isDepthTestEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get isOcclusionTintEnabled(): boolean
  • Enables depth testing, and renders the occluded portion with a tinted color. (Default: False)

    Returns boolean

  • set isOcclusionTintEnabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • set layer(value): void
  • 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

    Parameters

    Returns void

  • get screenPositionOffset(): Immutable<Vector2>
  • Determines the offset in screen space to apply to the gizmo.

    This is represented in units of the base gizmo size.

    Returns Immutable<Vector2>

  • set screenPositionOffset(value): void
  • Parameters

    Returns void

  • set specialRenderingFlags(value): void
  • Set special rendering flags.

    Parameters

    Returns void

  • get transform(): Immutable<Matrix4>
  • Changes the transform that will be applied to meshes of any further gizmo draw calls.

    Returns Immutable<Matrix4>

  • set transform(value): void
  • Parameters

    Returns void

Methods

  • Draws a double-sided solid arc.

    Parameters

    • position: Immutable<Vector3>

      Center of the arc.

    • normal: Immutable<Vector3>

      Orientation of the arc, pointing in the direction the arc is visible in.

    • radius: number

      Radius of the arc.

    • startAngle: rsx.Degree

      Angle at which to start the arc.

    • amountAngle: rsx.Degree

      Length of the arc.

    Returns void

  • Draws a solid cone.

    Parameters

    Returns void

  • Draws an axis aligned cuboid.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws a solid cylinder.

    Parameters

    • base: Immutable<Vector3>

      Position of the center of the base of the cylinder.

    • normal: Immutable<Vector3>

      Orientation of the cone, pointing from center base to the top of the cylinder.

    • height: number

      Height of the cylinder (along the normal).

    • radius: number

      Radius of the cylinder.

    • Optionalscale: Immutable<Vector2>

      Scale applied to cylinder's disc width & height. Allows you to create elliptical cones.

    Returns void

  • Draws a solid disc.

    Parameters

    • position: Immutable<Vector3>

      Center of the disc.

    • normal: Immutable<Vector3>

      Orientation of the disc, pointing in the direction the disc is visible in.

    • radius: number

      Radius of the disc.

    Returns void

  • Draws a wireframe frustum.

    Parameters

    • position: Immutable<Vector3>

      Origin of the frustum, or the eye point.

    • aspect: number

      Ratio of frustum width over frustum height.

    • FOV: rsx.Degree

      Horizontal field of view in degrees.

    • near: number

      Distance to the near frustum plane.

    • far: number

      Distance to the far frustum plane.

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws an icon that always faces the camera.

    Parameters

    • position: Immutable<Vector3>

      Position of the center of the icon.

    • image: Image

      Sprite image for the icon to draw.

    • fixedScale: boolean

      If true then the icon will remain the same size regardless of the distance from camera.

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws a line between two points.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws a list of lines. Provided array must contain pairs of the line start point followed by an end point.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws a solid mesh.

    Parameters

    Returns void

  • Draws a solid torus mesh representing a handle orbit.

    Returns void

  • Draws a double-sided solid rectangle.

    Parameters

    Returns void

  • Draws a solid skeleton.

    Parameters

    • skeleton: Skeleton

      The skeleton to draw.

    • OptionalboneTransforms: Immutable<Matrix4>[]

      The optional bone transforms to override the default skeleton pose.

    • OptionalboneColors: Color[]

      The optional bone colors to override the current color.

    Returns void

  • Draws a solid skeleton bone.

    Parameters

    • bonePosition: Immutable<Vector3>

      The position of the joint (or start of the bone).

    • parentPosition: Immutable<Vector3>
    • radius: number

      The radius of the bone.

    • detached: boolean

      If true, only lines will be drawn to the parent, and no cones

    • OptionaljointColor: Immutable<Color>
    • OptionalparentColor: Immutable<Color>

      Color of the parent bone

    Returns void

  • Draws a sphere.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

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

    Parameters

    • position: Immutable<Vector3>

      Position to render the text at. Text will be centered around this point.

    • text: string

      Text to draw.

    • font: Font | ResourceHandle<Font>

      Font to use for rendering the text's characters.

    • OptionalfontSize: number

      Size of the characters, in points.

    Returns void

  • Draws a solid torus.

    Parameters

    • orientation: Immutable<Quaternion>

      The orientation of the torus.

    • radius: number

      The radius of the torus.

    • tubeRadius: number

      The tube radius of the torus.

    • quality: number

      The quality of subdivision of the torus.

    Returns void

  • Draws a wireframe arc.

    Parameters

    • position: Immutable<Vector3>

      Center of the arc.

    • normal: Immutable<Vector3>

      Orientation of the arc, pointing in the direction the arc is visible in.

    • radius: number

      Radius of the arc.

    • startAngle: rsx.Degree

      Angle at which to start the arc.

    • amountAngle: rsx.Degree

      Length of the arc.

    Returns void

  • Draws a wireframe capsule.

    Parameters

    • position: Immutable<Vector3>

      World coordinates of the center of the capsule.

    • height: number

      Distance between the centers of the capsule's hemispheres.

    • radius: number

      Distance of each point from the capsule's center-line.

    Returns void

  • Draws a wireframe cone.

    Parameters

    Returns void

  • Draws a wireframe axis aligned cuboid.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Draws a wireframe cylinder.

    Parameters

    • base: Immutable<Vector3>

      Position of the center of the base of the cylinder.

    • normal: Immutable<Vector3>

      Orientation of the cylinder, pointing from center base to the top of the cylinder.

    • height: number

      Height of the cylinder (along the normal).

    • radius: number

      Radius of the cylinder.

    • Optionalscale: Immutable<Vector2>

      Scale applied to cylinder's disc width & height. Allows you to create elliptical cones.

    Returns void

  • Draws a wireframe disc.

    Parameters

    • position: Immutable<Vector3>

      Center of the disc.

    • normal: Immutable<Vector3>

      Orientation of the disc, pointing in the direction the disc is visible in.

    • radius: number

      Radius of the disc.

    Returns void

  • Draws a wireframe hemisphere represented by three arcs.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.

  • Parameters

    Returns void

  • Draws a wireframe rectangle.

    Parameters

    Returns void

  • Draws a skeleton.

    Parameters

    • skeleton: Skeleton

      The skeleton to draw.

    • OptionalboneTransforms: Immutable<Matrix4>[]

      The optional bone transforms to override the default skeleton pose.

    • OptionalboneColors: Color[]

      The optional bone colors to override the current color.

    Returns void

  • Draws a skeleton bone.

    Parameters

    • bonePosition: Immutable<Vector3>

      The position of the joint (or start of the bone).

    • parentPosition: Immutable<Vector3>

      The position of the parent bone.

    • radius: number

      The radius of the bone.

    • detached: boolean

      If true, only lines will be drawn to the parent, and no cones

    • OptionalboneColor: Immutable<Color>

      Color of the bone

    • OptionalparentColor: Immutable<Color>

      Color of the parent bone

    Returns void

  • Draws a wireframe sphere represented by three discs.

    Parameters

    Returns void

    Must be called between startGizmo/endGizmo calls.