7 #ifndef NAZARA_SPHERE_HPP 8 #define NAZARA_SPHERE_HPP 10 #include <Nazara/Core/String.hpp> 11 #include <Nazara/Math/Vector3.hpp> 15 struct SerializationContext;
17 template<
typename T>
class Box;
24 Sphere(T X, T Y, T Z, T Radius);
89 std::ostream& operator<<(std::ostream& out, const Nz::Sphere<T>& sphere);
91 #include <Nazara/Math/Sphere.inl> 93 #endif // NAZARA_SPHERE_HPP bool IsValid() const
Checks whether this sphere is valid.
Definition: Sphere.inl:307
static Sphere Unit()
Shorthand for the sphere (0, 0, 0, 1)
Definition: Sphere.inl:560
Sphere operator*(T scalar) const
Multiplies the radius of the sphere with a scalar.
Definition: Sphere.inl:507
TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
bool Unserialize(SerializationContext &context, bool *value)
Unserializes a boolean.
Definition: Algorithm.inl:279
T Distance(T X, T Y, T Z) const
Returns the distance from the sphere to the point (is negative when the point is inside the sphere) ...
Definition: Sphere.inl:141
Vector3< T > GetNegativeVertex(const Vector3< T > &normal) const
Computes the negative vertex of one direction.
Definition: Sphere.inl:203
static Sphere Lerp(const Sphere &from, const Sphere &to, T interpolation)
Interpolates the sphere to other one with a factor of interpolation.
Definition: Sphere.inl:583
Math class that represents a sphere "S2" in a three dimensional euclidean space.
Definition: Sphere.hpp:20
Sphere & MakeUnit()
Makes the sphere position (0, 0, 0) and radius 1.
Definition: Sphere.inl:320
Core class that represents a string.
Definition: String.hpp:22
Vector3< T > GetPositiveVertex(const Vector3< T > &normal) const
Computes the positive vertex of one direction.
Definition: Sphere.inl:232
bool Intersect(const Box< T > &box) const
Checks whether or not this sphere intersects a box.
Definition: Sphere.inl:248
Sphere & operator*=(T scalar)
Multiplies the radius of other sphere with a scalar.
Definition: Sphere.inl:520
bool Contains(T X, T Y, T Z) const
Tests whether the sphere contains the provided point inclusive of the edge of the sphere...
Definition: Sphere.inl:95
String ToString() const
Gives a string representation.
Definition: Sphere.inl:458
static Sphere Zero()
Shorthand for the sphere (0, 0, 0, 0)
Definition: Sphere.inl:610
Structure containing a serialization/unserialization context states.
Definition: SerializationContext.hpp:18
Sphere & MakeZero()
Makes the sphere position (0, 0, 0) and radius 0.
Definition: Sphere.inl:338
bool operator!=(const Sphere &sphere) const
Compares the sphere to other one.
Definition: Sphere.inl:547
T & operator[](std::size_t i)
Returns the ith element of the sphere.
Definition: Sphere.inl:475
bool Serialize(SerializationContext &context, bool value)
Serializes a boolean.
Definition: Algorithm.inl:214
Vector3< T > GetPosition() const
Gets a Vector3 of the position.
Definition: Sphere.inl:217
Sphere & ExtendTo(T X, T Y, T Z)
Extends the sphere to contain the point in the boundary.
Definition: Sphere.inl:171
bool operator==(const Sphere &sphere) const
Compares the sphere to other one.
Definition: Sphere.inl:533
Math class that represents an element of the three dimensional vector space.
Definition: Matrix4.hpp:22
Sphere & Set(T X, T Y, T Z, T Radius)
Sets the components of the sphere with center and radius.
Definition: Sphere.inl:359
Math class that represents a three dimensional box.
Definition: Box.hpp:22