A single snap point. When not using different hand-scales this is the main type of BaseSnapPoint to use.
More...
|
SnapPoint | Mirror () |
| Generates a new SnapPoint that mirrors this one. Left hand becomes right hand and vice-versa. The mirror axis is defined by the surface of the snap point, if any, if none a best-guess is provided but note that it can then moved manually in the editor. More...
|
|
SnapPointData | SaveData () |
| Serializes the data of the SnapPoint so it can be stored More...
|
|
void | LoadData (SnapPointData data, Transform relativeTo) |
| Populates the SnapPoint with the serialized data version More...
|
|
void | SetPose (HandPose snapPose, Transform relativeTo) |
| Applies the given position/rotation to the SnapPoint More...
|
|
void | LoadGhost (HandGhostProvider ghostProvider) |
| Creates a visual representation of the Hand position at this point using a Hand ghost More...
|
|
override Vector3 | NearestInSurface (Vector3 worldPoint, float scale=1f) |
| Find the closes point at the snap surface. If there is no surface, the SnapPoint position itself is returned. If multiple scales are available, it will interpolate between the closest matches. More...
|
|
override ScoredHandPose | CalculateBestPose (HandPose userPose, float? scoreWeight=null, SnapDirection direction=SnapDirection.Any, float scale=1f) |
| Find the best valid hand-pose at this snap point. Remember that a snap point can actually have a whole surface the user can snap to. In some cases it can also have different hand scales with their surfaces, it will interpolate between the best available matches. More...
|
|
override void | DestroyImmediate () |
| Destroys this snap point, to be called from the Inspector only. More...
|
|
|
string | CreateMirror |
| Creates an Inspector button to create a mirrored duplicate of this point. More...
|
|
|
Protected Attributes inherited from HandPosing.SnapRecording.BaseSnapPoint |
Transform | relativeTo |
| The transform of the object this snap point refers to. Typically the parent. More...
|
|
bool | snapsBack |
| If true, the hand can be overriden to reach the object, and once it is grabbed it will move back (now holding it) to the user-tracking position. More...
|
|
float | slideThresold = 0f |
| Indicates how firmly the grab strength must be so the hand can slide. Normalised, a value of 1 will always slide, a value of 0.5 will start sliding only when the grab is half-released. More...
|
|
A single snap point. When not using different hand-scales this is the main type of BaseSnapPoint to use.
◆ CalculateBestPose()
override ScoredHandPose HandPosing.SnapRecording.SnapPoint.CalculateBestPose |
( |
HandPose |
userPose, |
|
|
float? |
scoreWeight = null , |
|
|
SnapDirection |
direction = SnapDirection.Any , |
|
|
float |
scale = 1f |
|
) |
| |
|
virtual |
Find the best valid hand-pose at this snap point. Remember that a snap point can actually have a whole surface the user can snap to. In some cases it can also have different hand scales with their surfaces, it will interpolate between the best available matches.
- Parameters
-
userPose | Hand pose to compare to the snap point. |
scoreWeight | How much to score the position or the rotation difference. |
direction | Consider only poses at the surface using the provided direction. |
scale | The desired scale of the hand to compare. |
- Returns
- The most similar valid HandPose at this SnapPoint
Implements HandPosing.SnapRecording.BaseSnapPoint.
◆ Create()
static SnapPoint HandPosing.SnapRecording.SnapPoint.Create |
( |
Transform |
parent | ) |
|
|
static |
Creates a new SnapPoint under the given object
- Parameters
-
parent | The relative object for the snap point |
- Returns
- An non-populated SnapPoint
◆ DestroyImmediate()
override void HandPosing.SnapRecording.SnapPoint.DestroyImmediate |
( |
| ) |
|
|
virtual |
◆ LoadData()
void HandPosing.SnapRecording.SnapPoint.LoadData |
( |
SnapPointData |
data, |
|
|
Transform |
relativeTo |
|
) |
| |
Populates the SnapPoint with the serialized data version
- Parameters
-
data | The serialized data for the SnapPoint. |
relativeTo | The object the data refers to. |
◆ LoadGhost()
Creates a visual representation of the Hand position at this point using a Hand ghost
- Parameters
-
ghostProvider | The prefabs collection for the ghosts generation |
◆ Mirror()
SnapPoint HandPosing.SnapRecording.SnapPoint.Mirror |
( |
| ) |
|
Generates a new SnapPoint that mirrors this one. Left hand becomes right hand and vice-versa. The mirror axis is defined by the surface of the snap point, if any, if none a best-guess is provided but note that it can then moved manually in the editor.
- Returns
- A new snapPoint for the opposite hand of this one
◆ NearestInSurface()
override Vector3 HandPosing.SnapRecording.SnapPoint.NearestInSurface |
( |
Vector3 |
worldPoint, |
|
|
float |
scale = 1f |
|
) |
| |
|
virtual |
Find the closes point at the snap surface. If there is no surface, the SnapPoint position itself is returned. If multiple scales are available, it will interpolate between the closest matches.
- Parameters
-
worldPoint | Point to measure distane to the surface |
scale | The desired scale of the hand. |
- Returns
- The nearest point in World coordinates
Implements HandPosing.SnapRecording.BaseSnapPoint.
◆ SaveData()
Serializes the data of the SnapPoint so it can be stored
- Returns
- The struct data to recreate the snap point
◆ SetPose()
void HandPosing.SnapRecording.SnapPoint.SetPose |
( |
HandPose |
snapPose, |
|
|
Transform |
relativeTo |
|
) |
| |
Applies the given position/rotation to the SnapPoint
- Parameters
-
snapPose | Relative hand position/rotation. |
relativeTo | Reference coordinates for the pose. |
◆ CreateMirror
string HandPosing.SnapRecording.SnapPoint.CreateMirror |
Creates an Inspector button to create a mirrored duplicate of this point.
◆ Scale
float HandPosing.SnapRecording.SnapPoint.Scale |
|
get |
Scale of the recorded hand.
The documentation for this class was generated from the following file:
- Runtime/SnapRecording/SnapPoint.cs