22#include "flat/physics/material.h"
25#include "PxPhysicsAPI.h"
165 Physics::ColliderType
type = Physics::ColliderType_Capsule;
Nebula's dynamic array class.
Definition array.h:60
Implements large bit field.
Definition bitfield.h:24
Nebula delegate class, allows to store a function, method or lambda call into a C++ object for later ...
Definition delegate.h:39
A collection of unique values with quick lookup.
Definition set.h:34
A StringAtom.
Definition stringatom.h:22
This simple Id pool implements a set of free and used consecutive integers.
Definition id.h:135
uint32_t Id32
Definition id.h:138
Diverse functions for manipulating physics actors.
Definition actorcontext.cc:18
Util::BitField< CharacterCollisionBitsMax > CharacterCollision
Definition physicsinterface.h:52
Physics::Scene & GetScene(IndexT idx)
Definition physicsinterface.cc:178
void FlushSimulation(IndexT scene)
this will block until simulation has ended for cleanups e.g.
Definition physicsinterface.cc:359
ActorType
Definition physicsinterface.h:38
@ Static
Definition physicsinterface.h:39
@ Dynamic
Definition physicsinterface.h:41
@ Kinematic
Definition physicsinterface.h:40
void RenderDebug()
render a debug visualization of the level
Definition physicsinterface.cc:208
SizeT GetNrMaterials()
Definition physicsinterface.cc:309
void ShutDown()
close the physics subsystem
Definition physicsinterface.cc:89
void SetEventCallback(EventCallbackType callback, IndexT sceneId)
Definition physicsinterface.cc:188
Physics::Material & GetMaterial(IndexT idx)
Definition physicsinterface.cc:237
ActorId CreateActorInstance(Physics::ActorResourceId id, Math::transform const &trans, Physics::ActorType type, uint64_t userData, IndexT scene)
Definition physicsinterface.cc:368
void Setup()
initialize the physics subsystem and create a default scene
Definition physicsinterface.cc:65
void SetOnSleepCallback(Util::Delegate< void(ActorId *id, SizeT num)> const &callback)
Definition physicsinterface.cc:250
CharacterCollisionBits
Definition physicsinterface.h:45
@ Sides
Definition physicsinterface.h:46
@ Up
Definition physicsinterface.h:47
@ CharacterCollisionBitsMax
Definition physicsinterface.h:49
@ Down
Definition physicsinterface.h:48
void EndSimulating(IndexT scene)
Definition physicsinterface.cc:350
void DestroyActorInstance(Physics::ActorId id)
Definition physicsinterface.cc:377
void DestroyScene(IndexT sceneId)
Definition physicsinterface.cc:145
void SetActiveActorCallback(UpdateFunctionType callback, IndexT sceneId)
Definition physicsinterface.cc:198
void(*)(const Actor &) UpdateFunctionType
Definition physicsinterface.h:128
void SetOnWakeCallback(Util::Delegate< void(ActorId *id, SizeT num)> const &callback)
Definition physicsinterface.cc:259
void BeginSimulating(Timing::Time delta, IndexT scene)
explicit calls to simulate and fetch results. Do not mix with Update!
Definition physicsinterface.cc:337
void Update(Timing::Time delta)
perform sync simulation step(s)
Definition physicsinterface.cc:324
IndexT SetPhysicsMaterial(Util::StringAtom name, float staticFriction, float dynamicFriction, float restitution, float density)
Definition physicsinterface.cc:268
IndexT CreateScene()
Definition physicsinterface.cc:98
IndexT LookupMaterial(Util::StringAtom name)
Definition physicsinterface.cc:300
void(*)(const Util::Array< ContactEvent > &) EventCallbackType
Definition physicsinterface.h:141
double Time
the time datatype
Definition time.h:18
#define RESOURCE_ID_TYPE(type)
Definition resourceid.h:41
Represents a 3D point in space.
Definition point.h:22
A vector is a 3D direction in space.
Definition vector.h:22
Definition physicsinterface.h:91
physx::PxActor * actor
Definition physicsinterface.h:92
ActorResourceId res
Definition physicsinterface.h:94
uint64_t userData
Definition physicsinterface.h:95
ActorId id
Definition physicsinterface.h:93
Definition physicsinterface.h:63
ActorId()
Definition physicsinterface.h:65
ActorId(uint32_t i)
Definition physicsinterface.h:66
Ids::Id32 id
Definition physicsinterface.h:64
Definition physicsinterface.h:32
Definition physicsinterface.h:121
AggregateResourceId res
Definition physicsinterface.h:123
AggregateId id
Definition physicsinterface.h:122
Util::Array< ActorId > actors
Definition physicsinterface.h:124
Util::Array< ConstraintId > constraints
Definition physicsinterface.h:125
Definition physicsinterface.h:84
AggregateId()
Definition physicsinterface.h:86
AggregateId(uint32_t i)
Definition physicsinterface.h:87
Ids::Id32 id
Definition physicsinterface.h:85
Definition physicsinterface.h:33
Definition physicsinterface.h:157
Math::float3 halfExtents
Half the width, height and depth of the characters AABB collider.
Definition physicsinterface.h:159
Definition physicsinterface.h:146
float radius
Radius of this capsule.
Definition physicsinterface.h:148
bool constrainClimbing
If set to false, the capsule will climb over surfaces according to impact normal.
Definition physicsinterface.h:154
float height
Height of this capsule. The total height will be height + 2 * radius.
Definition physicsinterface.h:150
Definition physicsinterface.h:144
float contactOffset
The contact offset used by the controller.
Definition physicsinterface.h:176
float slopeLimit
The maximum slope which the character can walk up. Defined as cosine of desired limit angle.
Definition physicsinterface.h:168
Physics::ColliderType type
Determines the type of collider that the character will use.
Definition physicsinterface.h:165
float stepOffset
The maximum height of an obstacle which the character can climb.
Definition physicsinterface.h:179
BoxInfo box
AABB information. Make sure to set type to Box if using this.
Definition physicsinterface.h:188
CapsuleInfo capsule
Capsule information. Make sure to set type to Capsule if using this.
Definition physicsinterface.h:190
uint64_t userData
Can be used to store application side information in the character.
Definition physicsinterface.h:194
IndexT materialId
Optional physics material to use.
Definition physicsinterface.h:184
bool slideOnSlopes
Should the character slide down slopes?
Definition physicsinterface.h:171
Definition physicsinterface.h:102
uint64_t userData
Definition physicsinterface.h:106
CharacterId id
Definition physicsinterface.h:105
physx::PxController * controller
Definition physicsinterface.h:103
Physics::ColliderType type
Definition physicsinterface.h:104
Definition physicsinterface.h:70
CharacterId()
Definition physicsinterface.h:72
CharacterId(uint32_t i)
Definition physicsinterface.h:73
Ids::Id32 id
Definition physicsinterface.h:71
Definition physicsinterface.h:113
ConstraintId id
Definition physicsinterface.h:114
Ids::Id32 res
Definition physicsinterface.h:115
uint64_t userData
Definition physicsinterface.h:117
physx::PxJoint * joint
Definition physicsinterface.h:116
Definition physicsinterface.h:77
Ids::Id32 id
Definition physicsinterface.h:78
ConstraintId(uint32_t i)
Definition physicsinterface.h:80
ConstraintId()
Definition physicsinterface.h:79
Definition physicsinterface.h:35
Definition physicsinterface.h:55
Util::StringAtom name
Definition physicsinterface.h:57
physx::PxMaterial * material
Definition physicsinterface.h:56
uint64_t serialId
Definition physicsinterface.h:58
float density
Definition physicsinterface.h:59
Definition physicsinterface.h:34
physx scene classes, foundation and physics are duplicated here for convenience instead of static get...
Definition physicsinterface.h:200
Util::Set< Ids::Id32 > modifiedActors
Definition physicsinterface.h:211
Timing::Time time
Definition physicsinterface.h:208
physx::PxFoundation * foundation
Definition physicsinterface.h:201
UpdateFunctionType updateFunction
Definition physicsinterface.h:206
physx::PxPhysics * physics
Definition physicsinterface.h:202
EventCallbackType eventCallback
Definition physicsinterface.h:207
bool isSimulating
Definition physicsinterface.h:209
physx::PxDefaultCpuDispatcher * dispatcher
Definition physicsinterface.h:205
Util::Array< Physics::ContactEvent > eventBuffer
Definition physicsinterface.h:210
physx::PxScene * scene
Definition physicsinterface.h:203
physx::PxControllerManager * controllerManager
Definition physicsinterface.h:204
Nebula's universal string class.
Definition String.cs:8
Typedefs for the Timing subsystem.
static const int InvalidIndex
Definition types.h:45
int SizeT
Definition types.h:40
int IndexT
Definition types.h:39