Minetest  5.4.0
raycast.cpp File Reference
#include "raycast.h"
#include "irr_v3d.h"
#include "irr_aabb3d.h"
#include "constants.h"
+ Include dependency graph for raycast.cpp:

Functions

bool boxLineCollision (const aabb3f &box, const v3f &start, const v3f &dir, v3f *collision_point, v3s16 *collision_normal)
 

Function Documentation

◆ boxLineCollision()

bool boxLineCollision ( const aabb3f box,
const v3f start,
const v3f dir,
v3f collision_point,
v3s16 collision_normal 
)

Checks if a line and a box intersects.

Parameters
[in]boxbox to test collision
[in]startstarting point of the line
[in]dirdirection and length of the line
[out]collision_pointfirst point of the collision
[out]collision_normalnormal vector at the collision, points outwards of the surface. If start is in the box, zero vector.
Returns
true if a collision point was found

References dir().

Referenced by Environment::continueRaycast(), ClientEnvironment::getSelectedActiveObjects(), and ServerEnvironment::getSelectedActiveObjects().

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