Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
collision.h File Reference
#include "irrlichttypes_bloated.h"
#include <vector>
+ Include dependency graph for collision.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CollisionInfo
 
struct  collisionMoveResult
 

Enumerations

enum  CollisionType : u8 { COLLISION_NODE , COLLISION_OBJECT }
 
enum  CollisionAxis : s8 { COLLISION_AXIS_NONE = -1 , COLLISION_AXIS_X , COLLISION_AXIS_Y , COLLISION_AXIS_Z }
 

Functions

collisionMoveResult collisionMoveSimple (Environment *env, IGameDef *gamedef, const aabb3f &box_0, f32 stepheight, f32 dtime, v3f *pos_f, v3f *speed_f, v3f accel_f, ActiveObject *self=NULL, bool collide_with_objects=true)
 
bool collision_check_intersection (Environment *env, IGameDef *gamedef, const aabb3f &box_0, const v3f &pos_f, ActiveObject *self=nullptr, bool collide_with_objects=true)
 A simpler version of "collisionMoveSimple" that only checks whether a collision occurs at the given position.
 
CollisionAxis axisAlignedCollision (const aabb3f &staticbox, const aabb3f &movingbox, v3f speed, f32 *dtime)
 
bool wouldCollideWithCeiling (const std::vector< aabb3f > &staticboxes, const aabb3f &movingbox, f32 y_increase, f32 d)
 

Variables

bool g_collision_problems_encountered
 Status if any problems were ever encountered during collision detection.
 

Enumeration Type Documentation

◆ CollisionAxis

enum CollisionAxis : s8
Enumerator
COLLISION_AXIS_NONE 
COLLISION_AXIS_X 
COLLISION_AXIS_Y 
COLLISION_AXIS_Z 

◆ CollisionType

enum CollisionType : u8
Enumerator
COLLISION_NODE 
COLLISION_OBJECT 

Function Documentation

◆ axisAlignedCollision()

CollisionAxis axisAlignedCollision ( const aabb3f & staticbox,
const aabb3f & movingbox,
v3f speed,
f32 * dtime )

References COLLISION_AXIS_NONE, COLLISION_AXIS_X, COLLISION_AXIS_Y, and COLLISION_AXIS_Z.

Referenced by collisionMoveSimple(), and TestCollision::testAxisAlignedCollision().

+ Here is the caller graph for this function:

◆ collision_check_intersection()

bool collision_check_intersection ( Environment * env,
IGameDef * gamedef,
const aabb3f & box_0,
const v3f & pos_f,
ActiveObject * self = nullptr,
bool collide_with_objects = true )

A simpler version of "collisionMoveSimple" that only checks whether a collision occurs at the given position.

Parameters
self(optional) ActiveObject to ignore in the collision detection.
Returns
true when box_0 truly intersects with a node or object. Touching faces are not counted as intersection.

References add_area_node_boxes(), add_object_boxes(), BS, floatToInt(), g_profiler, PRECISION_MICRO, PROFILER_NAME, and SPT_AVG.

Referenced by LocalPlayer::move().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ collisionMoveSimple()

collisionMoveResult collisionMoveSimple ( Environment * env,
IGameDef * gamedef,
const aabb3f & box_0,
f32 stepheight,
f32 dtime,
v3f * pos_f,
v3f * speed_f,
v3f accel_f,
ActiveObject * self = NULL,
bool collide_with_objects = true )

◆ wouldCollideWithCeiling()

bool wouldCollideWithCeiling ( const std::vector< aabb3f > & staticboxes,
const aabb3f & movingbox,
f32 y_increase,
f32 d )

Variable Documentation

◆ g_collision_problems_encountered

bool g_collision_problems_encountered
extern

Status if any problems were ever encountered during collision detection.

Warning
For unit test use only.

Referenced by collisionMoveSimple(), and TestCollision::testCollisionMoveSimple().