#include <HeightfieldCollider.h>
Inherits AzPhysics::SimulatedBodyComponentRequestsBus::Handler, Physics::HeightfieldProviderNotificationBus::Handler, and PhysX::ColliderShapeRequestBus::Handler.
|
| HeightfieldCollider (AZ::EntityId entityId, const AZStd::string &entityName, AzPhysics::SceneHandle sceneHandle, AZStd::shared_ptr< Physics::ColliderConfiguration > colliderConfig, AZStd::shared_ptr< Physics::HeightfieldShapeConfiguration > shapeConfig, DataSource dataSourceType) |
|
AZStd::shared_ptr< Physics::Shape > | GetHeightfieldShape () |
|
void | RefreshHeightfield (Physics::HeightfieldProviderNotifications::HeightfieldChangeMask changeMask, const AZ::Aabb &dirtyRegion=AZ::Aabb::CreateNull()) |
|
const AzPhysics::SimulatedBody * | GetSimulatedBody () const |
|
void | BlockOnPendingJobs () |
|
void | EnablePhysics () override |
|
void | DisablePhysics () override |
|
bool | IsPhysicsEnabled () const override |
|
AZ::Aabb | GetAabb () const override |
|
AzPhysics::SimulatedBody * | GetSimulatedBody () override |
|
AzPhysics::SimulatedBodyHandle | GetSimulatedBodyHandle () const override |
|
AzPhysics::SceneQueryHit | RayCast (const AzPhysics::RayCastRequest &request) override |
|
|
void | OnHeightfieldDataChanged (const AZ::Aabb &dirtyRegion, Physics::HeightfieldProviderNotifications::HeightfieldChangeMask changeMask) override |
|
AZ::Aabb | GetColliderShapeAabb () override |
|
bool | IsTrigger () override |
|
void | ClearHeightfield () |
|
void | InitStaticRigidBody (const AZ::Transform &baseTransform) |
|
void | InitStaticRigidBody () |
|
void | UpdateHeightfieldMaterialSlots (const Physics::MaterialSlots &updatedMaterialSlots) |
|
PhysX Heightfield Collider base class. This contains all the logic shared between the Editor Heightfield Collider Component and the Heightfield Collider Component to create, update, and destroy the heightfield collider at runtime.
◆ DataSource
Enum for specifying how Heightfield Collider should be created.
Enumerator |
---|
GenerateNewHeightfield | Generate a new heightfield using the data from the Terrain System.
|
UseCachedHeightfield | Use the cached heightfield data from shape configuration. Usually it comes loaded from a heightfield asset.
|
◆ HeightfieldCollider()
PhysX::HeightfieldCollider::HeightfieldCollider |
( |
AZ::EntityId |
entityId, |
|
|
const AZStd::string & |
entityName, |
|
|
AzPhysics::SceneHandle |
sceneHandle, |
|
|
AZStd::shared_ptr< Physics::ColliderConfiguration > |
colliderConfig, |
|
|
AZStd::shared_ptr< Physics::HeightfieldShapeConfiguration > |
shapeConfig, |
|
|
DataSource |
dataSourceType |
|
) |
| |
Create a HeightfieldCollider that operates on the given set of data.
- Parameters
-
entityId | The entity Id for the entity that contains this heightfield collider |
entityName | The enntity name for the entity that contains this heightfield collider (for debug purposes) |
sceneHandler | The physics scene to create the collider in (Editor or runtime) |
colliderConfig | The collider configuration to use. Some of its data will get modified based on the heightfield data. |
shapeConfig | The shape configuration to use. All of its data will get modified based on the heightfield data. |
◆ GetHeightfieldShape()
AZStd::shared_ptr<Physics::Shape> PhysX::HeightfieldCollider::GetHeightfieldShape |
( |
| ) |
|
Get the currently-spawned heightfield shape.
- Returns
- Pointer to the heightfield shape.
◆ GetSimulatedBody()
const AzPhysics::SimulatedBody* PhysX::HeightfieldCollider::GetSimulatedBody |
( |
| ) |
const |
Get a pointer to the currently-spawned simulated body.
- Returns
- Pointer to the simulated body.
◆ RefreshHeightfield()
void PhysX::HeightfieldCollider::RefreshHeightfield |
( |
Physics::HeightfieldProviderNotifications::HeightfieldChangeMask |
changeMask, |
|
|
const AZ::Aabb & |
dirtyRegion = AZ::Aabb::CreateNull() |
|
) |
| |
Notify the heightfield that it may need to refresh some or all of its data.
- Parameters
-
changeMask | The types of data changes causing the notification. |
dirtyRegion | The area affected by the notification, or a Null Aabb if everything is affected. |
The documentation for this class was generated from the following file:
- Gems/PhysX/Core/Code/Source/HeightfieldCollider.h