RavEngine
Loading...
Searching...
No Matches
RavEngine::PhysicsCollider Class Reference
Inheritance diagram for RavEngine::PhysicsCollider:
[legend]
Collaboration diagram for RavEngine::PhysicsCollider:
[legend]

Public Types

enum class  CollisionType { Trigger , Collider }
 

Public Member Functions

void UpdateFilterData (PhysicsBodyComponent *owner)
 
void SetType (CollisionType)
 
CollisionType GetType () const
 
void SetQueryable (bool)
 
bool GetQueryable () const
 
void SetRelativeTransform (const vector3 &position, const quaternion &rotation)
 
Transformation GetRelativeTransform () const
 
virtual void DebugDraw (RavEngine::DebugDrawer &dbg, color_t debug_color, const RavEngine::Transform &) const
 

Protected Member Functions

matrix4 CalculateWorldMatrix (const RavEngine::Transform &) const
 

Protected Attributes

physx::PxShape * collider = nullptr
 
Ref< PhysicsMaterial > material
 

Friends

class PhysicsBodyComponent
 

Member Function Documentation

◆ CalculateWorldMatrix()

matrix4 PhysicsCollider::CalculateWorldMatrix ( const RavEngine::Transform &  tr) const
protected
Returns
the world matrix including rotation and position offsets
Precondition
This collider must be attached to an object

◆ DebugDraw()

virtual void RavEngine::PhysicsCollider::DebugDraw ( RavEngine::DebugDrawer &  dbg,
color_t  debug_color,
const RavEngine::Transform &   
) const
inlinevirtual

◆ GetQueryable()

bool RavEngine::PhysicsCollider::GetQueryable ( ) const
Returns
if the scene is queryable (see SetQueryable)
Precondition
This component must be added to an entity with a PhysicsBodyComponent before using this call.

◆ GetRelativeTransform()

Transformation PhysicsCollider::GetRelativeTransform ( ) const
Returns
relative transformation of this collider to the owning entity

◆ GetType()

PhysicsCollider::CollisionType RavEngine::PhysicsCollider::GetType ( ) const
Returns
if the current collider is a trigger or not
Precondition
This component must be added to an entity with a PhysicsBodyComponent before using this call.

◆ SetQueryable()

void RavEngine::PhysicsCollider::SetQueryable ( bool  state)

Set whether the collider participates in scene queries (raycasts, overlaps, etc)

Parameters
thenew state
Precondition
This component must be added to an entity with a PhysicsBodyComponent before using this call.

◆ SetRelativeTransform()

void PhysicsCollider::SetRelativeTransform ( const vector3 &  position,
const quaternion &  rotation 
)

Set PxShape relative transformation

Parameters
positionthe relative location of the shape
rotationthe relative rotation of the shape

◆ SetType()

void RavEngine::PhysicsCollider::SetType ( CollisionType  type)

Set the state to collider or trigger.

Parameters
thenew state
Precondition
This component must be added to an entity with a PhysicsBodyComponent before using this call.

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