Plasma Engine  2.0
Loading...
Searching...
No Matches
plJoltWorldModule Class Reference
Inheritance diagram for plJoltWorldModule:

Public Member Functions

 plJoltWorldModule (plWorld *pWorld)
 
virtual void Initialize () override
 This method is called after the constructor. A derived type can override this method to do initialization work. Typically this is the method where updates function are registered.
 
virtual void Deinitialize () override
 This method is called before the destructor. A derived type can override this method to do deinitialization work.
 
virtual void OnSimulationStarted () override
 This method is called at the start of the next world update when the world is simulated. This method will be called after the initialization method.
 
JPH::PhysicsSystem * GetJoltSystem ()
 
const JPH::PhysicsSystem * GetJoltSystem () const
 
plUInt32 CreateObjectFilterID ()
 
void DeleteObjectFilterID (plUInt32 &ref_uiObjectFilterID)
 
plUInt32 AllocateUserData (plJoltUserData *&out_pUserData)
 
void DeallocateUserData (plUInt32 &ref_uiUserDataId)
 
const plJoltUserDataGetUserData (plUInt32 uiUserDataId) const
 
void SetGravity (const plVec3 &vObjectGravity, const plVec3 &vCharacterGravity)
 
virtual plVec3 GetGravity () const override
 
plVec3 GetCharacterGravity () const
 
virtual plUInt32 GetCollisionLayerByName (plStringView sName) const override
 Searches for a collision layer with the given name and returns its index.
 
virtual bool Raycast (plPhysicsCastResult &out_result, const plVec3 &vStart, const plVec3 &vDir, float fDistance, const plPhysicsQueryParameters &params, plPhysicsHitCollection collection=plPhysicsHitCollection::Closest) const override
 
virtual bool RaycastAll (plPhysicsCastResultArray &out_results, const plVec3 &vStart, const plVec3 &vDir, float fDistance, const plPhysicsQueryParameters &params) const override
 
virtual bool SweepTestSphere (plPhysicsCastResult &out_result, float fSphereRadius, const plVec3 &vStart, const plVec3 &vDir, float fDistance, const plPhysicsQueryParameters &params, plPhysicsHitCollection collection=plPhysicsHitCollection::Closest) const override
 
virtual bool SweepTestBox (plPhysicsCastResult &out_result, plVec3 vBoxExtends, const plTransform &transform, const plVec3 &vDir, float fDistance, const plPhysicsQueryParameters &params, plPhysicsHitCollection collection=plPhysicsHitCollection::Closest) const override
 
virtual bool SweepTestCapsule (plPhysicsCastResult &out_result, float fCapsuleRadius, float fCapsuleHeight, const plTransform &transform, const plVec3 &vDir, float fDistance, const plPhysicsQueryParameters &params, plPhysicsHitCollection collection=plPhysicsHitCollection::Closest) const override
 
virtual bool OverlapTestSphere (float fSphereRadius, const plVec3 &vPosition, const plPhysicsQueryParameters &params) const override
 
virtual bool OverlapTestCapsule (float fCapsuleRadius, float fCapsuleHeight, const plTransform &transform, const plPhysicsQueryParameters &params) const override
 
virtual void QueryShapesInSphere (plPhysicsOverlapResultArray &out_results, float fSphereRadius, const plVec3 &vPosition, const plPhysicsQueryParameters &params) const override
 
virtual void AddStaticCollisionBox (plGameObject *pObject, plVec3 vBoxSize) override
 Adds a static actor with a box shape to pOwner.
 
virtual void AddFixedJointComponent (plGameObject *pOwner, const plPhysicsWorldModuleInterface::FixedJointConfig &cfg) override
 Adds a fixed joint to pOwner.
 
virtual plBoundingBoxSphere GetWorldSpaceBounds (plGameObject *pOwner, plUInt32 uiCollisionLayer, plBitflags< plPhysicsShapeType > shapeTypes, bool bIncludeChildObjects) const override
 Gets world space bounds of a physics object if its shape type is included in shapeTypes and its collision layer interacts with uiCollisionLayer.
 
const plSet< plJoltDynamicActorComponent * > & GetActiveActors () const
 
const plMap< plJoltRagdollComponent *, plInt32 > & GetActiveRagdolls () const
 
const plMap< plJoltRopeComponent *, plInt32 > & GetActiveRopes () const
 
plArrayPtr< plJoltRagdollComponent * > GetRagdollsPutToSleep ()
 
plUInt32 QueueBodyToAdd (JPH::Body *pBody, bool bAwake)
 Returns a uint32 that can be queried for completion with IsBodyStillQueuedToAdd().
 
bool IsBodyStillQueuedToAdd (plUInt32 uiBodiesAddCounter) const
 Checks whether the last QueueBodyToAdd() has been processed already, or not.
 
JPH::GroupFilter * GetGroupFilter () const
 
JPH::GroupFilter * GetGroupFilterIgnoreSame () const
 
void EnableJoinedBodiesCollisions (plUInt32 uiObjectFilterID1, plUInt32 uiObjectFilterID2, bool bEnable)
 
JPH::TempAllocator * GetTempAllocator () const
 
void ActivateCharacterController (plJoltCharacterControllerComponent *pCharacter, bool bActivate)
 
plJoltContactListenerGetContactListener ()
 
void CheckBreakableConstraints ()
 
void QueryGeometryInBox (const plPhysicsQueryParameters &params, plBoundingBox box, plDynamicArray< plNavmeshTriangle > &out_triangles) const
 
- Public Member Functions inherited from plWorldModule
plWorldGetWorld ()
 Returns the corresponding world to this module.
 
const plWorldGetWorld () const
 Returns the corresponding world to this module.
 
plUInt32 GetWorldIndex () const
 Same as GetWorld()->GetIndex(). Needed to break circular include dependencies.
 
- Public Member Functions inherited from plReflectedClass
virtual const plRTTIGetDynamicRTTI () const
 
bool IsInstanceOf (const plRTTI *pType) const
 Returns whether the type of this instance is of the given type or derived from it.
 
template<typename T >
PL_ALWAYS_INLINE bool IsInstanceOf () const
 Returns whether the type of this instance is of the given type or derived from it.
 

Public Attributes

plDeque< plComponentHandlem_RequireUpdate
 
plSet< plComponentHandlem_BreakableConstraints
 

Additional Inherited Members

- Static Public Member Functions inherited from plNoBase
static const plRTTIGetStaticRTTI ()
 
- Protected Types inherited from plWorldModule
using UpdateFunction = plDelegate<void(const UpdateContext&)>
 Update function delegate.
 
- Protected Member Functions inherited from plPhysicsWorldModuleInterface
 plPhysicsWorldModuleInterface (plWorld *pWorld)
 
- Protected Member Functions inherited from plWorldModule
 plWorldModule (plWorld *pWorld)
 
void RegisterUpdateFunction (const UpdateFunctionDesc &desc)
 Registers the given update function at the world.
 
void DeregisterUpdateFunction (const UpdateFunctionDesc &desc)
 De-registers the given update function from the world. Note that only the m_Function and the m_Phase of the description have to be valid for de-registration.
 
plAllocatorGetAllocator ()
 Returns the allocator used by the world.
 
plInternal::WorldLargeBlockAllocatorGetBlockAllocator ()
 Returns the block allocator used by the world.
 
bool GetWorldSimulationEnabled () const
 Returns whether the world simulation is enabled.
 
virtual void WorldClear ()
 Called by plWorld::Clear(). Can be used to clear cached data when a world is completely cleared of objects (but not deleted).
 
- Protected Attributes inherited from plWorldModule
plWorldm_pWorld
 

Member Function Documentation

◆ AddFixedJointComponent()

void plJoltWorldModule::AddFixedJointComponent ( plGameObject * pOwner,
const plPhysicsWorldModuleInterface::FixedJointConfig & cfg )
overridevirtual

Adds a fixed joint to pOwner.

Reimplemented from plPhysicsWorldModuleInterface.

◆ AddStaticCollisionBox()

void plJoltWorldModule::AddStaticCollisionBox ( plGameObject * pOwner,
plVec3 vBoxSize )
overridevirtual

Adds a static actor with a box shape to pOwner.

Reimplemented from plPhysicsWorldModuleInterface.

◆ Deinitialize()

void plJoltWorldModule::Deinitialize ( )
overridevirtual

This method is called before the destructor. A derived type can override this method to do deinitialization work.

Reimplemented from plWorldModule.

◆ GetCollisionLayerByName()

plUInt32 plJoltWorldModule::GetCollisionLayerByName ( plStringView sName) const
overridevirtual

Searches for a collision layer with the given name and returns its index.

Returns plInvalidIndex if no such collision layer exists.

Implements plPhysicsWorldModuleInterface.

◆ GetGravity()

virtual plVec3 plJoltWorldModule::GetGravity ( ) const
inlineoverridevirtual

◆ GetWorldSpaceBounds()

plBoundingBoxSphere plJoltWorldModule::GetWorldSpaceBounds ( plGameObject * pOwner,
plUInt32 uiCollisionLayer,
plBitflags< plPhysicsShapeType > shapeTypes,
bool bIncludeChildObjects ) const
overridevirtual

Gets world space bounds of a physics object if its shape type is included in shapeTypes and its collision layer interacts with uiCollisionLayer.

Reimplemented from plPhysicsWorldModuleInterface.

◆ Initialize()

void plJoltWorldModule::Initialize ( )
overridevirtual

This method is called after the constructor. A derived type can override this method to do initialization work. Typically this is the method where updates function are registered.

Reimplemented from plWorldModule.

◆ IsBodyStillQueuedToAdd()

bool plJoltWorldModule::IsBodyStillQueuedToAdd ( plUInt32 uiBodiesAddCounter) const
inline

Checks whether the last QueueBodyToAdd() has been processed already, or not.

Bodies that aren't added to Jolt yet, may not get locked (they are not in the broadphase). If this is still the case, skip operations that wouldn't have an effect anyway.

◆ OnSimulationStarted()

void plJoltWorldModule::OnSimulationStarted ( )
overridevirtual

This method is called at the start of the next world update when the world is simulated. This method will be called after the initialization method.

Reimplemented from plWorldModule.

◆ OverlapTestCapsule()

bool plJoltWorldModule::OverlapTestCapsule ( float fCapsuleRadius,
float fCapsuleHeight,
const plTransform & transform,
const plPhysicsQueryParameters & params ) const
overridevirtual

◆ OverlapTestSphere()

bool plJoltWorldModule::OverlapTestSphere ( float fSphereRadius,
const plVec3 & vPosition,
const plPhysicsQueryParameters & params ) const
overridevirtual

◆ QueryShapesInSphere()

void plJoltWorldModule::QueryShapesInSphere ( plPhysicsOverlapResultArray & out_results,
float fSphereRadius,
const plVec3 & vPosition,
const plPhysicsQueryParameters & params ) const
overridevirtual

◆ Raycast()

bool plJoltWorldModule::Raycast ( plPhysicsCastResult & out_result,
const plVec3 & vStart,
const plVec3 & vDir,
float fDistance,
const plPhysicsQueryParameters & params,
plPhysicsHitCollection collection = plPhysicsHitCollection::Closest ) const
overridevirtual

◆ RaycastAll()

bool plJoltWorldModule::RaycastAll ( plPhysicsCastResultArray & out_results,
const plVec3 & vStart,
const plVec3 & vDir,
float fDistance,
const plPhysicsQueryParameters & params ) const
overridevirtual

◆ SweepTestBox()

bool plJoltWorldModule::SweepTestBox ( plPhysicsCastResult & out_result,
plVec3 vBoxExtends,
const plTransform & transform,
const plVec3 & vDir,
float fDistance,
const plPhysicsQueryParameters & params,
plPhysicsHitCollection collection = plPhysicsHitCollection::Closest ) const
overridevirtual

◆ SweepTestCapsule()

bool plJoltWorldModule::SweepTestCapsule ( plPhysicsCastResult & out_result,
float fCapsuleRadius,
float fCapsuleHeight,
const plTransform & transform,
const plVec3 & vDir,
float fDistance,
const plPhysicsQueryParameters & params,
plPhysicsHitCollection collection = plPhysicsHitCollection::Closest ) const
overridevirtual

◆ SweepTestSphere()

bool plJoltWorldModule::SweepTestSphere ( plPhysicsCastResult & out_result,
float fSphereRadius,
const plVec3 & vStart,
const plVec3 & vDir,
float fDistance,
const plPhysicsQueryParameters & params,
plPhysicsHitCollection collection = plPhysicsHitCollection::Closest ) const
overridevirtual

The documentation for this class was generated from the following files: