Click or drag to resize

EngageableObject Class

Base class for Engageable objects. Watch our training videos covering Engageable objects here
Inheritance Hierarchy

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

The EngageableObject type exposes the following members.

Constructors
  NameDescription
Protected methodEngageableObject
Initializes a new instance of the EngageableObject 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 propertyEngagingParent
The top most parent that is also the root of the hierarchy
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 propertyTransform
This object's Transform component
Public propertyTransformSync
The associated TransformSync component
Top
Methods
  NameDescription
Protected methodAwake
Public methodEngage
Engage After this is called a Ghost message is broadcast
Protected methodFixedUpdate
Unity Component Method
Protected methodForeachReaction
Iterate over all the reactions
Protected methodGetAngularVelocityOfController
Calculates the average angular velocity of all the engaging controllers
Protected methodGetAverageDirectionOfMovementForPositionUpdate
Default direction is from interaction point to controller
Protected methodGetAverageVectorFromInteractionPointToControllers
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 methodGetAverageVelocityOfControllers
Calculates the average velocity of all the engaging controllers using world coordinates
Protected methodGetDirectionOfMovementForPositionUpdate
Default direction is from interaction point to controller
Public methodGetPayload
Gets the message payload for this object
Protected methodGetTargetWorldPositionForController
Returns the target position for this object based on the current engaging controller and interaction point
Protected methodGetVectorFromGrabPointToController
Vector from where the object was grabbed (tracked on object) to the same relative interaction point (tracked on controlelr)
Protected methodGetVectorFromRigidBodyToGrabPoint
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
Public methodInitialise
Initialise this pickup with the secified settings
Public methodIsEngagedBy
Checks if the object is engaged by a specific controller
Protected methodIsMovementVelocityValid
Checks whether the vector passed in is valid - checks for Nan, and that it's magnitude is greater than Mathf.Epsilon
Protected methodLateUpdate
Unity Component Method
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 methodOnDisengage
Called when an object engagement ends (before network message is sent). Note: Only the local user will receive this.
Protected methodOnDrawGizmos
Unity Component Method
Protected methodOnEngage
Called when an object engagement starts (before network message is sent). Note: Only the local user will receive this.
Protected methodOnReceiveDeleteEngage
Called when a delete message is received
Protected methodOnReceiveDisengage
Called when an object engagement ends (when network message is received). Note: All users (local and remote) will receive this.
Protected methodOnReceiveEngage
Called when an object engagement starts (when network message is received). Note: All users (local and remote) will receive this.
Protected methodReactAfterEngagementChanged
Called after an engagement starts/ends. Will execute all the valid reactions for this action.
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 methodSendEngageMessage
Sends the network message
Protected methodSetInteractionTargets
Sets the interaction target on the controller
Protected methodSetUpOutline
Protected methodShortVibrateController(Avatar, Hands, EngageableObjectVibrateTypes)
Used to trigger a small vibration for the user
Protected methodShortVibrateController(Avatar, Controller, EngageableObjectVibrateTypes)
Used to trigger a small vibration for the user
Protected methodShouldAddDefaultThrowForce
Returns true if the default throw force should be added (only valid for local disengagements that has authority)
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 methodTriggerScreenControlInteract
Public methodTriggerShortControlerVibration
Trigger a short vibration on the current engaged object
Protected methodUpdate
Unity Component Method
Protected methodUpdateDisplayForEngagement
Called when this object's engagement state changes. Override to implement any visual feedback required.
Top
Events
  NameDescription
Public eventOnDisengageEvent
Fired when this object is disengaged
Public eventOnDisengageLocalEvent
Fired when this object is disengaged (local only)
Public eventOnEngageEvent
Fired when this object is engaged
Public eventOnEngageLocalEvent
Fired when this object is engaged (local only)
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
Protected 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_transformSync
The associated TransformSync component
Protected fieldStatic memberDeadZoneDistance
Any distance less than this would be ignored in calculations for movement
Protected fieldStatic memberSmallestDistance
Any distance less than this would be ignored in calculations for movement
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