10 #include <Nazara/Core/String.hpp> 11 #include <Nazara/Math/Box.hpp> 12 #include <Nazara/Math/Frustum.hpp> 13 #include <Nazara/Math/Matrix4.hpp> 14 #include <Nazara/Math/OrientedBox.hpp> 15 #include <Nazara/Math/Plane.hpp> 16 #include <Nazara/Math/Sphere.hpp> 17 #include <Nazara/Math/Vector3.hpp> 21 struct SerializationContext;
28 Ray(T X, T Y, T Z, T directionX, T directionY, T directionZ);
30 Ray(
const T origin[3],
const T direction[3]);
32 template<
typename U>
explicit Ray(
const Ray<U>& ray);
42 bool Intersect(
const Box<T>& box, T* closestHit =
nullptr, T* furthestHit =
nullptr)
const;
46 bool Intersect(
const Sphere<T>& sphere, T* closestHit =
nullptr, T* furthestHit =
nullptr)
const;
53 Ray&
Set(T X, T Y, T Z, T directionX, T directionY, T directionZ);
55 Ray&
Set(
const T origin[3],
const T direction[3]);
64 Ray& operator=(
const Ray& other) =
default;
72 static Ray Lerp(
const Ray& from,
const Ray& to, T interpolation);
84 template<
typename T> std::ostream& operator<<(std::ostream& out, const Nz::Ray<T>& vec);
86 #include <Nazara/Math/Ray.inl> 88 #endif // NAZARA_RAY_HPP TODO: Inherit SoundEmitter from Node.
Definition: Algorithm.hpp:12
Math class that represents an oriented three dimensional box.
Definition: OrientedBox.hpp:20
static Ray AxisX()
Shorthand for the ray (0, 0, 0), (1, 0, 0)
Definition: Ray.inl:708
bool Unserialize(SerializationContext &context, bool *value)
Unserializes a boolean.
Definition: Algorithm.inl:279
T ClosestPoint(const Vector3< T > &point) const
Finds the closest point of the ray from point.
Definition: Ray.inl:116
Math class that represents a plane in 3D.
Definition: Plane.hpp:18
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
static Ray AxisY()
Shorthand for the ray (0, 0, 0), (0, 1, 0)
Definition: Ray.inl:724
String ToString() const
Gives a string representation.
Definition: Ray.inl:652
bool Intersect(const BoundingVolume< T > &volume, T *closestHit=nullptr, T *furthestHit=nullptr) const
Checks whether or not this ray intersects with the BoundingVolume.
Definition: Ray.inl:154
Math class that represents a bounding volume, a combination of a box and an oriented box...
Definition: BoundingVolume.hpp:20
Vector3< T > GetPoint(T lambda) const
Gets the point along the ray for this parameter.
Definition: Ray.inl:133
bool operator!=(const Ray &ray) const
Compares the ray to other one.
Definition: Ray.inl:695
Structure containing a serialization/unserialization context states.
Definition: SerializationContext.hpp:18
static Ray Lerp(const Ray &from, const Ray &to, T interpolation)
Interpolates the ray to other one with a factor of interpolation.
Definition: Ray.inl:762
Ray & MakeAxisY()
Makes the ray with position (0, 0, 0) and direction (0, 1, 0)
Definition: Ray.inl:484
Ray & Set(T X, T Y, T Z, T directionX, T directionY, T directionZ)
Sets the components of the ray with position and direction.
Definition: Ray.inl:515
bool Serialize(SerializationContext &context, bool value)
Serializes a boolean.
Definition: Algorithm.inl:214
Ray & MakeAxisX()
Makes the ray with position (0, 0, 0) and direction (1, 0, 0)
Definition: Ray.inl:471
Vector3< T > operator*(T lambda) const
Multiplies the direction ray with the lambda to get the point along the ray for this parameter...
Definition: Ray.inl:669
Math class that represents a transformation of the four dimensional vector space with the notion of p...
Definition: Matrix4.hpp:26
Ray & MakeAxisZ()
Makes the ray with position (0, 0, 0) and direction (0, 0, 1)
Definition: Ray.inl:497
static Ray AxisZ()
Shorthand for the ray (0, 0, 0), (0, 0, 1)
Definition: Ray.inl:740
bool operator==(const Ray &ray) const
Compares the ray to other one.
Definition: Ray.inl:682
Math class that represents an element of the three dimensional vector space.
Definition: Matrix4.hpp:22
Math class that represents a ray or a straight line in 3D space.
Definition: Ray.hpp:24
Math class that represents a three dimensional box.
Definition: Box.hpp:22