HandPosing
A tool for quickly authoring hand poses to objects in VR using hand-tracking
HandPosing.SnapRecording.SnapPoint Class Reference

A single snap point. When not using different hand-scales this is the main type of BaseSnapPoint to use. More...

Inheritance diagram for HandPosing.SnapRecording.SnapPoint:
HandPosing.SnapRecording.BaseSnapPoint

Public Member Functions

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...
 

Static Public Member Functions

static SnapPoint Create (Transform parent)
 Creates a new SnapPoint under the given object More...
 

Public Attributes

string CreateMirror
 Creates an Inspector button to create a mirrored duplicate of this point. More...
 

Properties

float Scale [get]
 Scale of the recorded hand. More...
 
- Properties inherited from HandPosing.SnapRecording.BaseSnapPoint
Transform RelativeTo [get]
 General getter for the transform of the object this snap point refers to More...
 
bool SnapsBack [get]
 General getter indicating if the hand can reach for the object and then move back to the user-tracked position. More...
 
float SlideThresold [get]
 General getter indicatig how firmly to held the object so the hand does not slide throught the surface. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

A single snap point. When not using different hand-scales this is the main type of BaseSnapPoint to use.

Member Function Documentation

◆ 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
userPoseHand pose to compare to the snap point.
scoreWeightHow much to score the position or the rotation difference.
directionConsider only poses at the surface using the provided direction.
scaleThe 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
parentThe relative object for the snap point
Returns
An non-populated SnapPoint

◆ DestroyImmediate()

override void HandPosing.SnapRecording.SnapPoint.DestroyImmediate ( )
virtual

Destroys this snap point, to be called from the Inspector only.

Implements HandPosing.SnapRecording.BaseSnapPoint.

◆ LoadData()

void HandPosing.SnapRecording.SnapPoint.LoadData ( SnapPointData  data,
Transform  relativeTo 
)

Populates the SnapPoint with the serialized data version

Parameters
dataThe serialized data for the SnapPoint.
relativeToThe object the data refers to.

◆ LoadGhost()

void HandPosing.SnapRecording.SnapPoint.LoadGhost ( HandGhostProvider  ghostProvider)

Creates a visual representation of the Hand position at this point using a Hand ghost

Parameters
ghostProviderThe 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
worldPointPoint to measure distane to the surface
scaleThe desired scale of the hand.
Returns
The nearest point in World coordinates

Implements HandPosing.SnapRecording.BaseSnapPoint.

◆ SaveData()

SnapPointData HandPosing.SnapRecording.SnapPoint.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
snapPoseRelative hand position/rotation.
relativeToReference coordinates for the pose.

Member Data Documentation

◆ CreateMirror

string HandPosing.SnapRecording.SnapPoint.CreateMirror

Creates an Inspector button to create a mirrored duplicate of this point.

Property Documentation

◆ Scale

float HandPosing.SnapRecording.SnapPoint.Scale
get

Scale of the recorded hand.


The documentation for this class was generated from the following file: