Emergency 20 Dokumentation  4.2.0
em5::CollisionHelper Class Reference

EMERGENCY 5 collision helper class. More...

#include <CollisionHelper.h>

Inheritance diagram for em5::CollisionHelper:
qsf::CollisionHelper

Public Member Functions

 CollisionHelper (qsf::Map &map)
 Constructor. More...
 
 ~CollisionHelper ()
 Destructor. More...
 
bool isInWater (qsf::Entity &entity, bool includePositionHeight=false) const
 "true" if entity is in water More...
 
bool isInWater (const glm::vec3 &position, bool includePositionHeight=false, float waterHeight=1.0f) const
 "true" if position is in water More...
 
bool isInBlockedArea (const qsf::Entity &caller, qsf::Entity &target) const
 "true" if target is in blocking area for caller More...
 
bool isInBlockedArea (const qsf::Entity &caller, const glm::vec3 &position) const
 
bool findFreePositionEM3 (const qsf::Entity &sourceEntity, const qsf::Transform &transform, float radius, float safety, glm::vec3 &outPosition) const
 Tries to find a free position where to place the given entity New version with EM3 router. More...
 
bool findFreePositionEM3 (const qsf::Entity &sourceEntity, float searchRadius, float safety, glm::vec3 &outPosition) const
 
bool findFreePositionEM3 (const qsf::Entity &sourceEntity, const glm::vec3 &position, float searchRadius, float safety, glm::vec3 &outPosition) const
 
bool hasCollisionEM3 (const qsf::Entity &sourceEntity, float searchRadius, float safety) const
 
bool hasCollisionEM3 (const qsf::Entity &sourceEntity, const glm::vec3 &position, float safety) const
 
bool hasCollisionEM3 (const glm::vec3 &boxExtends, const qsf::Transform &transform) const
 
bool hasCollisionEM3IgnoreEntity (const glm::vec3 &boxExtends, const qsf::Transform &transform, qsf::Entity &ignoreEntity) const
 
bool hasCollisionEM3Helilanding (const qsf::Entity &sourceEntity, const glm::vec3 &position, float safety) const
 
bool findFreePositionEM3Safety (const qsf::Entity &sourceEntity, const qsf::Transform &transform, float radius1, float radius2, float radius3, float safety, glm::vec3 &outPosition) const
 
bool isEntityUnderBridge (qsf::Entity &entity) const
 
- Public Member Functions inherited from qsf::CollisionHelper
 CollisionHelper (Map &map)
 Constructor. More...
 
 ~CollisionHelper ()
 Destructor. More...
 
bool doesEntityCollideWithAnyOf (const Entity &source, const std::vector< Entity * > &targets) const
 Returns whether the source entity is colliding with the target or any of the list of target objects. More...
 
bool doesEntityCollideWith (const Entity &source, const Entity &target) const
 
bool canBeAddedWithoutCollision (const Entity &source) const
 Checks whether the entity can be added at its current position without creating a collision. More...
 
bool canBeAddedWithoutCollision (const Transform &transform, BulletCollisionComponent &collisionComponent) const
 Checks whether an entity with the given transform and collision setup can be added without creating a collision. More...
 
bool findFreePosition (const Entity &sourceEntity, const Transform &transform, float radius, float safety, uint16 collisionFlags, glm::vec3 &outPosition) const
 Tries to find a free position where to place the given entity. More...
 
bool findPhysicsFreePosition (const qsf::Entity &sourceEntity, const qsf::Transform &transform, float radius, uint16 collisionFlags, glm::vec3 &outPosition) const
 
bool getCollisionsAt (const Transform &transform, btCollisionShape &collisionShape, std::vector< BulletCollisionComponent * > &outCollisions) const
 Check for colliding components when inserting a collision shape. More...
 
bool getCollisionsAt (btCollisionObject &collisionObject, std::vector< Entity * > &outCollisions, uint16 filterGroup=0xffff, uint16 filterMask=0xffff) const
 Check for colliding components for an existing collision object. More...
 
bool getCollisionsAt (btCollisionObject &collisionObject, std::vector< PhysicsWorldComponent::HitResult > &outCollisions, uint16 filterGroup=0xffff, uint16 filterMask=0xffff) const
 

Additional Inherited Members

- Protected Attributes inherited from qsf::CollisionHelper
MapmMap
 

Detailed Description

EMERGENCY 5 collision helper class.

Constructor & Destructor Documentation

em5::CollisionHelper::CollisionHelper ( qsf::Map map)
inlineexplicit

Constructor.

em5::CollisionHelper::~CollisionHelper ( )
inline

Destructor.

Member Function Documentation

bool em5::CollisionHelper::findFreePositionEM3 ( const qsf::Entity sourceEntity,
const qsf::Transform transform,
float  radius,
float  safety,
glm::vec3 &  outPosition 
) const

Tries to find a free position where to place the given entity New version with EM3 router.

Parameters
[in]sourceEntityThe entity to find a collision-free position for
[in]transformThe preferred transformation for the entity, around which a valid position should be found
[in]radiusRadius of the area to search for a free position
[in]safetyAdditional space required around the entity at the target position, so that it will be accepted as valid free position
[in]collisionFlagsCollision bitmask
[out]outPositionThe resulting position; not touched if result is "false"
Returns
"true" if a position was found, "false" if not
bool em5::CollisionHelper::findFreePositionEM3 ( const qsf::Entity sourceEntity,
float  searchRadius,
float  safety,
glm::vec3 &  outPosition 
) const
bool em5::CollisionHelper::findFreePositionEM3 ( const qsf::Entity sourceEntity,
const glm::vec3 &  position,
float  searchRadius,
float  safety,
glm::vec3 &  outPosition 
) const
bool em5::CollisionHelper::findFreePositionEM3Safety ( const qsf::Entity sourceEntity,
const qsf::Transform transform,
float  radius1,
float  radius2,
float  radius3,
float  safety,
glm::vec3 &  outPosition 
) const
bool em5::CollisionHelper::hasCollisionEM3 ( const qsf::Entity sourceEntity,
float  searchRadius,
float  safety 
) const
bool em5::CollisionHelper::hasCollisionEM3 ( const qsf::Entity sourceEntity,
const glm::vec3 &  position,
float  safety 
) const
bool em5::CollisionHelper::hasCollisionEM3 ( const glm::vec3 &  boxExtends,
const qsf::Transform transform 
) const
bool em5::CollisionHelper::hasCollisionEM3Helilanding ( const qsf::Entity sourceEntity,
const glm::vec3 &  position,
float  safety 
) const
bool em5::CollisionHelper::hasCollisionEM3IgnoreEntity ( const glm::vec3 &  boxExtends,
const qsf::Transform transform,
qsf::Entity ignoreEntity 
) const
bool em5::CollisionHelper::isEntityUnderBridge ( qsf::Entity entity) const
bool em5::CollisionHelper::isInBlockedArea ( const qsf::Entity caller,
qsf::Entity target 
) const

"true" if target is in blocking area for caller

bool em5::CollisionHelper::isInBlockedArea ( const qsf::Entity caller,
const glm::vec3 &  position 
) const
bool em5::CollisionHelper::isInWater ( qsf::Entity entity,
bool  includePositionHeight = false 
) const

"true" if entity is in water

bool em5::CollisionHelper::isInWater ( const glm::vec3 &  position,
bool  includePositionHeight = false,
float  waterHeight = 1.0f 
) const

"true" if position is in water


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