API reference

BezierGrabSurface Class

Extends MonoBehaviour
Implements IGrabSurface
Defines a series of points that specify paths along with the snapping pose is valid.
The points can be connected to the previous and/or next one, even looping, or completely isolated. When two or more consecutive points are connected, they define a continuous path. The Tangent can be used to specify the curve between two points. It is also possible to connect the last point with the first one to create a closed loop. The rotation at a point in the path is specified by interpolating the rotation of the starting and ending point of the current segment. When a point is not connected to any other point, it is considered as a single point in space.

Properties

ControlPoints : List< BezierControlPoint >
[Get]
Signature
List<BezierControlPoint> ControlPoints

Protected Methods

Reset ()
Signature
virtual void Reset()
Returns
void
Start ()
Signature
virtual void Start()
Returns
void

Methods

CalculateBestPoseAtSurface ( targetPose , bestPose , scoringModifier , relativeTo )
Finds the Pose at the surface that is the closest to the given pose.
Signature
GrabPoseScore CalculateBestPoseAtSurface(in Pose targetPose, out Pose bestPose, in PoseMeasureParameters scoringModifier, Transform relativeTo)
Parameters
targetPose: in Pose  The root pose to find the nearest to.
bestPose: out Pose  The best found pose at the surface.<
scoringModifier: in PoseMeasureParameters  Weight used to decide which target pose to select
relativeTo: Transform  Reference transform to measure the poses against
Returns
GrabPoseScore  The score indicating how good the found pose was, -1 for invalid result.
CalculateBestPoseAtSurface ( targetPose , offset , bestPose , scoringModifier , relativeTo )
Finds the Pose at the surface that is the closest to the given pose.
Signature
GrabPoseScore CalculateBestPoseAtSurface(in Pose targetPose, in Pose offset, out Pose bestPose, in PoseMeasureParameters scoringModifier, Transform relativeTo)
Parameters
targetPose: in Pose  The root pose to find the nearest to.
offset: in Pose  The offset from the root, for accurate scoring
bestPose: out Pose  The best found pose at the surface.<
scoringModifier: in PoseMeasureParameters  Weight used to decide which target pose to select
relativeTo: Transform  Reference transform to measure the poses against
Returns
GrabPoseScore  The score indicating how good the found pose was, -1 for invalid result.
CalculateBestPoseAtSurface ( targetRay , bestPose , relativeTo )
Finds the Pose at the surface that is the closest to the given ray.
Signature
bool CalculateBestPoseAtSurface(Ray targetRay, out Pose bestPose, Transform relativeTo)
Parameters
targetRay: Ray  Ray searching for the nearest snap pose
bestPose: out Pose  The best found pose at the surface.
relativeTo: Transform  Reference transform to measure the poses against
Returns
bool  True if the pose was found
CreateDuplicatedSurface ( gameObject )
Creates a new IGrabSurface under the selected gameobject with the same data as this one.
Signature
IGrabSurface CreateDuplicatedSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A clone of this IGrabSurface.
CreateMirroredSurface ( gameObject )
Creates a new IGrabSurface under the selected gameobject that is a mirror version of the current.
Signature
IGrabSurface CreateMirroredSurface(GameObject gameObject)
Parameters
gameObject: GameObject  The gameobject in which to place the new IGrabSurface.
Returns
IGrabSurface  A mirror of this IGrabSurface.
InjectAllBezierSurface ( controlPoints , relativeTo )
Signature
void InjectAllBezierSurface(List< BezierControlPoint > controlPoints, Transform relativeTo)
Parameters
controlPoints: List< BezierControlPoint >
relativeTo: Transform
Returns
void
InjectControlPoints ( controlPoints )
Signature
void InjectControlPoints(List< BezierControlPoint > controlPoints)
Parameters
controlPoints: List< BezierControlPoint >
Returns
void
InjectRelativeTo ( relativeTo )
Signature
void InjectRelativeTo(Transform relativeTo)
Parameters
relativeTo: Transform
Returns
void
MirrorPose ( gripPose , relativeTo )
Method for mirroring a Pose around the surface.
Different surfaces will prefer mirroring along different axis.
Signature
Pose MirrorPose(in Pose gripPose, Transform relativeTo)
Parameters
gripPose: in Pose  The Pose to be mirrored.
relativeTo: Transform  Reference transform to mirror the pose around
Returns
Pose  A new pose mirrored at this surface.

Static Methods

EvaluateBezier ( start , middle , end , t )
Signature
static Vector3 EvaluateBezier(Vector3 start, Vector3 middle, Vector3 end, float t)
Parameters
start: Vector3
middle: Vector3
end: Vector3
t: float
Returns
Vector3