ProtectedconstructorOptionalisInternalConstructor: booleanActivates or deactivates the component.
The returned active state also accounts for the active state of the parent SceneObject.
Determines the maximum force the joint can apply before breaking. Broken joints no longer participate in physics simulation.
Determines the maximum torque the joint can apply before breaking. Broken joints no longer participate in physics simulation.
Returns the drive's target rotation relative to the joint's first body.
Determines whether collision between the two bodies managed by the joint are enabled.
Various flags set on the component that affect it's behavior.
Determines whether the component itself is active, without accounting for the active state of the parent scene object.
Determines if the object has been destroyed.
Determines if the component is currently active, enabled and running.
Determines the linear limit used for constraining translation degrees of freedom.
Determines the cone limit used for constraining the swing (rotation around Y and Z) degree of freedom.
Determines the angular limit used for constraining the twist (rotation around X) degree of freedom.
Determines the cases that will trigger the onTransformChanged event.
Returns the PhysicsScene this node is being simulated on.
The signed execution priority of the component.
Determines order of execution of this component in relation to other components, higher priorities will execute earlier.
The priority value determines the order of initialize, enable and update calls.
Valid priorities are in the range [-100...100], other priorities are reserved for internal use.
The priority should not be modified after onCreate has been called.
The default priority for user implement components is -10. BuiltInComponent have a default priority of 0. However, instances that have dependencies or are a dependency to another component might have non zero default priorities. For example, the Camera component has a default priority of 50 as other components may depend on the camera being initialized early. The RigidBody component has a default priority of 22 and Joint components have a priority of 20 as the joint depends on fully initialized rigid bodies.
Returns the SceneInstance this node is attached to.
Returns the SceneObject this component is attached to.
Destroys the component, removing it from its scene object and stopping component updates.
Optionalimmediate: booleanIf true the component will be fully destroyed immediately. This means that objects that are still referencing this component might fail. Normally destruction is delayed until the end of the frame to give other objects a chance to stop using it.
Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
Returns motion constraint for the specified axis.
Returns the rotation relative to the body, at which the body is anchored to the joint.
Checks if the component has a specific ComponentFlag bit flag set.
The flag to check.
ProtectedonProtectedonProtectedonVirtualCalled every time a component is placed into the Stopped state.
This method may be called during component destruction, if the component wasn't already in ScenePlayState.Stopped state during destruction. When called during destruction, it is called before onDestroy.
ProtectedonVirtualCalled every time a component leaves the ScenePlayState.Stopped state.
This method might be called during component creation, if the requirements for leaving the stopped state are met. One such case would be a component class that has the runInEditor attribute. When called during creation it is called after onInitialize.
Called at fixed time intervals (e.g. 60 times per frame). Only called if the component is in ScenePlayState.Playing state.
ProtectedonVirtualCalled once when the component first leaves the ScenePlayState.Stopped state.
This method might be called during component creation, if the requirements for leaving the stopped state are met. One such case would be a component class that has the runInEditor attribute. When called during creation it is called after onCreate.
VirtualCalled once per frame, after all other components received their onUpdate invocation. Only called if the component is in ScenePlayState.Playing state.
This method should only be implemented if your component needs logic that implements on other component or SceneObject changes performend in onUpdate. An example could be a camera controller logic that updates in response to changes to the object that is being tracked.
ProtectedonVirtualCalled when the script domain has been refreshed or when the component is initialized. During initialization it is called after onInitialize but before onEnable.
ProtectedonVirtualCalled when the component's parent SceneObject has changed.
The transform flags.
This method is only called if TransformChangedFlag.Transform is set on the Component.notifyFlags. The method will also not be called if the component is currently in the ScenePlayState.Stopped state.
To get the event for editor components that are active outside the simulation, attach the runInEditor attribute to your component class.
VirtualCalled once per frame. Only called if the component is in ScenePlayState.Playing state.
Determines a drive that will attempt to move the specified degree(s) of freedom to the wanted position and velocity.
Sets the drive's target position and rotation relative to the joint's first body.
Sets or unsets the specified ComponentFlag bit flag on the instance.
The flag to set.
True to set the flag.
Allows you to constrain motion of the specified axis. Be aware that when setting drives for a specific axis you must also take care not to constrain its motion in a conflicting way (for example you cannot add a drive that moves the joint on X axis, and then lock the X axis).
Unlocking translations degrees of freedom allows the bodies to move along the subset of the unlocked axes. (for example unlocking just one translational axis is the equivalent of a slider joint.)
Angular degrees of freedom are partitioned as twist (around X axis) and swing (around Y and Z axes). Different effects can be achieves by unlocking their various combinations: - If a single degree of angular freedom is unlocked it should be the twist degree as it has extra options for that case (for example for a hinge joint). - If both swing degrees are unlocked but twist is locked the result is a zero-twist joint. - If one swing and one twist degree of freedom are unlocked the result is a zero-swing joint (for example an arm attached at the elbow) - If all angular degrees of freedom are unlocked the result is the same as the spherical joint.
Registers the coroutine for the specified component using the provided args as arguments.
true if the coroutine was registered.
The coroutine will be called for the first time when the coroutine subsystem runs for update events.
There is no guarantee with regards to the order of how coroutines are invoked.
Coroutines are a great way for time-deferred or delayed system. To implement a coroutine simply add a
generator method to your component and register it as coroutine:
public *myCoroutine(text:string)
{
const endTime:number = Time.realElapsed + 3;
while(Time.realElapsed < endTime)
{
yield true;
}
Debug.log("This code will be invoked after 3 seconds with the text=" + text);
}
To register the function simply call
this.startCoroutine(this.myCoroutine, "Hello World!");
The function will be invoked once the coroutine runs. The coroutine function can yield the program
control flow by using the keyword yield. The coroutine will then stop execution at that point,
and pick up the execution in the next update event, right after the yield keyword that caused
the coroutine to pause.
With helper functions such as waitForSeconds or waitForAsyncOp it is easy to create coroutines that pause for a set time interval.
Registers the coroutine for the specified component using the provided args as arguments.
true if the coroutine was registered.
The coroutine will be called for the first time when the coroutine subsystem runs for fixedUpdate events.
There is no guarantee with regards to the order of how coroutines are invoked.
Coroutines are a great way for time-deferred or delayed system. To implement a coroutine simply add a
generator method to your component and register it as coroutine:
public *myCoroutine(text:string)
{
const endTime:number = Time.realElapsed + 3;
while(Time.realElapsed < endTime)
{
yield true;
}
Debug.log("This code will be invoked after 3 seconds!");
}
To register the function simply call
this.startCoroutine(this.myCoroutine, "Hello World!");
The function will be invoked once the coroutine runs. The coroutine function can yield the program
control flow by using the keyword yield. The coroutine will then stop execution at that point,
and pick up the execution in the next fixedUpdate event, right after the yield keyword that caused
the coroutine to pause.
With helper functions such as waitForSeconds or waitForAsyncOp it is easy to create coroutines that pause for a set time interval.
Stops the coroutine for the specified component.
The coroutine to stop.
true if the coroutine was registered.
StaticgetLocates a rsx object by its sceneRuntimeID and UUID.
The runtime ID of the SceneInstance of the object.
The UUID of the object to retrieve.
The object or null if no object with given sceneRuntimeID and uuid has been registered
Represents the most customizable type of joint. This joint type can be used to Create all other built-in joint types, and to design your own custom ones, but is less intuitive to use. Allows a specification of a linear constraint (for example for slider), twist constraint (rotating around X) and swing constraint (rotating around Y and Z). It also allows you to constrain limits to only specific axes or completely lock specific axes.