5#ifndef __IRR_TRIANGLE_3D_H_INCLUDED__
6#define __IRR_TRIANGLE_3D_H_INCLUDED__
38 return !(*
this==
other);
74 const T d1 =
rab.getDistanceFrom(
p);
75 const T d2 =
rbc.getDistanceFrom(
p);
76 const T d3 =
rca.getDistanceFrom(
p);
264 return (
res >= 0.0f);
Axis aligned bounding box in 3d dimensional space.
vector3d< T > MaxEdge
The far edge.
vector3d< T > MinEdge
The near edge.
bool isPointInside(const vector3d< T > &p) const
Determines if a point is within this box.
3d triangle template class for doing collision detection and other things.
bool getIntersectionWithLimitedLine(const line3d< T > &line, vector3d< T > &outIntersection) const
Get an intersection with a 3d line.
triangle3d()
Constructor for an all 0 triangle.
triangle3d(vector3d< T > v1, vector3d< T > v2, vector3d< T > v3)
Constructor for triangle with given three vertices.
plane3d< T > getPlane() const
Get the plane of this triangle.
bool getIntersectionWithLine(const vector3d< T > &linePoint, const vector3d< T > &lineVect, vector3d< T > &outIntersection) const
Get an intersection with a 3d line.
bool getIntersectionOfPlaneWithLine(const vector3d< T > &linePoint, const vector3d< T > &lineVect, vector3d< T > &outIntersection) const
Calculates the intersection between a 3d line and the plane the triangle is on.
bool isPointInsideFast(const vector3d< T > &p) const
Check if a point is inside the triangle (border-points count also as inside)
bool operator!=(const triangle3d< T > &other) const
Inequality operator.
bool isTotalInsideBox(const aabbox3d< T > &box) const
Determines if the triangle is totally inside a bounding box.
bool isFrontFacing(const vector3d< T > &lookDirection) const
Test if the triangle would be front or backfacing from any point.
core::vector3d< T > closestPointOnTriangle(const core::vector3d< T > &p) const
Get the closest point on a triangle to a point on the same plane.
bool operator==(const triangle3d< T > &other) const
Equality operator.
bool isPointInside(const vector3d< T > &p) const
Check if a point is inside the triangle (border-points count also as inside)
bool isTotalOutsideBox(const aabbox3d< T > &box) const
Determines if the triangle is totally outside a bounding box.
vector3d< T > pointA
the three points of the triangle
vector3d< T > getNormal() const
Get the normal of the triangle.
void set(const core::vector3d< T > &a, const core::vector3d< T > &b, const core::vector3d< T > &c)
sets the triangle's points
T getArea() const
Get the area of the triangle.
#define F32_LOWER_EQUAL_0(n)
triangle3d< f32 > triangle3df
Typedef for a f32 3d triangle.
triangle3d< s32 > triangle3di
Typedef for an integer 3d triangle.
const f32 ROUNDING_ERROR_f32
bool iszero(const f64 a, const f64 tolerance=ROUNDING_ERROR_f64)
returns if a equals zero, taking rounding errors into account
Everything in the Irrlicht Engine can be found in this namespace.
float f32
32 bit floating point variable.
double f64
64 bit floating point variable.