API reference
API reference
Select your platform
No SDKs available
No versions available

ISurface Interface

This interface represents a surface (two-dimensional topology) in 3D space in a very generalized way.
A wide variety of of surfaces can be represented in this way (planes, meshes, parametric curves, etc.), allowing logic built on top of this interface to be extremely versatile. Many Interaction SDK features make use of ISurface for their internal logic, and you should use this interface over less general types whenever practical.

Properties

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.

Member Functions

Raycast to the surface with an optional maximum distance value.
The arguments and outputs of this operation are in world space.
Parameters
ray
The ray to cast, with position and direction both defined in world space
hit
The returned hit data in world space if the raycast hit the surface, default otherwise
maxDistance
If greater than zero, maximum distance of raycast; if zero, distance is unconstrained
Returns
True if the raycast hit the surface, false otherwise
Find the nearest point to the surface.
The arguments and outputs of this operation are in world space.
Parameters
point
The point, in world space, for which the nearest point on the surface must be found
hit
The returned hit data in world space if a nearest point could be found, default otherwise
maxDistance
If greater than zero, maximum distance of check; if zero distance is unconstrained
Returns
True if the racyast hit the surface, false otherwise
Did you find this page helpful?
Thumbs up icon
Thumbs down icon