Photon Quantum 3.0.0

Static Public Member Functions | Static Public Attributes | List of all members
Quantum.GizmoUtils Class Reference

Utility class for drawing gizmos. More...

Static Public Member Functions

static Color Alpha (this Color color, Single a)
 Adjusts the alpha channel of the color. More...
 
static Color Brightness (this Color color, float brightness)
 Adjusts the brightness of a color. More...
 
static void DrawGizmoArc (Vector3 position, Vector3 normal, Vector3 from, float angle, float radius, Color color, float alphaRatio=1.0f, QuantumGizmoStyle style=default)
 Draws a gizmo arc in the Unity editor. More...
 
static void DrawGizmoDiamond (Vector3 center, Vector2 size)
 Draws a diamond gizmo with the given center and size. More...
 
static void DrawGizmoDisc (Vector3 position, Vector3 normal, float radius, Color color, float alphaRatio=1.0f, QuantumGizmoStyle style=default)
 Draws a gizmo disc at the specified position and orientation. More...
 
static void DrawGizmoGrid (FPVector2 bottomLeft, Int32 width, Int32 height, Int32 nodeSize, Color color)
 Draws a grid of gizmos in the Unity editor. More...
 
static void DrawGizmoGrid (Vector3 bottomLeft, Int32 width, Int32 height, float nodeWidth, float nodeHeight, Color color)
 Draws a grid of gizmos in the scene. More...
 
static void DrawGizmoGrid (Vector3 bottomLeft, Int32 width, Int32 height, Int32 nodeSize, Color color)
 Draw a grid of gizmos starting from a bottom-left position. More...
 
static void DrawGizmoPolygon2D (Matrix4x4 matrix, FPVector2[] vertices, Single height, bool drawNormals, Color color, QuantumGizmoStyle style=default)
 
static void DrawGizmoPolygon2D (Transform transform, FPVector2[] vertices, Single height, bool drawNormals, Color color, QuantumGizmoStyle style=default)
 Draws a 2D polygon gizmo with the given parameters. More...
 
static void DrawGizmoPolygon2D (Vector3 position, Quaternion rotation, FPVector2[] vertices, Single height, bool drawNormals, Color color, QuantumGizmoStyle style=default)
 Draws a 2D polygon gizmo in the scene. More...
 
static void DrawGizmoPolygon2D (Vector3 position, Quaternion rotation, FPVector2[] vertices, Single height, Color color, QuantumGizmoStyle style=default)
 Draws a 2D polygon gizmo in the scene. More...
 
static void DrawGizmosBox (Matrix4x4 matrix, Vector3 size, Color color, QuantumGizmoStyle style=default)
 Draws a box gizmo in the scene using the specified parameters. More...
 
static void DrawGizmosBox (Transform transform, Vector3 size, Color color, Vector3 offset=default, QuantumGizmoStyle style=default)
 Draws a gizmo box in the scene using the specified parameters. More...
 
static void DrawGizmosBox (Vector3 center, Vector3 size, Color color, Quaternion? rotation=null, QuantumGizmoStyle style=default)
 Draws a box gizmo with the given center, size, color, rotation, and style. More...
 
static void DrawGizmosCapsule (Matrix4x4 matrix, float radius, float extent, Color color, QuantumGizmoStyle style=default)
 Draws a capsule gizmo in the Scene view using Handles. More...
 
static void DrawGizmosCapsule (Vector3 center, float radius, float extent, Color color, Quaternion? rotation=null, QuantumGizmoStyle style=default)
 Draws a capsule Gizmo in 3D space. More...
 
static void DrawGizmosCapsule2D (Vector3 center, float radius, float height, Color color, Quaternion? rotation=null, QuantumGizmoStyle style=default)
 Draws a 2D capsule gizmo. More...
 
static void DrawGizmosCircle (Vector3 position, Single radius, Color color, Single height=0.0f, QuantumGizmoStyle style=default)
 Draws a gizmo circle at the specified position with the given radius and color. More...
 
static void DrawGizmosEdge (Vector3 start, Vector3 end, float height, Color color, QuantumGizmoStyle style=default)
 Draws a gizmo edge from the specified start point to the end point. More...
 
static void DrawGizmosSphere (Vector3 position, Single radius, Color color, QuantumGizmoStyle style=default)
 Draws a sphere gizmo in the scene. More...
 
static void DrawGizmosTriangle (Vector3 A, Vector3 B, Vector3 C, Color color)
 Draws a triangle gizmo using the given vertices and color. More...
 
static void DrawGizmoVector (Vector3 start, Vector3 end, float arrowHeadLength=DefaultArrowHeadLength, float arrowHeadAngle=DefaultArrowHeadAngle)
 Draws a vector gizmo from the specified start point to the specified end point. More...
 
static void DrawGizmoVector3D (Vector3 start, Vector3 end, float arrowHeadLength=0.25f, float arrowHeadAngle=25.0f)
 Draws a 3D vector gizmo with an arrowhead from the specified start to end points. More...
 

Static Public Attributes

const float DefaultArrowHeadAngle = 25.0f
 The default arrow head angle. More...
 
const float DefaultArrowHeadLength = 0.25f
 The default arrow head length. More...
 

Detailed Description

Utility class for drawing gizmos.

Member Function Documentation

◆ Alpha()

static Color Quantum.GizmoUtils.Alpha ( this Color  color,
Single  a 
)
inlinestatic

Adjusts the alpha channel of the color.

Parameters
colorThe color to adjust.
aThe new alpha value.
Returns
The color with the alpha value adjusted.

◆ Brightness()

static Color Quantum.GizmoUtils.Brightness ( this Color  color,
float  brightness 
)
inlinestatic

Adjusts the brightness of a color.

Parameters
colorThe color to adjust.
brightnessThe brightness value. Values greater than 1 will increase brightness, while values less than 1 will decrease brightness.
Returns
The adjusted color with the specified brightness.

◆ DrawGizmosBox() [1/3]

static void Quantum.GizmoUtils.DrawGizmosBox ( Transform  transform,
Vector3  size,
Color  color,
Vector3  offset = default,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a gizmo box in the scene using the specified parameters.

Parameters
transformThe transform of the gizmo box.
sizeThe size of the gizmo box.
colorThe color of the gizmo box.
offsetThe offset position for the gizmo box (default: Vector3.zero).
styleThe gizmo style to apply (default: QuantumGizmoStyle default value).

◆ DrawGizmosBox() [2/3]

static void Quantum.GizmoUtils.DrawGizmosBox ( Vector3  center,
Vector3  size,
Color  color,
Quaternion?  rotation = null,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a box gizmo with the given center, size, color, rotation, and style.

Parameters
centerThe center position of the box.
sizeThe size of the box.
colorThe color of the box.
rotationThe rotation of the box. Defaults to identity rotation if not provided.
styleThe style of the gizmo. Defaults to default style if not provided.

◆ DrawGizmosCapsule2D()

static void Quantum.GizmoUtils.DrawGizmosCapsule2D ( Vector3  center,
float  radius,
float  height,
Color  color,
Quaternion?  rotation = null,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a 2D capsule gizmo.

Parameters
centerThe center of the capsule.
radiusThe radius of the capsule.
heightThe height of the capsule.
colorThe color of the gizmo.
rotationThe rotation of the capsule. If null, identity rotation is used.
styleThe style of the gizmo. If not provided, default style is used.

◆ DrawGizmosBox() [3/3]

static void Quantum.GizmoUtils.DrawGizmosBox ( Matrix4x4  matrix,
Vector3  size,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a box gizmo in the scene using the specified parameters.

Parameters
matrixThe matrix of the gizmo box.
sizeThe size of the box.
colorThe color of the box.
styleThe style of the gizmo. (Optional)

◆ DrawGizmosCircle()

static void Quantum.GizmoUtils.DrawGizmosCircle ( Vector3  position,
Single  radius,
Color  color,
Single  height = 0.0f,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a gizmo circle at the specified position with the given radius and color.

Parameters
positionThe position of the circle.
radiusThe radius of the circle.
colorThe color of the circle.
heightThe height of the circle. Default is 0.0.
styleThe style of the gizmo. Default is QuantumGizmoStyle's default value.

◆ DrawGizmosSphere()

static void Quantum.GizmoUtils.DrawGizmosSphere ( Vector3  position,
Single  radius,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a sphere gizmo in the scene.

Parameters
positionThe position of the sphere.
radiusThe radius of the sphere.
colorThe color of the sphere.
styleThe style of the gizmo.

◆ DrawGizmosTriangle()

static void Quantum.GizmoUtils.DrawGizmosTriangle ( Vector3  A,
Vector3  B,
Vector3  C,
Color  color 
)
inlinestatic

Draws a triangle gizmo using the given vertices and color.

Parameters
AThe first vertex of the triangle.
BThe second vertex of the triangle.
CThe third vertex of the triangle.
colorThe color of the triangle.

◆ DrawGizmoGrid() [1/3]

static void Quantum.GizmoUtils.DrawGizmoGrid ( FPVector2  bottomLeft,
Int32  width,
Int32  height,
Int32  nodeSize,
Color  color 
)
inlinestatic

Draws a grid of gizmos in the Unity editor.

Parameters
bottomLeftThe bottom-left corner of the grid.
widthThe number of horizontal nodes in the grid.
heightThe number of vertical nodes in the grid.
nodeSizeThe size of each grid node.
colorThe color of the grid gizmos.

◆ DrawGizmoGrid() [2/3]

static void Quantum.GizmoUtils.DrawGizmoGrid ( Vector3  bottomLeft,
Int32  width,
Int32  height,
Int32  nodeSize,
Color  color 
)
inlinestatic

Draw a grid of gizmos starting from a bottom-left position.

Parameters
bottomLeftThe bottom-left position of the grid.
widthThe width of the grid in number of nodes.
heightThe height of the grid in number of nodes.
nodeSizeThe size of each individual node in the grid.
colorThe color of the grid gizmos.

◆ DrawGizmoGrid() [3/3]

static void Quantum.GizmoUtils.DrawGizmoGrid ( Vector3  bottomLeft,
Int32  width,
Int32  height,
float  nodeWidth,
float  nodeHeight,
Color  color 
)
inlinestatic

Draws a grid of gizmos in the scene.

Parameters
bottomLeftThe bottom left corner of the grid.
widthThe number of columns in the grid.
heightThe number of rows in the grid.
nodeWidthThe width of each grid node.
nodeHeightThe height of each grid node.
colorThe color of the grid lines.

◆ DrawGizmoPolygon2D() [1/3]

static void Quantum.GizmoUtils.DrawGizmoPolygon2D ( Vector3  position,
Quaternion  rotation,
FPVector2[]  vertices,
Single  height,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a 2D polygon gizmo in the scene.

Parameters
positionThe position of the polygon.
rotationThe rotation of the polygon.
verticesThe vertices of the polygon.
heightThe height of the polygon.
colorThe color of the polygon.
styleThe style of the gizmo.

◆ DrawGizmoPolygon2D() [2/3]

static void Quantum.GizmoUtils.DrawGizmoPolygon2D ( Vector3  position,
Quaternion  rotation,
FPVector2[]  vertices,
Single  height,
bool  drawNormals,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a 2D polygon gizmo in the scene.

Parameters
positionThe position of the polygon.
rotationThe rotation of the polygon.
verticesThe array of vertices that define the polygon shape.
heightThe height of the polygon.
drawNormalsWhether to draw normals for the polygon.
colorThe color of the polygon.
styleThe style of the gizmo.

◆ DrawGizmoPolygon2D() [3/3]

static void Quantum.GizmoUtils.DrawGizmoPolygon2D ( Transform  transform,
FPVector2[]  vertices,
Single  height,
bool  drawNormals,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a 2D polygon gizmo with the given parameters.

Parameters
transformThe transform of the polygon.
verticesThe vertices of the polygon.
heightThe height of the polygon.
drawNormalsWhether to draw the polygon normal.
colorThe color of the polygon.
styleThe style of the gizmo.

◆ DrawGizmoDiamond()

static void Quantum.GizmoUtils.DrawGizmoDiamond ( Vector3  center,
Vector2  size 
)
inlinestatic

Draws a diamond gizmo with the given center and size.

Parameters
centerThe center position of the diamond.
sizeThe size of the diamond.

◆ DrawGizmoVector3D()

static void Quantum.GizmoUtils.DrawGizmoVector3D ( Vector3  start,
Vector3  end,
float  arrowHeadLength = 0.25f,
float  arrowHeadAngle = 25.0f 
)
inlinestatic

Draws a 3D vector gizmo with an arrowhead from the specified start to end points.

Parameters
startThe starting point of the vector.
endThe ending point of the vector.
arrowHeadLengthThe length of the arrowhead.
arrowHeadAngleThe angle of the arrowhead.

◆ DrawGizmoVector()

static void Quantum.GizmoUtils.DrawGizmoVector ( Vector3  start,
Vector3  end,
float  arrowHeadLength = DefaultArrowHeadLength,
float  arrowHeadAngle = DefaultArrowHeadAngle 
)
inlinestatic

Draws a vector gizmo from the specified start point to the specified end point.

Parameters
startThe starting point of the vector.
endThe ending point of the vector.
arrowHeadLengthThe length of the arrow head (default is DefaultArrowHeadLength).
arrowHeadAngleThe angle of the arrow head (default is DefaultArrowHeadAngle).

◆ DrawGizmoArc()

static void Quantum.GizmoUtils.DrawGizmoArc ( Vector3  position,
Vector3  normal,
Vector3  from,
float  angle,
float  radius,
Color  color,
float  alphaRatio = 1.0f,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a gizmo arc in the Unity editor.

Parameters
positionThe position of the arc.
normalThe normal vector of the arc.
fromThe starting direction vector of the arc.
angleThe angle of the arc.
radiusThe radius of the arc.
colorThe color of the arc.
alphaRatioThe alpha ratio of the arc.
styleThe style of the arc.

◆ DrawGizmoDisc()

static void Quantum.GizmoUtils.DrawGizmoDisc ( Vector3  position,
Vector3  normal,
float  radius,
Color  color,
float  alphaRatio = 1.0f,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a gizmo disc at the specified position and orientation.

Parameters
positionThe position of the disc.
normalThe orientation of the disc.
radiusThe radius of the disc.
colorThe color of the disc.
alphaRatioThe alpha ratio for the disc's color.
styleThe style of the gizmo.

◆ DrawGizmosEdge()

static void Quantum.GizmoUtils.DrawGizmosEdge ( Vector3  start,
Vector3  end,
float  height,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a gizmo edge from the specified start point to the end point.

Parameters
startThe starting point of the edge.
endThe ending point of the edge.
heightThe height of the edge.
colorThe color of the edge.
styleThe gizmo style to use.

◆ DrawGizmosCapsule() [1/2]

static void Quantum.GizmoUtils.DrawGizmosCapsule ( Vector3  center,
float  radius,
float  extent,
Color  color,
Quaternion?  rotation = null,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a capsule Gizmo in 3D space.

Parameters
centerThe center position of the capsule.
radiusThe radius of the capsule.
extentThe extent (length) of the capsule.
colorThe color of the capsule.
rotationThe rotation of the capsule. If null, no rotation is applied.
styleThe style of the Gizmo. Defaults to QuantumGizmoStyle.

◆ DrawGizmosCapsule() [2/2]

static void Quantum.GizmoUtils.DrawGizmosCapsule ( Matrix4x4  matrix,
float  radius,
float  extent,
Color  color,
QuantumGizmoStyle  style = default 
)
inlinestatic

Draws a capsule gizmo in the Scene view using Handles.

Parameters
matrixThe matrix of the capsule.
radiusThe radius of the capsule.
extentThe height extent of the capsule.
colorThe color of the capsule.
styleOptional gizmo style.

Member Data Documentation

◆ DefaultArrowHeadLength

const float Quantum.GizmoUtils.DefaultArrowHeadLength = 0.25f
static

The default arrow head length.

◆ DefaultArrowHeadAngle

const float Quantum.GizmoUtils.DefaultArrowHeadAngle = 25.0f
static

The default arrow head angle.