3#include <Core/Messages/EventMessage.h>
4#include <Core/ResourceManager/ResourceHandle.h>
5#include <Core/World/WorldModule.h>
6#include <Foundation/Communication/Message.h>
14enum class plPhysicsHitType : int8_t
17 TriangleFrontFace = 0,
32 plPhysicsHitType
m_hitType = plPhysicsHitType::Undefined;
35 void* m_pInternalPhysicsShape =
nullptr;
36 void* m_pInternalPhysicsActor =
nullptr;
50 PL_DECLARE_POD_TYPE();
58 void* m_pInternalPhysicsShape =
nullptr;
59 void* m_pInternalPhysicsActor =
nullptr;
72PL_DECLARE_FLAGS_WITH_DEFAULT(plUInt32, plPhysicsShapeType, 0xFFFFFFFF,
83PL_DECLARE_REFLECTABLE_TYPE(PL_CORE_DLL, plPhysicsShapeType);
90 : m_uiCollisionLayer(uiCollisionLayer)
91 , m_ShapeTypes(shapeTypes)
92 , m_uiIgnoreObjectFilterID(uiIgnoreObjectFilterID)
96 plUInt32 m_uiCollisionLayer = 0;
98 plUInt32 m_uiIgnoreObjectFilterID = plInvalidIndex;
99 bool m_bIgnoreInitialOverlap =
false;
102enum class plPhysicsHitCollection
140 virtual plVec3 GetGravity()
const = 0;
192 plUInt32 m_uiObjectFilterID = plInvalidIndex;
195 void* m_pInternalPhysicsShape =
nullptr;
196 void* m_pInternalPhysicsActor =
nullptr;
208 void* m_pInternalPhysicsShape =
nullptr;
209 void* m_pInternalPhysicsActor =
nullptr;
225 bool m_bGotGrabbed =
true;
240 PL_DECLARE_POD_TYPE();
242 plUInt32 m_uiVertexIndices[3];
247 PL_DECLARE_POD_TYPE();
249 plUInt32 m_uiFirstTriangle = 0;
250 plUInt32 m_uiNumTriangles = 0;
251 plUInt16 m_uiSurfaceIndex = 0;
static plBoundingBoxSphereTemplate< float > MakeInvalid()
Definition BoundingBoxSphere_inl.h:58
This class represents an object inside the world.
Definition GameObject.h:32
A hybrid array uses in-place storage to handle the first few elements without any allocation....
Definition HybridArray.h:12
Base class for all message types. Each message type has it's own id which is used to dispatch message...
Definition Message.h:22
Definition PhysicsWorldModule.h:109
virtual void AddStaticCollisionBox(plGameObject *pOwner, plVec3 vBoxSize)
Adds a static actor with a box shape to pOwner.
Definition PhysicsWorldModule.h:150
virtual plUInt32 GetCollisionLayerByName(plStringView sName) const =0
Searches for a collision layer with the given name and returns its index.
virtual plBoundingBoxSphere GetWorldSpaceBounds(plGameObject *pOwner, plUInt32 uiCollisionLayer, plBitflags< plPhysicsShapeType > shapeTypes, bool bIncludeChildObjects) const
Gets world space bounds of a physics object if its shape type is included in shapeTypes and its colli...
Definition PhysicsWorldModule.h:168
virtual void AddFixedJointComponent(plGameObject *pOwner, const plPhysicsWorldModuleInterface::FixedJointConfig &cfg)
Adds a fixed joint to pOwner.
Definition PhysicsWorldModule.h:165
Helper class to expose physics to scripting.
Definition PhysicsWorldModule.h:175
static plPhysicsCastResult * Raycast(const plWorld *pWorld, const plVec3 &vStart, const plVec3 &vDir, float fDistance, plUInt32 uiCollisionLayer, plBitflags< plPhysicsShapeType > shapeTypes, plUInt32 uiIgnoreObjectFilterID)
The result object is allocated with the frame allocator and thus must be processed within the same fr...
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
A world encapsulates a scene graph of game objects and various component managers and their component...
Definition World.h:22
Definition WorldModule.h:10
The plBitflags class allows you to work with type-safe bitflags.
Definition Bitflags.h:82
Base class for all messages that are sent as 'events'.
Definition EventMessage.h:8
A handle to a game object.
Definition Declarations.h:76
Definition PhysicsWorldModule.h:263
Sent by components such as plJoltGrabObjectComponent to indicate that the object has been grabbed or ...
Definition PhysicsWorldModule.h:221
Used to apply a physical force on the object.
Definition PhysicsWorldModule.h:201
Used to apply a physical impulse on the object.
Definition PhysicsWorldModule.h:187
Definition PhysicsWorldModule.h:213
Send this to components such as plJoltGrabObjectComponent to demand that m_hGrabbedObjectToRelease sh...
Definition PhysicsWorldModule.h:230
Definition PhysicsWorldModule.h:43
Used for raycast and sweep tests.
Definition PhysicsWorldModule.h:23
plPhysicsHitType m_hitType
Classification of the triangle face, see plPhysicsHitType.
Definition PhysicsWorldModule.h:32
plGameObjectHandle m_hActorObject
The game object to which the parent actor of the hit physics shape is attached.
Definition PhysicsWorldModule.h:29
plUInt32 m_uiObjectFilterID
An ID either per object (rigid-body / ragdoll) or per shape (implementation specific) that can be use...
Definition PhysicsWorldModule.h:31
plSurfaceResourceHandle m_hSurface
The type of surface that was hit (if available)
Definition PhysicsWorldModule.h:30
plGameObjectHandle m_hShapeObject
The game object to which the hit physics shape is attached.
Definition PhysicsWorldModule.h:28
Definition PhysicsWorldModule.h:63
Used to report overlap query results.
Definition PhysicsWorldModule.h:49
plGameObjectHandle m_hActorObject
The game object to which the parent actor of the hit physics shape is attached.
Definition PhysicsWorldModule.h:53
plUInt32 m_uiObjectFilterID
The shape id of the hit physics shape.
Definition PhysicsWorldModule.h:54
plVec3 m_vCenterPosition
The center position of the reported object in world space.
Definition PhysicsWorldModule.h:55
plGameObjectHandle m_hShapeObject
The game object to which the hit physics shape is attached.
Definition PhysicsWorldModule.h:52
Definition PhysicsWorldModule.h:86
Definition PhysicsWorldModule.h:161
Definition PhysicsWorldModule.h:153
Definition SkeletonResource.h:24
Definition PhysicsWorldModule.h:255
Definition PhysicsWorldModule.h:246
Definition PhysicsWorldModule.h:239