12 #ifndef RAYSPHEREHITTEST_H_6014714286 13 #define RAYSPHEREHITTEST_H_6014714286 15 #include <Carna/Carna.h> 48 template<
typename VectorType,
typename ScalarType >
53 VectorType myHitLocation;
86 template<
typename VectorType,
typename ScalarType >
88 : myHitExists( false )
93 template<
typename VectorType,
typename ScalarType >
100 template<
typename VectorType,
typename ScalarType >
104 return myHitLocation;
108 template<
typename VectorType,
typename ScalarType >
112 CARNA_ASSERT( isEqual< ScalarType >( planeNormal.norm(), 1 ) );
127 #endif // RAYSPHEREHITTEST_H_6014714286 Defines Carna::base::math namespace and CARNA_FOR_VECTOR3UI.
void compute(const Ray< VectorType > &ray, const ScalarType radius)
Performs a hit test of ray with a sphere of radius radius. The sphere is assumed to be centered in th...
VectorType origin
Holds the origin of this ray.
Tests whether sphere in origin is hit by a Ray object.
Defines ray in where is the Scalar type derived from VectorType and is dimension of VectorType...
VectorType direction
Holds the direction of this ray.
RaySphereHitTest()
Instantiates.
Defines Carna::base::CarnaException, Carna::base::AssertionFailure.
Defines Carna::base::math::Ray.
#define CARNA_ASSERT(expression)
If the given expression is false, a break point is raised in debug mode and an AssertionFailure throw...
const VectorType & hitLocation() const
References the location of the hit.
bool hitExists() const
Tells whether a hit exists.