Creating a new rigidbody with a weight in kg, a physics type (default = dynamic), a collider type what physical form has the collider, to what group does it belong, is there a transform Matrix that should be used, and is the collider defined as a group of points that represent a convex mesh.
The groups this object collides with. Groups must be writen in form of e.g. collisionMask = COLLISION_GROUP.DEFAULT | COLLISION_GROUP.... and so on to collide with multiple groups.
Collisions with rigidbodies happening to this body, can be used to build a custom onCollisionStay functionality.
Vertices that build a convex mesh (form that is in itself closed). Needs to set in the construction of the rb if none of the standard colliders is used. Untested and not yet fully supported by serialization and mutation.
Automatic adjustment of the pivot when Render.prepare is called according to BODY_INIT
Marks if collider was initialized. Reset to false to initialize again e.g. after manipulation of mtxPivot
Transformation of the collider relative to the node's transform. Once set mostly remains constant. If altered, isInitialized must be reset to false to recreate the collider in the next Render.prepare
Triggers that are currently triggering this body
Static
Readonly
baserefers back to this class from any subclass e.g. in order to find compatible other resources
Static
Readonly
isubclasses get a iSubclass number for identification
Static
Readonly
subclasseslist of all the subclasses derived from this class, if they registered properly
The collision group this Node belongs to it's the default group normally which means it physically collides with every group besides trigger.
Drag of rotation.
Drag of linear movement. A Body does slow down even on a surface without friction.
The factor this rigidbody reacts to world gravity. Default = 1 e.g. 1*9.81 m/s.
Get the friction of the rigidbody, which is the factor of sliding resistance of this rigidbody on surfaces
Set the friction of the rigidbody, which is the factor of sliding resistance of this rigidbody on surfaces
Is true, when only one instance of the component class can be attached to a node
Marking the Body as a trigger therefore not influencing the collision system but only sending triggerEvents
Get the restitution of the rigidbody, which is the factor of bounciness of this rigidbody on surfaces
Set the restitution of the rigidbody, which is the factor of bounciness of this rigidbody on surfaces
Retrieves the type of this mutable subclass as the name of the runtime class
The type of the mutable
The shape that represents the Node in the physical world. Default is a Cube.
De- / Activate the rigidbodies auto-sleeping function. If activated the rigidbody will automatically sleep when needed, increasing performance. If deactivated the rigidbody gets stopped from sleeping when movement is too minimal. Decreasing performance, for rarely more precise physics results
Changing the VELOCITY of the RIGIDBODY. Only influencing the angular speed not the linear
See EventTarget.addEventListener for reference. Works with EventListenerUnified and EventUnified
Optional
_options: boolean | AddEventListenerOptionsChanging the VELOCITY of the RIGIDBODY. Only influencing the linear speed not angular
Applies a instant ROTATIONAL-FORCE to the RIGIDBODY in the three dimensions. Considering the rigidbody's MASS Only influencing it's rotation.
Applies a continous FORCE at the center of the RIGIDBODY in the three dimensions. Considering the rigidbody's MASS. The force is measured in newton, 1kg needs about 10 Newton to fight against gravity.
Applies a instant FORCE to the RIGIDBODY in the three dimensions. Considering the rigidbody's MASS Only influencing it's speed not rotation.
Applies a continous ROTATIONAL FORCE (Torque) to the RIGIDBODY in the three dimensions. Considering the rigidbody's MASS
Tries to attach the component to the given node, removing it from the node it was attached to if applicable
Recreates this instance of Serializable with the information from the given Serialization.
See EventTarget.dispatchEvent for reference. Works with with EventUnified
Optional
drawOverride this to draw visual aids for this component inside the editors render view. Use Gizmos inside the override to draw stuff.
Optional
_cmpCamera: ComponentCameraOptional
drawSee drawGizmos. Only displayed while the corresponding node is selected.
Optional
_cmpCamera: ComponentCameraRetrieves the specified attribute types from the metadata of this instance's class.
Collect applicable attributes of the instance and copies of their values in a Mutator-object. By default, a mutator cannot be extended, since extensions are not available in the object the mutator belongs to. A mutator may be reduced by the descendants of Mutable to contain only the properties needed.
Returns an associative array with the same attributes as the given mutator, but with the corresponding types as string-values. Does not recurse into objects! This will return the decorated meta-type instead of the runtime-type of the object, if available.
Collect the attributes of the instance and their values applicable for animation. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance
Collect the attributes of the instance and their values applicable for the user interface. Basic functionality is identical to getMutator, returned mutator should then be reduced by the subclassed instance
Change properties by an associative array
Sends a ray through this specific body ignoring the rest of the world and checks if this body was hit by the ray, returning info about the hit. Provides the same functionality and information a regular raycast does but the ray is only testing against this specific body.
See EventTarget.removeEventListener for reference. Works with EventListenerUnified and EventUnified
Optional
_options: boolean | AddEventListenerOptionsRotating the rigidbody therefore changing it's rotation over time directly in physics. This way physics is changing instead of transform. But you are able to incremental changing it instead of a direct rotation. Although it's always prefered to use forces in physics.
Returns a Serialization of this object.
Scaling requires the collider to be completely recreated anew
Translating the rigidbody therefore changing it's place over time directly in physics. This way physics is changing instead of transform. But you are able to incrementally changing it instead of a direct position. Although it's always prefered to use forces in physics.
Updates the values of the given mutator according to the current state of the instance
Static
get
Acts as the physical representation of the Node it's attached to. It's the connection between the FUDGE rendered world and the Physics world. For the physics to correctly get the transformations rotations need to be applied with from left = true. Or rotations need to happen before scaling.
Author
Marko Fehrenbach, HFU, 2020 | Jirka Dell'Oro-Friedl, HFU, 2021