Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
CharacterVsCharacterCollisionSimple Class Reference

#include <CharacterVirtual.h>

Inheritance diagram for CharacterVsCharacterCollisionSimple:
CharacterVsCharacterCollision NonCopyable

Public Member Functions

void Add (CharacterVirtual *inCharacter)
 Add a character to the list of characters to check collision against. More...
 
void Remove (const CharacterVirtual *inCharacter)
 Remove a character from the list of characters to check collision against. More...
 
virtual void CollideCharacter (const CharacterVirtual *inCharacter, RMat44Arg inCenterOfMassTransform, const CollideShapeSettings &inCollideShapeSettings, RVec3Arg inBaseOffset, CollideShapeCollector &ioCollector) const override
 
virtual void CastCharacter (const CharacterVirtual *inCharacter, RMat44Arg inCenterOfMassTransform, Vec3Arg inDirection, const ShapeCastSettings &inShapeCastSettings, RVec3Arg inBaseOffset, CastShapeCollector &ioCollector) const override
 
- Public Member Functions inherited from CharacterVsCharacterCollision
virtual ~CharacterVsCharacterCollision ()=default
 
virtual void CollideCharacter (const CharacterVirtual *inCharacter, RMat44Arg inCenterOfMassTransform, const CollideShapeSettings &inCollideShapeSettings, RVec3Arg inBaseOffset, CollideShapeCollector &ioCollector) const =0
 
virtual void CastCharacter (const CharacterVirtual *inCharacter, RMat44Arg inCenterOfMassTransform, Vec3Arg inDirection, const ShapeCastSettings &inShapeCastSettings, RVec3Arg inBaseOffset, CastShapeCollector &ioCollector) const =0
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Public Attributes

Array< CharacterVirtual * > mCharacters
 The list of characters to check collision against. More...
 

Detailed Description

Simple collision checker that loops over all registered characters. Note that this is not thread safe, so make sure that only one CharacterVirtual is checking collision at a time.

Member Function Documentation

◆ Add()

void CharacterVsCharacterCollisionSimple::Add ( CharacterVirtual inCharacter)
inline

Add a character to the list of characters to check collision against.

◆ CastCharacter()

void CharacterVsCharacterCollisionSimple::CastCharacter ( const CharacterVirtual inCharacter,
RMat44Arg  inCenterOfMassTransform,
Vec3Arg  inDirection,
const ShapeCastSettings inShapeCastSettings,
RVec3Arg  inBaseOffset,
CastShapeCollector ioCollector 
) const
overridevirtual

Cast a character against other CharacterVirtuals.

Parameters
inCharacterThe character to cast.
inCenterOfMassTransformCenter of mass transform for this character.
inDirectionDirection and length to cast in.
inShapeCastSettingsSettings for the shape cast.
inBaseOffsetAll hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. GetPosition() since floats are most accurate near the origin
ioCollectorCollision collector that receives the collision results.

Implements CharacterVsCharacterCollision.

◆ CollideCharacter()

void CharacterVsCharacterCollisionSimple::CollideCharacter ( const CharacterVirtual inCharacter,
RMat44Arg  inCenterOfMassTransform,
const CollideShapeSettings inCollideShapeSettings,
RVec3Arg  inBaseOffset,
CollideShapeCollector ioCollector 
) const
overridevirtual

Collide a character against other CharacterVirtuals.

Parameters
inCharacterThe character to collide.
inCenterOfMassTransformCenter of mass transform for this character.
inCollideShapeSettingsSettings for the collision check.
inBaseOffsetAll hit results will be returned relative to this offset, can be zero to get results in world position, but when you're testing far from the origin you get better precision by picking a position that's closer e.g. GetPosition() since floats are most accurate near the origin
ioCollectorCollision collector that receives the collision results.

Implements CharacterVsCharacterCollision.

◆ Remove()

JPH_NAMESPACE_BEGIN void CharacterVsCharacterCollisionSimple::Remove ( const CharacterVirtual inCharacter)

Remove a character from the list of characters to check collision against.

Member Data Documentation

◆ mCharacters

Array<CharacterVirtual *> CharacterVsCharacterCollisionSimple::mCharacters

The list of characters to check collision against.


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