Click or drag to resize

EngageableObjectTracking Class

Provides Controller tracking for Engageable objects. Can be used on it's own, in which case it will act as a non-synchronised Pickup Watch our training videos covering Engageable objects here
Inheritance Hierarchy
SystemObject
  UnityEngine.Object
    UnityEngine.Component
      UnityEngine.Behaviour
        UnityEngine.MonoBehaviour
          ImmerseSDKLoggingBehaviour
            ImmerseSDK.InteractionEngageableObjectTracking

Namespace:  ImmerseSDK.Interaction
Assembly:  ImmerseSDK.App (in ImmerseSDK.App.dll) Version: 3.5.0.0 (3.5.0.0)
Syntax

The EngageableObjectTracking type exposes the following members.

Constructors
  NameDescription
Public methodEngageableObjectTracking
Initializes a new instance of the EngageableObjectTracking class
Top
Properties
  NameDescription
Public propertyControllerTrackingEnabled
True if controllers are tracking (this object is moving towards the controllers every frame)
Public propertyEngagingControllers
The list of engaged controllers
Public propertyInteractionAllowed
True if interaction is allowed, otherwise false
Protected propertyInteractionPoint
An alternative point to use for interaction calculations
Public propertyIsEngaged
True if this object is currently engaged by one or more controllers
Public propertyIsKinematicAfterEngage
Specifies how physics should behave after engagement ends
Public propertyRequiresTwoHands
True if this object needs both hands to interact with
Public propertyRigidbody
The associated RigidBody
Protected propertySensitivity
Sensitivity of movement that is applied (acts like a dampener). Note this is applied to both angular movement and positional movement.
Public propertyTargetTransform
The transform to target
Protected propertyTrackPosition
Should controller position be tracked?
Protected propertyTrackRotation
Should controller rotation be tracked?
Public propertyTransform
This object's Transform component
Top
Methods
  NameDescription
Protected methodAwake
Unity Component Method
Public methodEngage
Attempt to Engage this object. If this is successfull, then a Ghost message is broadcast and the return value is true.
Protected methodFixedUpdate
Unity Component Method
Protected methodGetAngularVelocityOfController
Calculates the average angular velocity of all the engaging controllers
Protected methodGetDeltaWorldPositionToController
Calculates the average delta distance moved by all the engaged controllers using world coordinates. Takes the interaction point into consideration if one was specified.
Protected methodGetDirectionOfMovementForPositionUpdate
Default direction is from interaction point to controller
Protected methodGetTargetWorldPositionForController
Returns the target position for this object based on the current engaging controller and interaction point
Protected methodGetVectorFromInteractionPointToController
Calculates the distance from the interaction point (using the transform's position as default) to the average position of all the engaging controllers using world coordinates
Protected methodGetVelocityOfController
Calculates the average velocity of all the engaging controllers using world coordinates
Protected methodIsMovementVelocityValid
Checks whether the vector passed in is valid - checks for Nan, and that it's magnitude is greater than Mathf.Epsilon
Public methodMask
Masks the specified vector by only allowing the axis specified
Protected methodMoveTowardControllerPosition
Moves the object towards the average position of all the engaged controllers using physics in VR (in WebGL we will just set the position). Note: world coordinates are used when doing calculations.
Protected methodMoveTowardControllerRotation
Rotates the object towards the average rotation of all the engaged controllers using physics in VR (in WebGL we will just set the position)
Public methodMoveTowards
Moves this object by applying the velocity
Protected methodOnDrawGizmos
Unity Component Method
Public methodRequirementsMet
Returns true if interaction is allowed, and interaction requirements are met.
Protected methodRestrictMovement
Override this to restrict movement direction in some way. Default behavior is to return the direction unmodified.
Protected methodRestrictPosition
Override this to restrict an object's position in some way. Default behavior is to return the target position unmodified.
Protected methodRotateTowardsControllerPositionPhysical
Rotates the object towards the average rotation of all the engaged controllers using physics. This rotation is also masked so only the world axis specified is used.
Protected methodRotateUsingControllerAngularVelocity
Rotates the object using the average angular velocity of all the engaged controllers using physics. This rotation is also masked so only the local axis specified is used.
Protected methodShortVibrateController
Used to trigger a small vibration for the user
Public methodShowHighlight
Shows/Hides a highlight around the object
Protected methodToggleDrag
We reduce drag for smoother interaction. This method toggles it on or off
Public methodTriggerShortControlerVibration
Trigger a short vibration on the current engaged object
Protected methodUpdateDisplayForEngagement
Called when this object's engagement state changes. Override to implement any visual feedback required.
Top
Fields
  NameDescription
Private field_interactionPoint
An alternative point to use for interaction calculations
Private field_interactionRequirements
Requirements that has to be satisfied to allow interaction
Private field_isKinematicAfterEngage
Specifies how physics should behave after engagement ends
Private field_requiresTwoHands
Indicates whether this object needs to be engaged with by 2 controllers to move
Private field_requiresTwoHandsForUnsnapping
Indicates whether this object needs to be engaged with by 2 controllers to unsnap
Private field_targetTransform
The transform to target
Public fieldStatic memberMaxDistanceToTravelUsingForces
Caps the maximum distance to travel using forces (which gives smoother movement of held objects). If this distance is breached, the object will teleport instead. This value is also used for snapping.
Top
Extension Methods
  NameDescription
Public Extension MethodDisengage
Disengage an engageable object
(Defined by EngagingExtensions.)
Public Extension MethodEngage
Engage an engageable object. This will be a local/remote engagement based on it's type (EngageableObject)
(Defined by EngagingExtensions.)
Public Extension MethodGetCopyOf
Copies all properties of a component from source to target. Uses reflection to set properties.
(Defined by ComponentExtensions.)
Public Extension MethodIsAvailable
Checks whether the target is available for interaction
(Defined by EngagingExtensions.)
Public Extension MethodWaitForT
Waits for a singleton on a coroutine
(Defined by SingletonManager.)
Top
Remarks
Watch our training videos covering Engageable objects here
See Also