Cleanup.
This commit is contained in:
parent
88e00edf4d
commit
b0ae54f14a
@ -531,7 +531,7 @@ bool intersect(const Ray& _ray, const Disk& _disk, Intersection* _intersection)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Intersection* _intersection)
|
||||
static bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Intersection* _intersection)
|
||||
{
|
||||
float axis[3];
|
||||
bx::vec3Sub(axis, _cylinder.m_end, _cylinder.m_pos);
|
||||
@ -652,6 +652,17 @@ bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Inters
|
||||
return false;
|
||||
}
|
||||
|
||||
bool intersect(const Ray& _ray, const Cylinder& _cylinder, Intersection* _intersection)
|
||||
{
|
||||
return intersect(_ray, _cylinder, false, _intersection);
|
||||
}
|
||||
|
||||
bool intersect(const Ray& _ray, const Capsule& _capsule, Intersection* _intersection)
|
||||
{
|
||||
BX_STATIC_ASSERT(sizeof(Capsule) == sizeof(Cylinder) );
|
||||
return intersect(_ray, *( (const Cylinder*)&_capsule), true, _intersection);
|
||||
}
|
||||
|
||||
bool intersect(const Ray& _ray, const Cone& _cone, Intersection* _intersection)
|
||||
{
|
||||
float axis[3];
|
||||
|
@ -19,6 +19,13 @@ struct Cylinder
|
||||
float m_radius;
|
||||
};
|
||||
|
||||
struct Capsule
|
||||
{
|
||||
float m_pos[3];
|
||||
float m_end[3];
|
||||
float m_radius;
|
||||
};
|
||||
|
||||
struct Cone
|
||||
{
|
||||
float m_pos[3];
|
||||
@ -123,7 +130,10 @@ Ray makeRay(float _x, float _y, const float* _invVp);
|
||||
bool intersect(const Ray& _ray, const Aabb& _aabb, Intersection* _intersection = NULL);
|
||||
|
||||
/// Intersect ray / cylinder.
|
||||
bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Intersection* _intersection = NULL);
|
||||
bool intersect(const Ray& _ray, const Cylinder& _cylinder, Intersection* _intersection = NULL);
|
||||
|
||||
/// Intersect ray / capsule.
|
||||
bool intersect(const Ray& _ray, const Capsule& _capsule, Intersection* _intersection = NULL);
|
||||
|
||||
/// Intersect ray / cone.
|
||||
bool intersect(const Ray& _ray, const Cone& _cone, Intersection* _intersection = NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user