Tanoda
Leap.Unity.Interaction.InteractionManager Class Reference
Inheritance diagram for Leap.Unity.Interaction.InteractionManager:
Leap.Unity.Interaction.IInternalInteractionManager Leap.Unity.RuntimeGizmos.IRuntimeGizmoComponent

Public Types

enum  MultiGraspHoldingMode { PreservePosePerController , ReinitializeOnAnyRelease }
 

Public Member Functions

void RegisterInteractionBehaviour (IInteractionBehaviour interactionObj)
 
bool UnregisterInteractionBehaviour (IInteractionBehaviour interactionObj)
 Returns true if the Interaction Behaviour was registered with this manager; otherwise returns false. The manager is guaranteed not to have the Interaction Behaviour registered after calling this method. More...
 
bool IsBehaviourRegistered (IInteractionBehaviour interactionObj)
 
void TransformAheadByFixedUpdate (Vector3 position, Quaternion rotation, out Vector3 newPosition, out Quaternion newRotation)
 Transforms a position and rotation ahead by one FixedUpdate based on the prior motion of the InteractionManager. More...
 
void TransformAheadByFixedUpdate (Vector3 position, out Vector3 newPosition)
 Transforms a position ahead by one FixedUpdate based on the prior motion (position AND rotation) of the InteractionManager. More...
 
int GetInteractionLayerMask ()
 Returns a layer mask containing all layers that might contain interaction objects. More...
 
void OnDrawRuntimeGizmos (RuntimeGizmoDrawer drawer)
 
void NotifyIntObjAddedInteractionLayer (IInteractionBehaviour intObj, int layer, bool refreshImmediately=true)
 
void NotifyIntObjRemovedInteractionLayer (IInteractionBehaviour intObj, int layer, bool refreshImmediately=true)
 
void NotifyIntObjAddedNoContactLayer (IInteractionBehaviour intObj, int layer, bool refreshImmediately=true)
 
void NotifyIntObjRemovedNoContactLayer (IInteractionBehaviour intObj, int layer, bool refreshImmediately=true)
 
void RefreshLayersNow ()
 
void OnDrawRuntimeGizmos (RuntimeGizmoDrawer drawer)
 

Public Attributes

float hoverActivationRadius = 0.2F
 
float touchActivationRadius = 0.075F
 
MultiGraspHoldingMode multiGraspHoldingMode = MultiGraspHoldingMode.PreservePosePerController
 
Action OnGraphicalUpdate = () => { }
 
Action OnPrePhysicalUpdate = () => { }
 
Action OnPostPhysicalUpdate = () => { }
 
List< PhysicsUtility.SoftContact_softContacts = new List<PhysicsUtility.SoftContact>(80)
 Stores data for implementing Soft Contact for interaction controllers. More...
 
Dictionary< Rigidbody, PhysicsUtility.Velocities_softContactOriginalVelocities = new Dictionary<Rigidbody, PhysicsUtility.Velocities>(5)
 Stores data for implementing Soft Contact for interaction controllers. More...
 

Protected Member Functions

void generateAutomaticLayers ()
 

Protected Attributes

bool _autoGenerateLayers = true
 
SingleLayer _templateLayer = 0
 
SingleLayer _interactionLayer = 0
 
SingleLayer _interactionNoContactLayer = 0
 
SingleLayer _contactBoneLayer = 0
 

Properties

ReadonlyHashSet< InteractionControllerinteractionControllers [get]
 Gets the list of interaction controllers managed by this InteractionManager. More...
 
bool autoGenerateLayers [get]
 Gets whether auto-generate layers was enabled for this Interaction Manager. More...
 
SingleLayer templateLayer [get]
 
SingleLayer interactionLayer [get]
 
SingleLayer interactionNoContactLayer [get]
 
SingleLayer contactBoneLayer [get]
 
float WorldHoverActivationRadius [get]
 Interaction objects further than this distance from a given controller's hover point will not be considered for any hover interactions with that controller. More...
 
float WorldTouchActivationRadius [get]
 Interaction objects further than this distance from a given controller's hover point will not be considered for any contact or grasping interactions with that controller. More...
 
float SimulationScale [get]
 A scale that can be used to appropriately transform distances that otherwise expect one Unity unit to correspond to one meter. More...
 
ReadonlyHashSet< IInteractionBehaviourinteractionObjects [get]
 Gets a set of all interaction objects currently registered with this Interaction Manager. More...
 
Dictionary< Rigidbody, IInteractionBehaviourinteractionObjectBodies [get]
 Maps a Rigidbody to its attached interaction object, if the Rigidbody is part of and interaction object. More...
 
Dictionary< Rigidbody, ContactBonecontactBoneBodies [get]
 Maps a Rigidbody to its attached ContactBone, if the Rigidbody is part of an interaction controller. More...
 
static InteractionManager instance [get, set]
 Often, only one InteractionManager is necessary per Unity scene. This property will contain that InteractionManager as soon as its Awake() method is called. Using more than one InteractionManager is valid, but be sure to assign any InteractionBehaviour's desired manager appropriately. More...
 
bool hasMovingFrameOfReference [get]
 

Detailed Description

Definition at line 24 of file InteractionManager.cs.

Member Enumeration Documentation

◆ MultiGraspHoldingMode

Enumerator
PreservePosePerController 
ReinitializeOnAnyRelease 

Definition at line 60 of file InteractionManager.cs.

Member Function Documentation

◆ generateAutomaticLayers()

void Leap.Unity.Interaction.InteractionManager.generateAutomaticLayers ( )
protected

Definition at line 850 of file InteractionManager.cs.

◆ GetInteractionLayerMask()

int Leap.Unity.Interaction.InteractionManager.GetInteractionLayerMask ( )

Returns a layer mask containing all layers that might contain interaction objects.

Definition at line 911 of file InteractionManager.cs.

◆ IsBehaviourRegistered()

bool Leap.Unity.Interaction.InteractionManager.IsBehaviourRegistered ( IInteractionBehaviour  interactionObj)

Definition at line 750 of file InteractionManager.cs.

◆ OnDrawRuntimeGizmos()

void Leap.Unity.Interaction.InteractionManager.OnDrawRuntimeGizmos ( RuntimeGizmoDrawer  drawer)

◆ RegisterInteractionBehaviour()

void Leap.Unity.Interaction.InteractionManager.RegisterInteractionBehaviour ( IInteractionBehaviour  interactionObj)

Definition at line 727 of file InteractionManager.cs.

◆ TransformAheadByFixedUpdate() [1/2]

void Leap.Unity.Interaction.InteractionManager.TransformAheadByFixedUpdate ( Vector3  position,
out Vector3  newPosition 
)

Transforms a position ahead by one FixedUpdate based on the prior motion (position AND rotation) of the InteractionManager.

This method is used to support having the player in a moving frame of reference.

Definition at line 794 of file InteractionManager.cs.

◆ TransformAheadByFixedUpdate() [2/2]

void Leap.Unity.Interaction.InteractionManager.TransformAheadByFixedUpdate ( Vector3  position,
Quaternion  rotation,
out Vector3  newPosition,
out Quaternion  newRotation 
)

Transforms a position and rotation ahead by one FixedUpdate based on the prior motion of the InteractionManager.

This method is used to support having the player in a moving frame of reference.

Definition at line 781 of file InteractionManager.cs.

◆ UnregisterInteractionBehaviour()

bool Leap.Unity.Interaction.InteractionManager.UnregisterInteractionBehaviour ( IInteractionBehaviour  interactionObj)

Returns true if the Interaction Behaviour was registered with this manager; otherwise returns false. The manager is guaranteed not to have the Interaction Behaviour registered after calling this method.

Definition at line 737 of file InteractionManager.cs.

Member Data Documentation

◆ _autoGenerateLayers

bool Leap.Unity.Interaction.InteractionManager._autoGenerateLayers = true
protected

Definition at line 76 of file InteractionManager.cs.

◆ _contactBoneLayer

SingleLayer Leap.Unity.Interaction.InteractionManager._contactBoneLayer = 0
protected

Definition at line 109 of file InteractionManager.cs.

◆ _interactionLayer

SingleLayer Leap.Unity.Interaction.InteractionManager._interactionLayer = 0
protected

Definition at line 94 of file InteractionManager.cs.

◆ _interactionNoContactLayer

SingleLayer Leap.Unity.Interaction.InteractionManager._interactionNoContactLayer = 0
protected

Definition at line 102 of file InteractionManager.cs.

◆ _softContactOriginalVelocities

Dictionary<Rigidbody, PhysicsUtility.Velocities> Leap.Unity.Interaction.InteractionManager._softContactOriginalVelocities = new Dictionary<Rigidbody, PhysicsUtility.Velocities>(5)

Stores data for implementing Soft Contact for interaction controllers.

Definition at line 815 of file InteractionManager.cs.

◆ _softContacts

List<PhysicsUtility.SoftContact> Leap.Unity.Interaction.InteractionManager._softContacts = new List<PhysicsUtility.SoftContact>(80)

Stores data for implementing Soft Contact for interaction controllers.

Definition at line 808 of file InteractionManager.cs.

◆ _templateLayer

SingleLayer Leap.Unity.Interaction.InteractionManager._templateLayer = 0
protected

Definition at line 86 of file InteractionManager.cs.

◆ hoverActivationRadius

float Leap.Unity.Interaction.InteractionManager.hoverActivationRadius = 0.2F

Definition at line 48 of file InteractionManager.cs.

◆ multiGraspHoldingMode

MultiGraspHoldingMode Leap.Unity.Interaction.InteractionManager.multiGraspHoldingMode = MultiGraspHoldingMode.PreservePosePerController

Definition at line 65 of file InteractionManager.cs.

◆ OnGraphicalUpdate

Action Leap.Unity.Interaction.InteractionManager.OnGraphicalUpdate = () => { }

Definition at line 122 of file InteractionManager.cs.

◆ OnPostPhysicalUpdate

Action Leap.Unity.Interaction.InteractionManager.OnPostPhysicalUpdate = () => { }

Definition at line 124 of file InteractionManager.cs.

◆ OnPrePhysicalUpdate

Action Leap.Unity.Interaction.InteractionManager.OnPrePhysicalUpdate = () => { }

Definition at line 123 of file InteractionManager.cs.

◆ touchActivationRadius

float Leap.Unity.Interaction.InteractionManager.touchActivationRadius = 0.075F

Definition at line 58 of file InteractionManager.cs.

Property Documentation

◆ autoGenerateLayers

bool Leap.Unity.Interaction.InteractionManager.autoGenerateLayers
get

Gets whether auto-generate layers was enabled for this Interaction Manager.

Definition at line 80 of file InteractionManager.cs.

◆ contactBoneBodies

Dictionary<Rigidbody, ContactBone> Leap.Unity.Interaction.InteractionManager.contactBoneBodies
get

Maps a Rigidbody to its attached ContactBone, if the Rigidbody is part of an interaction controller.

Definition at line 183 of file InteractionManager.cs.

◆ contactBoneLayer

SingleLayer Leap.Unity.Interaction.InteractionManager.contactBoneLayer
get

Definition at line 110 of file InteractionManager.cs.

◆ hasMovingFrameOfReference

bool Leap.Unity.Interaction.InteractionManager.hasMovingFrameOfReference
get

Definition at line 758 of file InteractionManager.cs.

◆ instance

InteractionManager Leap.Unity.Interaction.InteractionManager.instance
staticgetset

Often, only one InteractionManager is necessary per Unity scene. This property will contain that InteractionManager as soon as its Awake() method is called. Using more than one InteractionManager is valid, but be sure to assign any InteractionBehaviour's desired manager appropriately.

By default, this static property contains the first InteractionManager that has had its Awake() method called in the current scene. If an InteractionBehaviourBase does not have a non-null interactionManager by the time it has Start() called, it will default to using the InteractionManager referenced here.

If you have multiple InteractionManagers in your scene, you should be sure to assign InteractionBehaviours' managers appropriately. If you instantiate an InteractionBehaviour at runtime, you should assign its InteractionManager right after you instantiate it.

Definition at line 213 of file InteractionManager.cs.

◆ interactionControllers

ReadonlyHashSet<InteractionController> Leap.Unity.Interaction.InteractionManager.interactionControllers
get

Gets the list of interaction controllers managed by this InteractionManager.

Definition at line 35 of file InteractionManager.cs.

◆ interactionLayer

SingleLayer Leap.Unity.Interaction.InteractionManager.interactionLayer
get

Definition at line 95 of file InteractionManager.cs.

◆ interactionNoContactLayer

SingleLayer Leap.Unity.Interaction.InteractionManager.interactionNoContactLayer
get

Definition at line 103 of file InteractionManager.cs.

◆ interactionObjectBodies

Dictionary<Rigidbody, IInteractionBehaviour> Leap.Unity.Interaction.InteractionManager.interactionObjectBodies
get

Maps a Rigidbody to its attached interaction object, if the Rigidbody is part of and interaction object.

Definition at line 169 of file InteractionManager.cs.

◆ interactionObjects

ReadonlyHashSet<IInteractionBehaviour> Leap.Unity.Interaction.InteractionManager.interactionObjects
get

Gets a set of all interaction objects currently registered with this Interaction Manager.

Definition at line 160 of file InteractionManager.cs.

◆ SimulationScale

float Leap.Unity.Interaction.InteractionManager.SimulationScale
get

A scale that can be used to appropriately transform distances that otherwise expect one Unity unit to correspond to one meter.

Definition at line 149 of file InteractionManager.cs.

◆ templateLayer

SingleLayer Leap.Unity.Interaction.InteractionManager.templateLayer
get

Definition at line 87 of file InteractionManager.cs.

◆ WorldHoverActivationRadius

float Leap.Unity.Interaction.InteractionManager.WorldHoverActivationRadius
get

Interaction objects further than this distance from a given controller's hover point will not be considered for any hover interactions with that controller.

Definition at line 136 of file InteractionManager.cs.

◆ WorldTouchActivationRadius

float Leap.Unity.Interaction.InteractionManager.WorldTouchActivationRadius
get

Interaction objects further than this distance from a given controller's hover point will not be considered for any contact or grasping interactions with that controller.

Definition at line 143 of file InteractionManager.cs.


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