15 cRayStart -= m_cBasePos;
19 cInvRayDir.
Set(1.0 / cInvRayDir.
GetX(),
20 1.0 / cInvRayDir.
GetY(),
21 1.0 / cInvRayDir.
GetZ());
28 fT1 = (m_cYBounds.
GetMin() - cRayStart.
GetY()) * cInvRayDir.
GetY();
29 fT2 = (m_cYBounds.
GetMax() - cRayStart.
GetY()) * cInvRayDir.
GetY();
30 fTmin =
Max(fTmin,
Min(fT1, fT2));
31 fTmax =
Min(fTmax,
Max(fT1, fT2));
32 if(fTmin > fTmax)
return false;
34 fT1 = (m_cZBounds.
GetMin() - cRayStart.
GetZ()) * cInvRayDir.
GetZ();
35 fT2 = (m_cZBounds.
GetMax() - cRayStart.
GetZ()) * cInvRayDir.
GetZ();
36 fTmin =
Max(fTmin,
Min(fT1, fT2));
37 fTmax =
Min(fTmax,
Max(fT1, fT2));
38 if(fTmin > fTmax)
return false;
40 if(fTmin >= 0) f_t_on_ray = fTmin / c_ray.
GetLength();
41 else if(fTmax >= 0) f_t_on_ray = fTmax / c_ray.
GetLength();
float Real
Collects all ARGoS code.
The namespace containing all the ARGoS related code.
T Max(const T &t_v1, const T &t_v2)
Returns the bigger of the two passed arguments.
T Min(const T &t_v1, const T &t_v2)
Returns the smaller of the two passed arguments.
bool Intersects(Real &f_t_on_ray, const CRay3 &c_ray)
CQuaternion Inverse() const
void GetDirection(CVector3 &c_buffer) const
CVector3 & Rotate(const CQuaternion &c_quaternion)
Rotates this vector by the given quaternion.
Real GetX() const
Returns the x coordinate of this vector.
void Set(const Real f_x, const Real f_y, const Real f_z)
Sets the vector contents from Cartesian coordinates.
Real GetY() const
Returns the y coordinate of this vector.
Real GetZ() const
Returns the z coordinate of this vector.