EngageableObject Class |
Namespace: ImmerseSDK.Interaction
[UnityEngine.DisallowMultipleComponent] public abstract class EngageableObject : IndexedMonoBehaviour, IEngageableObject, IInteractableObject, ISupportDelayedStartup
The EngageableObject type exposes the following members.
Name | Description | |
---|---|---|
EngageableObject | Initializes a new instance of the EngageableObject class |
Name | Description | |
---|---|---|
ControllerTrackingEnabled |
True if controllers are tracking (this object is moving towards the controllers every frame)
| |
EngagingControllers |
The list of engaged controllers
| |
EngagingParent |
The top most parent that is also the root of the hierarchy
| |
InteractionAllowed |
True if interaction is allowed, otherwise false
| |
InteractionPoint |
An alternative point to use for interaction calculations
| |
IsEngaged |
True if this object is currently engaged by one or more controllers
| |
IsKinematicAfterEngage |
Specifies how physics should behave after engagement ends
| |
RequiresTwoHands |
True if this object needs both hands to interact with
| |
Rigidbody |
The associated RigidBody
| |
Sensitivity |
Sensitivity of movement that is applied (acts like a dampener).
Note this is applied to both angular movement and positional movement.
| |
Transform |
This object's Transform component
| |
TransformSync |
The associated TransformSync component
|
Name | Description | |
---|---|---|
Awake | ||
Engage |
Engage
After this is called a Ghost message is broadcast
| |
FixedUpdate |
Unity Component Method
| |
ForeachReaction |
Iterate over all the reactions
| |
GetAngularVelocityOfController |
Calculates the average angular velocity of all the engaging controllers
| |
GetAverageDirectionOfMovementForPositionUpdate |
Default direction is from interaction point to controller
| |
GetAverageVectorFromInteractionPointToControllers |
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
| |
GetAverageVelocityOfControllers |
Calculates the average velocity of all the engaging controllers using world coordinates
| |
GetDirectionOfMovementForPositionUpdate |
Default direction is from interaction point to controller
| |
GetPayload |
Gets the message payload for this object
| |
GetTargetWorldPositionForController |
Returns the target position for this object based on the current engaging controller and interaction point
| |
GetVectorFromGrabPointToController |
Vector from where the object was grabbed (tracked on object) to the same relative interaction point (tracked on controlelr)
| |
GetVectorFromRigidBodyToGrabPoint |
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
| |
GetVelocityOfController |
Calculates the average velocity of all the engaging controllers using world coordinates
| |
Initialise |
Initialise this pickup with the secified settings
| |
IsEngagedBy |
Checks if the object is engaged by a specific controller
| |
IsMovementVelocityValid |
Checks whether the vector passed in is valid - checks for Nan, and that it's magnitude is greater than Mathf.Epsilon
| |
LateUpdate |
Unity Component Method
| |
Mask |
Masks the specified vector by only allowing the axis specified
| |
MoveTowardControllerPosition |
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.
| |
MoveTowardControllerRotation |
Rotates the object towards the average rotation of all the engaged controllers using physics in VR (in WebGL we will just set the position)
| |
MoveTowards |
Moves this object by applying the velocity
| |
OnDisengage |
Called when an object engagement ends (before network message is sent).
Note: Only the local user will receive this.
| |
OnDrawGizmos |
Unity Component Method
| |
OnEngage |
Called when an object engagement starts (before network message is sent).
Note: Only the local user will receive this.
| |
OnReceiveDeleteEngage |
Called when a delete message is received
| |
OnReceiveDisengage |
Called when an object engagement ends (when network message is received).
Note: All users (local and remote) will receive this.
| |
OnReceiveEngage |
Called when an object engagement starts (when network message is received).
Note: All users (local and remote) will receive this.
| |
ReactAfterEngagementChanged |
Called after an engagement starts/ends. Will execute all the valid reactions for this action.
| |
RequirementsMet |
Returns true if interaction is allowed, and interaction requirements are met.
| |
RestrictMovement |
Override this to restrict movement direction in some way. Default behavior is to return the direction unmodified.
| |
RestrictPosition |
Override this to restrict an object's position in some way. Default behavior is to return the target position unmodified.
| |
RotateTowardsControllerPositionPhysical |
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.
| |
RotateUsingControllerAngularVelocity |
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.
| |
SendEngageMessage |
Sends the network message
| |
SetInteractionTargets |
Sets the interaction target on the controller
| |
SetUpOutline | ||
ShortVibrateController(Avatar, Hands, EngageableObjectVibrateTypes) |
Used to trigger a small vibration for the user
| |
ShortVibrateController(Avatar, Controller, EngageableObjectVibrateTypes) |
Used to trigger a small vibration for the user
| |
ShouldAddDefaultThrowForce |
Returns true if the default throw force should be added (only valid for local disengagements that has authority)
| |
ShowHighlight |
Shows/Hides a highlight around the object
| |
ToggleDrag |
We reduce drag for smoother interaction. This method toggles it on or off
| |
TriggerScreenControlInteract | ||
TriggerShortControlerVibration |
Trigger a short vibration on the current engaged object
| |
Update |
Unity Component Method
| |
UpdateDisplayForEngagement |
Called when this object's engagement state changes.
Override to implement any visual feedback required.
|
Name | Description | |
---|---|---|
OnDisengageEvent |
Fired when this object is disengaged
| |
OnDisengageLocalEvent |
Fired when this object is disengaged (local only)
| |
OnEngageEvent |
Fired when this object is engaged
| |
OnEngageLocalEvent |
Fired when this object is engaged (local only)
|
Name | Description | |
---|---|---|
_interactionPoint |
An alternative point to use for interaction calculations
| |
_interactionRequirements |
Requirements that has to be satisfied to allow interaction
| |
_isKinematicAfterEngage |
Specifies how physics should behave after engagement ends
| |
_requiresTwoHands |
Indicates whether this object needs to be engaged with by 2 controllers to move
| |
_requiresTwoHandsForUnsnapping |
Indicates whether this object needs to be engaged with by 2 controllers to unsnap
| |
_transformSync |
The associated TransformSync component
| |
DeadZoneDistance |
Any distance less than this would be ignored in calculations for movement
| |
SmallestDistance |
Any distance less than this would be ignored in calculations for movement
|
Name | Description | |
---|---|---|
Disengage |
Disengage an engageable object
(Defined by EngagingExtensions.) | |
Engage |
Engage an engageable object. This will be a local/remote engagement based on it's type
(EngageableObject)
(Defined by EngagingExtensions.) | |
GetCopyOf |
Copies all properties of a component from source to target. Uses reflection to set properties.
(Defined by ComponentExtensions.) | |
IsAvailable |
Checks whether the target is available for interaction
(Defined by EngagingExtensions.) | |
WaitForT |
Waits for a singleton on a coroutine
(Defined by SingletonManager.) |