PhysicObject

A PhysicObject is an optional component that can be attached to an Object. They create links between your physic World and your Scene. As soon a PhysicObject is added to an Object it is treated as Static; by adding one or multiple Collider you can then define their representation of inside the physic World.

Based on the type of simulation you are trying to achieve you can optionally add an extra component to the PhysicObject itself that will enable you to simulate RigidBody and SoftBody (DynamicMesh only) physics which in turn will give you access to a more refined set of functionalities.

See Also

Static Variables


Name Description
object Parent Object where the PhysicObject component is maintained.
rigidbody Reference to a RigidBody physics component attached to the active PhysicObject.
softbody Reference to a SoftBody physics component attached to the active PhysicObject.
collider_count Total amount of Collider attached to the current PhysicObject.

Variables


Name Description
force_compound Force a single Collider to be treated as a compound shape.
collisionlayer_mask Bit mask created using CollisionLayer caps that determine on which layer(s) the PhysicObject will be placed on.
collisionlayer_filter Bit mask created using CollisionLayer caps that determine which layer(s) the PhysicObject can collide with.
material_callback Enable or disable physic material collision callback.
initial_transform Initial transformation matrix of the PhysicObject used before the physics simulation started.
friction Specify the base friction of the PhysicObject.
initial_transform Represent the base restitution of the PhysicObject.

Functions


Name Description
AddCollider Attach a new Collider to the active PhysicObject.
GetCollider Retrieve an existing Collider attached to the active PhysicObject using its name as key.
GetColliderAt Helper function to retrive a Collider by index.
GetColliderIndex Retrieve the index of an existing Collider.
RemoveCollider Remove a specific Collider.
RemoveColliderAt Delete an existing Collider using its internal index.
AddRigidBody Add RigidBody physics capabilities to the active PhysicObject.
AddSoftBody Add SoftBody physics capabilities to the active PhysicObject.
Build Force to build/rebuild the active PhysicObject internal physic shape.
SetTransform Manually set the world transformation matrix of the PhysicObject.
GetActivationState Retrieve the active ActivationState of the PhysicObject maintained by the physics engine.
IsStatic Helper to retrieve if the PhysicObject is a static or not.
IsKinematic Helper to retrieve if the PhysicObject is a kinematic object or not.
IsActive Helper to retrieve if the PhysicObject status in the physic simulation is currently set to active (see ActivationState).
GetContactCount Function to retrive the total amount of contact points connected to the active PhysicObject.
GetContactAt Retrieve a specific WorldContact using its index as key.
GenerateColliders Generate a compound shape based on the Collider information parent Object attachments.

Events


The events below are available when an Object have a PhysicObject attached to it. Theses new callbacks are triggered at the various collision stages between two PhysicObject.

Callbacks Description
OnOverlap Occur when two physic object AABB are overlapping. This does not mean that a collision occurs yet; only report that two PhysicObject are in proximity.
OnCollide Triggered when two PhysicObject are in proximity and actually collide with each other.
OnContact This callback occurs during the PhysicMaterial combiner phase which indicates that contact points have been created and a collision is occuring.

ActivationState


Constant values that represent the current state of a PhysicObject attached to a physic World.

  • kActive: Tell the system that the PhysicObject is ready to interact with the physic World.
  • kDeactivated: Put the PhysicObject on standby.
  • kWantsDeactivation: Force the PhysicObject to be deactivated.
  • kDisableDeactivation: Force the PhysicObject to always stay active.
  • kDisableSimulation: Temporary remove the PhysicObject from the physic simulation.




NRG - API 2022.4.384543 - Fri Nov 4 2022
Copyright © 2022 nrgcore.com. All Rights Reserved. Terms of Service - Privacy Policy - EULA