Nebula
|
Diverse functions for manipulating physics actors.
Implements a resource loader for physics actors.
Physics shape enums.
Physics::DebugUI.
callback interfaces for PhysX
Classes | |
struct | Actor |
class | ActorContext |
struct | ActorId |
struct | ActorInfo |
struct | ActorResourceId |
struct | Aggregate |
class | AggregateContext |
struct | AggregateId |
struct | AggregateInfo |
struct | AggregateResourceId |
class | Allocator |
struct | BodyInfo |
struct | Constraint |
struct | ConstraintId |
struct | ConstraintInfo |
struct | ConstraintResourceId |
struct | ContactEvent |
class | ErrorCallback |
struct | Material |
struct | PhysicsResourceId |
class | PhysxState |
struct | Scene |
physx scene classes, foundation and physics are duplicated here for convenience instead of static getters, might be removed later on More... | |
struct | ShapeHandle |
class | StreamActorPool |
class | VisualDebugger |
Class that communicates with the physics visual debugger program. More... | |
Typedefs | |
using | UpdateFunctionType = void (*) (const Actor&) |
using | EventCallbackType = void (*) (const Util::Array<ContactEvent>&) |
Enumerations | |
enum | CollsionGroups { Default = 0 , Static = 1 , Kinematic = 3 , Debris = 4 , SensorTrigger = 5 , Characters = 6 } |
enum | MeshTopologyType { Convex = 0 , ConvexHull = 1 , Triangles = 2 , HeightField = 3 } |
enum | ColliderType { ColliderSphere = 0 , ColliderCube = 1 , ColliderCapsule = 2 , ColliderPlane = 3 , ColliderMesh = 4 } |
enum | PhysicsIdType { ActorIdType , MeshIdType } |
enum | ActorType { Static = 1 , Kinematic = 3 , Dynamic } |
Functions | |
void | RenderUI (Graphics::GraphicsEntityId camera) |
void | RenderMaterialsUI () |
static void | CollectModified (Physics::Scene &scene) |
static void | PreSceneUpdates (Physics::Scene &scene) |
static void | PostSceneUpdates (Physics::Scene &scene) |
static PxShape * | GetShapeCopy (PxShape *shape, Math::vec3 const &scale) |
static physx::PxGeometryHolder | CreateMeshFromResource (MeshTopology type, Util::StringAtom resource, int primGroup) |
static PxShape * | CreateColliderShape (physx::PxGeometryHolder geometry, physx::PxMaterial *material, physx::PxTransform const &trans, const Util::String &colliderName, bool exclusive) |
static void | AddCollider (physx::PxGeometryHolder geometry, IndexT material, const Math::transform &trans, const char *name, const Util::String &colliderName, BodyInfo &bodyInfo, const Util::StringAtom &tag, Ids::Id32 entry) |
static void | AddMeshColliders (PhysicsResource::MeshColliderT *colliderNode, Math::transform const &nodeTransform, Util::String nodeName, IndexT materialIdx, const Util::StringAtom &tag, Ids::Id32 entry, BodyInfo &targetBody) |
static void | AddHeightField (PhysicsResource::HeightFieldColliderT *colliderNode, Math::transform const &nodeTransform, Util::String nodeName, IndexT materialIdx, const Util::StringAtom &tag, Ids::Id32 entry, BodyInfo &targetBody) |
__ImplementInterfaceSingleton (Physics::VisualDebugger) | |
void | LoadMaterialTable (const IO::URI &materialTable) |
void | Setup () |
initialize the physics subsystem and create a default scene | |
void | ShutDown () |
close the physics subsystem | |
IndexT | CreateScene () |
void | DestroyScene (IndexT sceneId) |
Physics::Scene & | GetScene (IndexT idx) |
void | SetEventCallback (EventCallbackType callback, IndexT sceneId) |
void | SetActiveActorCallback (UpdateFunctionType callback, IndexT sceneId) |
void | RenderDebug () |
render a debug visualization of the level | |
Physics::Material & | GetMaterial (IndexT idx) |
void | SetOnSleepCallback (Util::Delegate< void(ActorId *id, SizeT num)> const &callback) |
void | SetOnWakeCallback (Util::Delegate< void(ActorId *id, SizeT num)> const &callback) |
IndexT | SetPhysicsMaterial (Util::StringAtom name, float staticFriction, float dynamicFriction, float restitution, float density) |
IndexT | LookupMaterial (Util::StringAtom name) |
SizeT | GetNrMaterials () |
void | Update (Timing::Time delta) |
perform sync simulation step(s) | |
void | BeginSimulating (Timing::Time delta, IndexT scene) |
explicit calls to simulate and fetch results. Do not mix with Update! | |
void | EndSimulating (IndexT scene) |
void | FlushSimulation (IndexT scene) |
this will block until simulation has ended for cleanups e.g. | |
ActorId | CreateActorInstance (Physics::ActorResourceId id, Math::transform const &trans, Physics::ActorType type, uint64_t userData, IndexT scene) |
void | DestroyActorInstance (Physics::ActorId id) |
Variables | |
PhysxState | state |
StreamActorPool * | actorPool = nullptr |
using Physics::EventCallbackType = void (*) (const Util::Array<ContactEvent>&) |
using Physics::UpdateFunctionType = void (*) (const Actor&) |
enum Physics::ActorType |
Physics::__ImplementInterfaceSingleton | ( | Physics::VisualDebugger | ) |
|
static |
|
static |
|
static |
void Physics::BeginSimulating | ( | Timing::Time | delta, |
IndexT | scene ) |
explicit calls to simulate and fetch results. Do not mix with Update!
|
static |
ActorId Physics::CreateActorInstance | ( | Physics::ActorResourceId | id, |
Math::transform const & | trans, | ||
Physics::ActorType | type, | ||
uint64_t | userData, | ||
IndexT | scene ) |
|
static |
|
static |
IndexT Physics::CreateScene | ( | ) |
void Physics::DestroyActorInstance | ( | Physics::ActorId | id | ) |
void Physics::DestroyScene | ( | IndexT | sceneId | ) |
void Physics::EndSimulating | ( | IndexT | scene | ) |
void Physics::FlushSimulation | ( | IndexT | scene | ) |
this will block until simulation has ended for cleanups e.g.
SizeT Physics::GetNrMaterials | ( | ) |
Physics::Scene & Physics::GetScene | ( | IndexT | idx | ) |
|
static |
void Physics::LoadMaterialTable | ( | const IO::URI & | materialTable | ) |
IndexT Physics::LookupMaterial | ( | Util::StringAtom | name | ) |
|
static |
|
static |
void Physics::RenderDebug | ( | ) |
render a debug visualization of the level
void Physics::RenderMaterialsUI | ( | ) |
void Physics::RenderUI | ( | Graphics::GraphicsEntityId | camera | ) |
void Physics::SetActiveActorCallback | ( | UpdateFunctionType | callback, |
IndexT | sceneId ) |
void Physics::SetEventCallback | ( | EventCallbackType | callback, |
IndexT | sceneId ) |
void Physics::SetOnSleepCallback | ( | Util::Delegate< void(ActorId *id, SizeT num)> const & | callback | ) |
void Physics::SetOnWakeCallback | ( | Util::Delegate< void(ActorId *id, SizeT num)> const & | callback | ) |
IndexT Physics::SetPhysicsMaterial | ( | Util::StringAtom | name, |
float | staticFriction, | ||
float | dynamicFriction, | ||
float | restitution, | ||
float | density ) |
void Physics::Setup | ( | ) |
initialize the physics subsystem and create a default scene
void Physics::ShutDown | ( | ) |
close the physics subsystem
void Physics::Update | ( | Timing::Time | delta | ) |
perform sync simulation step(s)
StreamActorPool * Physics::actorPool = nullptr |
PhysxState Physics::state |