AxisAlignedBox.hh
Go to the documentation of this file.
Mathematical representation of a box that is aligned along an X,Y,Z axis.
Definition: AxisAlignedBox.hh:43
bool IntersectCheck(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
AxisAlignedBox operator+(const AxisAlignedBox &_b) const
Addition operator. result = this + _b.
void SetMaterial(const Material &_mat)
Set the material associated with this box.
std::tuple< bool, double > IntersectDist(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
const AxisAlignedBox & operator+=(const AxisAlignedBox &_b)
Addition set operator. this = this + _b.
AxisAlignedBox operator-(const Vector3d &_v)
Subtract a vector from the min and max values.
AxisAlignedBox()
Default constructor. This constructor will set the box's minimum and maximum corners to the highest (...
void Merge(const AxisAlignedBox &_box)
Merge a box with this box.
bool MassMatrix(MassMatrix3d &_massMat) const
Get the mass matrix for this box. This function is only meaningful if the box's size and material hav...
AxisAlignedBox operator+(const Vector3d &_v)
Add a vector to the min and max values.
bool Intersects(const AxisAlignedBox &_box) const
Test box intersection. This test will only work if both box's minimum corner is less than or equal to...
std::tuple< bool, double, Vector3d > Intersect(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
bool Contains(const Vector3d &_p) const
Check if a point lies inside the box.
bool operator==(const AxisAlignedBox &_b) const
Equality test operator.
bool SetDensityFromMass(const double _mass)
Set the density of this box based on a mass value. Density is computed using double DensityFromMass(c...
std::tuple< bool, double, Vector3d > Intersect(const Line3d &_line) const
Check if a line intersects the box.
AxisAlignedBox(double _vec1X, double _vec1Y, double _vec1Z, double _vec2X, double _vec2Y, double _vec2Z)
Constructor. This constructor will compute the box's minimum and maximum corners based on the argumen...
AxisAlignedBox & operator=(const AxisAlignedBox &_b)
Assignment operator. Set this box to the parameter.
AxisAlignedBox(const AxisAlignedBox &_b)
Copy Constructor.
friend std::ostream & operator<<(std::ostream &_out, const AxisAlignedBox &_b)
Output operator.
Definition: AxisAlignedBox.hh:139
double DensityFromMass(const double _mass) const
Compute the cylinder's density given a mass value. The cylinder is assumed to be solid with uniform d...
bool operator!=(const AxisAlignedBox &_b) const
Inequality test operator.
const Material & Material() const
Get the material associated with this box.
AxisAlignedBox(const Vector3d &_vec1, const Vector3d &_vec2)
Constructor. This constructor will compute the box's minimum and maximum corners based on the two arg...
A three dimensional line segment. The line is defined by a start and end point.
Definition: Line3.hh:36
A class for inertial information about a rigid body consisting of the scalar mass and a 3x3 symmetric...
Definition: MassMatrix3.hh:46
The Vector3 class represents the generic vector containing 3 elements. Since it's commonly used to ke...
Definition: Vector3.hh:42
Definition: Angle.hh:43