Tanoda
Leap.Unity.Interaction.ActivityManager< T > Class Template Reference

ActivityManager is a wrapper around PhysX sphere queries for arbitrary Unity objects. "Active" objects are objects found in the latest query. It's also possible to get the sets of objects that just began or stopped being active since the last query; this requires enabling the trackStateChanges setting. More...

Public Member Functions

 ActivityManager (float activationRadius, Func< Collider, T > filter)
 
void UpdateActivityQuery (Vector3? queryPosition, List< LeapSpace > spaces=null)
 

Public Attributes

float activationRadius
 The radius of the query in world-space. More...
 
int activationLayerMask = ~0
 The layer mask against which to query for active objects. The ActivityManager will only find objects in these layers. By default, the ActivityManager will query all layers, but this is highly inefficient. More...
 
Func< int > activationLayerFunction = null
 This function, if set to a non-null value, overrides the activationLayerMask setting with the result of calling the function. Use this if your application state will modify the layer mask to use for the activity manager. More...
 
Func< Collider, T > filter = null
 This is the function by which the ActivityManager converts the Colliders it finds through PhysX queries into Ts to be placed in the ActiveObjects set. More...
 
bool trackStateChanges = false
 If set to true, BeganActive and EndedActive will be calculated and populated every time a new query occurs. More...
 

Properties

HashSet< T > ActiveObjects [get]
 Returns the currently "active" objects – objects that were within the latest sphere query. More...
 
HashSet< T > BeganActive [get]
 If trackStateChanges is enabled (on by default), contains the objects that just started being active since the last query. More...
 
HashSet< T > EndedActive [get]
 If trackStateChanges is enabled (on by default), contains the objects that just stopped being active since the last query. More...
 

Detailed Description

ActivityManager is a wrapper around PhysX sphere queries for arbitrary Unity objects. "Active" objects are objects found in the latest query. It's also possible to get the sets of objects that just began or stopped being active since the last query; this requires enabling the trackStateChanges setting.

Definition at line 23 of file ActivityManager.cs.

Constructor & Destructor Documentation

◆ ActivityManager()

Leap.Unity.Interaction.ActivityManager< T >.ActivityManager ( float  activationRadius,
Func< Collider, T >  filter 
)

Definition at line 84 of file ActivityManager.cs.

Member Function Documentation

◆ UpdateActivityQuery()

void Leap.Unity.Interaction.ActivityManager< T >.UpdateActivityQuery ( Vector3?  queryPosition,
List< LeapSpace spaces = null 
)

Definition at line 91 of file ActivityManager.cs.

Member Data Documentation

◆ activationLayerFunction

Func<int> Leap.Unity.Interaction.ActivityManager< T >.activationLayerFunction = null

This function, if set to a non-null value, overrides the activationLayerMask setting with the result of calling the function. Use this if your application state will modify the layer mask to use for the activity manager.

Definition at line 44 of file ActivityManager.cs.

◆ activationLayerMask

int Leap.Unity.Interaction.ActivityManager< T >.activationLayerMask = ~0

The layer mask against which to query for active objects. The ActivityManager will only find objects in these layers. By default, the ActivityManager will query all layers, but this is highly inefficient.

See SingleLayer and use bitwise operations on their layerMasks for a convenient way to express layer masks. SingleLayer

Definition at line 37 of file ActivityManager.cs.

◆ activationRadius

float Leap.Unity.Interaction.ActivityManager< T >.activationRadius

The radius of the query in world-space.

Definition at line 26 of file ActivityManager.cs.

◆ filter

Func<Collider, T> Leap.Unity.Interaction.ActivityManager< T >.filter = null

This is the function by which the ActivityManager converts the Colliders it finds through PhysX queries into Ts to be placed in the ActiveObjects set.

Only objects with at least one Collider for which this function returns a non-null T will be added to the ActiveObjects set.

Definition at line 53 of file ActivityManager.cs.

◆ trackStateChanges

bool Leap.Unity.Interaction.ActivityManager< T >.trackStateChanges = false

If set to true, BeganActive and EndedActive will be calculated and populated every time a new query occurs.

Definition at line 65 of file ActivityManager.cs.

Property Documentation

◆ ActiveObjects

HashSet<T> Leap.Unity.Interaction.ActivityManager< T >.ActiveObjects
get

Returns the currently "active" objects – objects that were within the latest sphere query.

Definition at line 59 of file ActivityManager.cs.

◆ BeganActive

HashSet<T> Leap.Unity.Interaction.ActivityManager< T >.BeganActive
get

If trackStateChanges is enabled (on by default), contains the objects that just started being active since the last query.

Definition at line 72 of file ActivityManager.cs.

◆ EndedActive

HashSet<T> Leap.Unity.Interaction.ActivityManager< T >.EndedActive
get

If trackStateChanges is enabled (on by default), contains the objects that just stopped being active since the last query.

Definition at line 80 of file ActivityManager.cs.


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