API reference

CylinderSurface Class

Extends MonoBehaviour
Implements ISurface, IBounds
Used for interaction with cylindrical surfaces such as a curved UI.

Protected Fields

_started : bool
Signature
bool _started

Properties

Bounds : Bounds
[Get]
The world space axis-aligned bounding box (AABB)
Signature
Bounds Bounds
Cylinder : Cylinder
[Get]
Signature
Cylinder Cylinder
Facing : NormalFacing
[Get][Set]
Signature
NormalFacing Facing
Height : float
[Get][Set]
Signature
float Height
IsValid : bool
[Get]
Signature
bool IsValid
Radius : float
[Get]
Signature
float Radius
Transform : Transform
[Get]
A 3D transform associated with the surface.
This transform defines a space which serves as a consistent frame of reference for operations involving the surface, which is particular important for surfaces which can move. For example, consider the screen of a virtual tablet which can be held and manipulated, but also touched and poked. Even as the tablet moves through space, poke interactions on its screen should be calculated from the screen's perspective, not from the world's perspective: if a finger is held still and the tablet moved forward to touch it, from the tablet's perspective the finger moved to the screen, and thus the interaction is a poke. This transform provides the frame of reference that facilitates these sorts of calculations.
Signature
Transform Transform

Protected Methods

Start ()
Signature
virtual void Start()
Returns
void

Methods

ClosestSurfacePoint ( point , hit , maxDistance )
Find the nearest point to the surface.
The arguments and outputs of this operation are in world space.
Signature
bool ClosestSurfacePoint(in Vector3 point, out SurfaceHit hit, float maxDistance)
Parameters
point: in Vector3  The point, in world space, for which the nearest point on the surface must be found
hit: out SurfaceHit  The returned hit data in world space if a nearest point could be found, default otherwise
maxDistance: float  If greater than zero, maximum distance of check; if zero distance is unconstrained
Returns
bool  True if the racyast hit the surface, false otherwise
InjectAllCylinderSurface ( facing , cylinder , height )
Signature
void InjectAllCylinderSurface(NormalFacing facing, Cylinder cylinder, float height)
Parameters
facing: NormalFacing
cylinder: Cylinder
height: float
Returns
void
InjectCylinder ( cylinder )
Signature
void InjectCylinder(Cylinder cylinder)
Parameters
cylinder: Cylinder
Returns
void
InjectHeight ( height )
Signature
void InjectHeight(float height)
Parameters
height: float
Returns
void
InjectNormalFacing ( facing )
Signature
void InjectNormalFacing(NormalFacing facing)
Parameters
facing: NormalFacing
Returns
void
Raycast ( ray , hit , maxDistance )
Raycast to the surface with an optional maximum distance value.
The arguments and outputs of this operation are in world space.
Signature
bool Raycast(in Ray ray, out SurfaceHit hit, float maxDistance)
Parameters
ray: in Ray  The ray to cast, with position and direction both defined in world space
hit: out SurfaceHit  The returned hit data in world space if the raycast hit the surface, default otherwise
maxDistance: float  If greater than zero, maximum distance of raycast; if zero, distance is unconstrained
Returns
bool  True if the raycast hit the surface, false otherwise

Inner Enum

NormalFacing Enum

Enumeration Constants

MemberDescription
Any
Raycast hit will register on the outside or inside of the cylinder, whichever is hit first.
In
Raycasts will pass through the outside of the cylinder and hit the inside wall.
Out
Raycast against the outside wall of the cylinder. In this mode, raycasts with an origin inside the cylinder will always fail.