API reference

CircleSurface Class

Extends MonoBehaviour
Implements ISurfacePatch
Used for interaction with circular surfaces.
Computes the closest world point on a coordinate plane defined by the X and Y axes of the transform, within a provided radius from the transform’s origin.

Properties

BackingSurface : ISurface
[Get]
The backing surface for this ISurfacePatch.
Used correctly, this backing surface is a strict geometric superset of the space defined by ISurfacePatch itself. In other words, for every spatial query against the ISurfacePatch for which a solution exists (a raycast that hits the surface, for example), that same solution should be a valid solution to the same query for the BackingSurface; however, there may exist spatial queries for which the ISurfacePatch has no solution, but a solution exists for the BackingSurface.
Signature
ISurface BackingSurface
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=0)
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
InjectAllCircleProximityField ( planeSurface )
Signature
void InjectAllCircleProximityField(PlaneSurface planeSurface)
Parameters
planeSurface: PlaneSurface
Returns
void
InjectAllCircleSurface ( planeSurface )
Signature
void InjectAllCircleSurface(PlaneSurface planeSurface)
Parameters
planeSurface: PlaneSurface
Returns
void
InjectOptionalRadius ( radius )
Signature
void InjectOptionalRadius(float radius)
Parameters
radius: float
Returns
void
InjectPlaneSurface ( planeSurface )
Signature
void InjectPlaneSurface(PlaneSurface planeSurface)
Parameters
planeSurface: PlaneSurface
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=0)
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