PhysX Ebuses
Use the following request functions with the PhysX EBus interface to communicate with other components of your game.
For more information about using the event bus (EBus) interface, see Working with the Event Bus (EBus) System.
PhysicsComponentRequestBus
PhysicsComponentRequestBus
Interface Function Name | Parameters | Return Value(s) | Scriptable |
---|---|---|---|
EnablePhysics |
void | No | |
DisablePhysics |
void | No | |
IsPhysicsEnabled |
true or false | No | |
AddImpulse |
AZ::Vector3& impulse | void | No |
AddImpulseAtPoint |
AZ::Vector3& impulse, AZ::Vector3& worldSpacePoint | void | No |
AddAngularImpulse |
AZ::Vector3& impulse | void | No |
GetVelocity |
AZ::Vector3 |
No | |
SetVelocity |
AZ::Vector3& velocity | void | No |
GetAngularVelocity |
AZ::Vector3 |
No | |
SetAngularVelocity |
AZ::Vector3& angularVelocity | void | No |
GetMass |
float | No | |
SetMass |
float mass | void | No |
GetLinearDamping |
float | No | |
SetLinearDamping |
float damping | void | No |
GetAngularDamping |
float | No | |
SetAngularDamping |
float damping | void | No |
GetSleepThreshold |
float | No | |
SetSleepThreshold |
float threshold | void | No |
GetAabb |
AZ::Aabb |
No |
PhysXMeshShapeComponentRequestBus
Can be used to request the mesh asset for the PhysX mesh.
PhysXMeshShapeComponentRequestBus
Interface Function Name | Parameters | Return Value(s) | Scriptable |
---|---|---|---|
GetMeshAsset |
void | AZ::Data::Asset<Pipeline::PhysXMeshAsset> |
No |
The following is an example of how to use this function.
PhysXMeshShapeComponentRequestBus::EventResult(meshColliderAsset, m_entity->GetId(), &PhysXMeshShapeComponentRequestBus::Events::GetMeshAsset);
PhysXColliderComponentRequestBus
Returns the physics shape configuration.
PhysXColliderComponentRequestBus
Interface Function Name | Parameters | Return Value(s) | Scriptable |
---|---|---|---|
GetShapeConfigFromEntity |
void | Physics::Ptr<Physics::ShapeConfiguration> |
No |
The following is an example of how to use this function.
Physics::Ptr<Physics::ShapeConfiguration> shapeConfig = nullptr; EBUS_EVENT_ID_RESULT(shapeConfig, GetEntityId(), PhysXColliderComponentRequestBus, GetShapeConfigFromEntity);
PhysXColliderComponentEventBus
Receive notifications when the collider changes.
PhysXColliderComponentEventBus
Interface Function Name | Parameters | Return Value(s) | Scriptable |
---|---|---|---|
OnColliderChanged |
void | void | No |