Photon Quantum 3.0.0

Classes | Static Public Member Functions | List of all members
Quantum.Draw Class Reference

Issues a debug shape to be drawn in Unity. The shape drawing is based on the DEBUG define which is enabled in UnityEditor and development builds. Can be globally toggled of by using DebugDraw.IsEnabled in Unity. Different implementation can be attached using Init(Action<Draw.DebugRay>, Action<Draw.DebugLine>, Action<Draw.DebugCircle>, Action<Draw.DebugSphere>, Action<Draw.DebugRectangle>, Action<Draw.DebugBox>, Action<Draw.DebugCapsule>, Action). More...

Classes

struct  DebugBox
 Stores information to draw the debug shape box. More...
 
struct  DebugCapsule
 Stores information to draw the debug shape capsule. More...
 
struct  DebugCircle
 Stores information to draw the debug shape circle. More...
 
struct  DebugLine
 Stores information to draw the debug shape line. More...
 
struct  DebugRay
 Stores information to draw the debug shape ray. More...
 
struct  DebugRectangle
 Stores information to draw the debug shape rectangle. More...
 
struct  DebugSphere
 Stores information to draw the debug shape sphere. More...
 

Static Public Member Functions

static void Box (FPVector3 center, FPVector3 extents, FPQuaternion? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Obsolete: use Quad More...
 
static void Capsule (FPVector2 center, FP extent, FP radius, FP? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Draw a 2DD debug capsule in the view. Only included in DEBUG builds. More...
 
static void Capsule (FPVector2 center, Shape2D.CapsuleShape capsule, FP? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Draw a 2D debug capsule in the view. Only included in DEBUG builds. More...
 
static void Capsule (FPVector3 center, FP extent, FP radius, FPQuaternion? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug capsule in the view. Only included in DEBUG builds. More...
 
static void Capsule (FPVector3 center, Shape3D.CapsuleShape capsule, FPQuaternion? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug capsule in the view. Only included in DEBUG builds. More...
 
static void Circle (FPVector2 center, FP radius, ColorRGBA? color=null, Boolean wire=false)
 Draw a 2D debug circle in the view. Only included in DEBUG builds. More...
 
static void Circle (FPVector3 center, FP radius, ColorRGBA? color=null, Boolean wire=false)
 Obsolete: use Circle(FPVector3 center, FP radius, FPQuaternion rotation) More...
 
static void Circle (FPVector3 center, FP radius, FPQuaternion? rotation=null, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug circle in the view. Only included in DEBUG builds. More...
 
static void Clear ()
 Executes the clear action. More...
 
static void Init (Action< DebugRay > drawRay, Action< DebugLine > drawLine, Action< DebugCircle > drawCircle, Action< DebugSphere > drawSphere, Action< DebugRectangle > drawRectangle, Action< DebugBox > drawBox, Action clear)
 Obsolete. Use the Init method with the capsule drawer. More...
 
static void Init (Action< DebugRay > drawRay, Action< DebugLine > drawLine, Action< DebugCircle > drawCircle, Action< DebugSphere > drawSphere, Action< DebugRectangle > drawRectangle, Action< DebugBox > drawBox, Action< DebugCapsule > drawCapsule, Action clear)
 Initializes the debug draw system with the given draw functions. More...
 
static void Line (FPVector2 start, FPVector2 end, ColorRGBA? color=null)
 Draw a 2D debug line in the view. Only included in DEBUG builds. More...
 
static void Line (FPVector3 start, FPVector3 end, ColorRGBA? color=null)
 Draw a 3D debug line in the view. Only included in DEBUG builds. More...
 
static void Quad (FPVector3 center, FPVector3 extents, FPQuaternion rotation, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug quad in the view. Only included in DEBUG builds. More...
 
static void Ray (FPVector2 origin, FPVector2 direction, ColorRGBA? color=null)
 Draw a 2D debug ray in the view. Only included in DEBUG builds. More...
 
static void Ray (FPVector3 origin, FPVector3 direction, ColorRGBA? color=null)
 Draw a 3D debug ray in the view. Only included in DEBUG builds. More...
 
static void Rectangle (FPVector2 center, FPVector2 size, FP rotation, ColorRGBA? color=null, Boolean wire=false)
 Draw a 2D debug rectangle in the view. Only included in DEBUG builds. More...
 
static void Rectangle (FPVector3 center, FPVector2 size, FP rotation, ColorRGBA? color=null, Boolean wire=false)
 Obsolete: use Rectangle(FPVector3 center, FPVector2 size, FPQuaternion rotation) or Rectangle(FPVector2 center, FPVector2 size, FP rotation) More...
 
static void Rectangle (FPVector3 center, FPVector2 size, FPQuaternion rotation, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug rectangle in the view. Only included in DEBUG builds. More...
 
static void Reset ()
 Remove all draw actions. More...
 
static unsafe void Shape (FrameBase f, ref Shape2D shape, FPVector2 center, FP? rotation=null, ColorRGBA? color=null, bool wire=false)
 Draw a shape from a 2D shape config. Only included in DEBUG builds. More...
 
static unsafe void Shape (FrameBase f, ref Shape3D shape, FPVector3 center, FPQuaternion? rotation=null, ColorRGBA? color=null, bool wire=false)
 Draw a shape from a 3D shape config. Only included in DEBUG builds. More...
 
static void Sphere (FPVector3 center, FP radius, ColorRGBA? color=null, Boolean wire=false)
 Draw a 3D debug sphere in the view. Only included in DEBUG builds. More...
 
static void WireBox (FPVector3 center, FPVector3 extents, FPQuaternion? rotation=null, ColorRGBA? color=null)
 Obsolete: use Quad More...
 

Detailed Description

Issues a debug shape to be drawn in Unity. The shape drawing is based on the DEBUG define which is enabled in UnityEditor and development builds. Can be globally toggled of by using DebugDraw.IsEnabled in Unity. Different implementation can be attached using Init(Action<Draw.DebugRay>, Action<Draw.DebugLine>, Action<Draw.DebugCircle>, Action<Draw.DebugSphere>, Action<Draw.DebugRectangle>, Action<Draw.DebugBox>, Action<Draw.DebugCapsule>, Action).

Member Function Documentation

◆ Init() [1/2]

static void Quantum.Draw.Init ( Action< DebugRay drawRay,
Action< DebugLine drawLine,
Action< DebugCircle drawCircle,
Action< DebugSphere drawSphere,
Action< DebugRectangle drawRectangle,
Action< DebugBox drawBox,
Action< DebugCapsule drawCapsule,
Action  clear 
)
inlinestatic

Initializes the debug draw system with the given draw functions.

Parameters
drawRayDraw ray method
drawLineDraw line method
drawCircleDraw circle method
drawSphereDraw sphere method
drawRectangleDraw rectangle method
drawBoxDraw box method
drawCapsuleDraw capsule method
clearClear all queued debug shapes

◆ Init() [2/2]

static void Quantum.Draw.Init ( Action< DebugRay drawRay,
Action< DebugLine drawLine,
Action< DebugCircle drawCircle,
Action< DebugSphere drawSphere,
Action< DebugRectangle drawRectangle,
Action< DebugBox drawBox,
Action  clear 
)
inlinestatic

Obsolete. Use the Init method with the capsule drawer.

◆ Reset()

static void Quantum.Draw.Reset ( )
inlinestatic

Remove all draw actions.

◆ Clear()

static void Quantum.Draw.Clear ( )
inlinestatic

Executes the clear action.

◆ Shape() [1/2]

static unsafe void Quantum.Draw.Shape ( FrameBase  f,
ref Shape2D  shape,
FPVector2  center,
FP rotation = null,
ColorRGBA color = null,
bool  wire = false 
)
inlinestatic

Draw a shape from a 2D shape config. Only included in DEBUG builds.

Parameters
fThe frame
shapeShape reference to draw
centerThe world position of the shape
rotationThe rotation of the shape, can be null
colorThe color, can be null
wireDraw the shape as wireframe

◆ Shape() [2/2]

static unsafe void Quantum.Draw.Shape ( FrameBase  f,
ref Shape3D  shape,
FPVector3  center,
FPQuaternion rotation = null,
ColorRGBA color = null,
bool  wire = false 
)
inlinestatic

Draw a shape from a 3D shape config. Only included in DEBUG builds.

Parameters
fThe frame
shapeShape reference to draw
centerThe world position of the shape
rotationThe rotation of the shape, can be null
colorThe color, can be null
wireDraw the shape as wireframe

◆ Ray() [1/2]

static void Quantum.Draw.Ray ( FPVector2  origin,
FPVector2  direction,
ColorRGBA color = null 
)
inlinestatic

Draw a 2D debug ray in the view. Only included in DEBUG builds.

Parameters
originWorld origin of the ray.
directionDirection of the ray.
colorRay color

◆ Ray() [2/2]

static void Quantum.Draw.Ray ( FPVector3  origin,
FPVector3  direction,
ColorRGBA color = null 
)
inlinestatic

Draw a 3D debug ray in the view. Only included in DEBUG builds.

Parameters
originWorld origin of the ray.
directionDirection of the ray.
colorRay color

◆ Line() [1/2]

static void Quantum.Draw.Line ( FPVector2  start,
FPVector2  end,
ColorRGBA color = null 
)
inlinestatic

Draw a 2D debug line in the view. Only included in DEBUG builds.

Parameters
startWorld start position
endWorld end position
colorLine color

◆ Line() [2/2]

static void Quantum.Draw.Line ( FPVector3  start,
FPVector3  end,
ColorRGBA color = null 
)
inlinestatic

Draw a 3D debug line in the view. Only included in DEBUG builds.

Parameters
startWorld start position
endWorld end position
colorLine color

◆ Circle() [1/3]

static void Quantum.Draw.Circle ( FPVector2  center,
FP  radius,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 2D debug circle in the view. Only included in DEBUG builds.

Parameters
centerWorld position of the circle center
radiusRadius of the circle
colorCircle color
wireDraw the circle as wireframe

◆ Circle() [2/3]

static void Quantum.Draw.Circle ( FPVector3  center,
FP  radius,
FPQuaternion rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug circle in the view. Only included in DEBUG builds.

Parameters
centerWorld position of the circle center
radiusRadius of the circle
rotationRotation of the circle
colorCircle color
wireDraw the circle as wireframe

◆ Sphere()

static void Quantum.Draw.Sphere ( FPVector3  center,
FP  radius,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug sphere in the view. Only included in DEBUG builds.

Parameters
centerWorld position of the sphere center
radiusSphere radius
colorSphere color
wireDraw the sphere as wireframe

◆ Rectangle() [1/3]

static void Quantum.Draw.Rectangle ( FPVector2  center,
FPVector2  size,
FP  rotation,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 2D debug rectangle in the view. Only included in DEBUG builds.

Parameters
centerWorld position of the rectangle center
sizeRectangle size
rotationRectangle rotation
colorRectangle color
wireDraw the rectangle as wireframe

◆ Rectangle() [2/3]

static void Quantum.Draw.Rectangle ( FPVector3  center,
FPVector2  size,
FPQuaternion  rotation,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug rectangle in the view. Only included in DEBUG builds.

Parameters
centerWorld position of the rectangle center
sizeRectangle size
rotationRectangle rotation
colorRectangle color
wireDraw the rectangle as wireframe

◆ Quad()

static void Quantum.Draw.Quad ( FPVector3  center,
FPVector3  extents,
FPQuaternion  rotation,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug quad in the view. Only included in DEBUG builds.

Parameters
centerThe world position of the quad center
extentsThe extents of the quad
rotationThe rotation of the quad
colorThe quad color
wireDraw the quad as wireframe

◆ Capsule() [1/4]

static void Quantum.Draw.Capsule ( FPVector2  center,
FP  extent,
FP  radius,
FP rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 2DD debug capsule in the view. Only included in DEBUG builds.

Parameters
centerThe center of the capsule
extentThe extents of the capsule
radiusThe radius of the capsule
rotationThe rotation of the capsule
colorThe capsule color
wireDraw the capsule as wireframe

◆ Capsule() [2/4]

static void Quantum.Draw.Capsule ( FPVector2  center,
Shape2D.CapsuleShape  capsule,
FP rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 2D debug capsule in the view. Only included in DEBUG builds.

Parameters
centerThe center of the capsule
capsuleThe capsule shape
rotationThe rotation of the capsule
colorThe capsule color
wireDraw the capsule as wireframe

◆ Capsule() [3/4]

static void Quantum.Draw.Capsule ( FPVector3  center,
FP  extent,
FP  radius,
FPQuaternion rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug capsule in the view. Only included in DEBUG builds.

Parameters
centerThe center of the capsule
extentThe extents of the capsule
radiusThe radius of the capsule
rotationThe rotation of the capsule
colorThe capsule color
wireDraw the capsule as wireframe

◆ Capsule() [4/4]

static void Quantum.Draw.Capsule ( FPVector3  center,
Shape3D.CapsuleShape  capsule,
FPQuaternion rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Draw a 3D debug capsule in the view. Only included in DEBUG builds.

Parameters
centerThe center of the capsule
capsuleCapsule shape
rotationThe rotation of the capsule
colorThe capsule color
wireDraw the capsule as wireframe

◆ WireBox()

static void Quantum.Draw.WireBox ( FPVector3  center,
FPVector3  extents,
FPQuaternion rotation = null,
ColorRGBA color = null 
)
inlinestatic

Obsolete: use Quad

◆ Box()

static void Quantum.Draw.Box ( FPVector3  center,
FPVector3  extents,
FPQuaternion rotation = null,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Obsolete: use Quad

◆ Rectangle() [3/3]

static void Quantum.Draw.Rectangle ( FPVector3  center,
FPVector2  size,
FP  rotation,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Obsolete: use Rectangle(FPVector3 center, FPVector2 size, FPQuaternion rotation) or Rectangle(FPVector2 center, FPVector2 size, FP rotation)

◆ Circle() [3/3]

static void Quantum.Draw.Circle ( FPVector3  center,
FP  radius,
ColorRGBA color = null,
Boolean  wire = false 
)
inlinestatic

Obsolete: use Circle(FPVector3 center, FP radius, FPQuaternion rotation)