10 #include <Nazara/Core/String.hpp> 11 #include <Nazara/Math/Enums.hpp> 12 #include <Nazara/Math/Matrix4.hpp> 13 #include <Nazara/Math/Rect.hpp> 14 #include <Nazara/Math/Sphere.hpp> 15 #include <Nazara/Math/Vector3.hpp> 19 struct SerializationContext;
26 Box(T Width, T Height, T Depth);
27 Box(T X, T Y, T Z, T Width, T Height, T Depth);
32 template<
typename U>
explicit Box(
const Box<U>& box);
33 Box(
const Box& box) =
default;
63 Box&
Set(T Width, T Height, T Depth);
64 Box&
Set(T X, T Y, T Z, T Width, T Height, T Depth);
82 Box& operator=(
const Box& other) =
default;
90 static Box Lerp(
const Box& from,
const Box& to, T interpolation);
93 T x, y, z, width, height, depth;
108 std::ostream& operator<<(std::ostream& out, const Nz::Box<T>& box);
111 #include <Nazara/Math/Box.inl> 113 #endif // NAZARA_BOX_HPP Sphere< T > GetSquaredBoundingSphere() const
Gets the squared bounding sphere for the box.
Definition: Box.inl:431
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Box & ExtendTo(T X, T Y, T Z)
Extends the box to contain the point in the boundary.
Definition: Box.inl:184
T & operator[](std::size_t i)
Returns the ith element of the box.
Definition: Box.inl:744
bool Intersect(const Box &box, Box *intersection=nullptr) const
Checks whether or not this box intersects another one.
Definition: Box.inl:459
static Box Lerp(const Box &from, const Box &to, T interpolation)
Interpolates the box to other one with a factor of interpolation.
Definition: Box.inl:870
bool Unserialize(SerializationContext &context, bool *value)
Unserializes a boolean.
Definition: Algorithm.inl:279
bool Contains(T X, T Y, T Z) const
Tests whether the box contains the provided point inclusive of the edge of the box.
Definition: Box.inl:134
Sphere< T > GetBoundingSphere() const
Gets the bounding sphere for the box.
Definition: Box.inl:251
Box & MakeZero()
Makes the box position (0, 0, 0) and lengths (0, 0, 0)
Definition: Box.inl:508
Math class that represents a sphere "S2" in a three dimensional euclidean space.
Definition: Sphere.hpp:20
Core class that represents a string.
Definition: String.hpp:22
Box & operator*=(T scalar)
Multiplies the lengths of this box with the scalar.
Definition: Box.inl:802
Vector3< T > GetCenter() const
Gets a Vector3 for the center.
Definition: Box.inl:262
T GetSquaredRadius() const
Gets the squared radius of the box.
Definition: Box.inl:442
Math class that represents an axis-aligned rectangle in two dimensions.
Definition: Rect.hpp:19
bool IsValid() const
Checks whether this box is valid.
Definition: Box.inl:495
Box & Translate(const Vector3< T > &translation)
Translates the box.
Definition: Box.inl:725
T GetRadius() const
Gets the radius of the box.
Definition: Box.inl:418
Vector3< T > GetNegativeVertex(const Vector3< T > &normal) const
Computes the negative vertex of one direction.
Definition: Box.inl:357
String ToString() const
Gives a string representation.
Definition: Box.inl:689
Vector3< T > GetPositiveVertex(const Vector3< T > &normal) const
Computes the positive vertex of one direction.
Definition: Box.inl:396
Structure containing a serialization/unserialization context states.
Definition: SerializationContext.hpp:18
bool Serialize(SerializationContext &context, bool value)
Serializes a boolean.
Definition: Algorithm.inl:214
bool operator==(const Box &box) const
Compares the box to other one.
Definition: Box.inl:836
Vector3< T > GetMaximum() const
Gets a Vector3 for the maximum point.
Definition: Box.inl:329
Vector3< T > GetMinimum() const
Gets a Vector3 for the minimum point.
Definition: Box.inl:342
Box operator*(T scalar) const
Multiplies the lengths with the scalar.
Definition: Box.inl:776
Box & Set(T Width, T Height, T Depth)
Sets the components of the box with width, height and depth.
Definition: Box.inl:532
Math class that represents a transformation of the four dimensional vector space with the notion of p...
Definition: Matrix4.hpp:26
static Box Zero()
Shorthand for the box (0, 0, 0, 0, 0, 0)
Definition: Box.inl:899
Vector3< T > GetLengths() const
Gets a Vector3 for the lengths.
Definition: Box.inl:316
Math class that represents an element of the three dimensional vector space.
Definition: Matrix4.hpp:22
Vector3< T > GetPosition() const
Gets a Vector3 for the position.
Definition: Box.inl:381
Vector3< T > GetCorner(BoxCorner corner) const
Gets the Vector3 for the corner.
Definition: Box.inl:277
Box & Transform(const Matrix4< T > &matrix, bool applyTranslation=true)
Transforms the box according to the matrix.
Definition: Box.inl:705
bool operator!=(const Box &box) const
Compares the box to other one.
Definition: Box.inl:850
Math class that represents a three dimensional box.
Definition: Box.hpp:22