Class TwoHandScaleLogic
Implements a scale logic that will scale an object based on the ratio of the distance between hands. object_scale = start_object_scale * curr_hand_dist / start_hand_dist
Usage: When a manipulation starts, call Setup. Call Update any time to update the move logic and get a new rotation for the object.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Physics
Assembly: cs.temp.dll.dll
Syntax
public class TwoHandScaleLogic
Methods
Setup(Dictionary<UInt32, Vector3>, Transform)
Initialize system with source info from controllers/hands
Declaration
public virtual void Setup(Dictionary<uint, Vector3> handsPressedMap, Transform manipulationRoot)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<UInt32, Vector3> | handsPressedMap | Dictionary that maps inputSources to states |
Transform | manipulationRoot | Transform of gameObject to be manipulated |
Setup(Vector3[], Transform)
Initialize system with source info from controllers/hands
Declaration
public virtual void Setup(Vector3[] handsPressedArray, Transform manipulationRoot)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | handsPressedArray | Array with positions of down pointers |
Transform | manipulationRoot | Transform of gameObject to be manipulated |
UpdateMap(Dictionary<UInt32, Vector3>)
update GameObject with new Scale state
Declaration
public virtual Vector3 UpdateMap(Dictionary<uint, Vector3> handsPressedMap)
Parameters
Type | Name | Description |
---|---|---|
Dictionary<UInt32, Vector3> | handsPressedMap |
Returns
Type | Description |
---|---|
Vector3 | a Vector3 describing the new Scale of the object being manipulated |
UpdateMap(Vector3[])
update GameObject with new Scale state
Declaration
public virtual Vector3 UpdateMap(Vector3[] handsPressedArray)
Parameters
Type | Name | Description |
---|---|---|
Vector3[] | handsPressedArray | Array with positions of down pointers, order should be the same as handsPressedArray provided in Setup |
Returns
Type | Description |
---|---|
Vector3 | a Vector3 describing the new Scale of the object being manipulated |