controllers, ray3

This commit is contained in:
Irlan
2018-06-29 15:40:12 -03:00
parent 8ebdb67a75
commit b18654c7a5
10 changed files with 413 additions and 357 deletions

View File

@@ -22,6 +22,24 @@
#include <bounce/common/math/math.h>
#include <bounce/common/math/transform.h>
// A ray.
struct b3Ray3
{
b3Vec3 A() const
{
return origin;
}
b3Vec3 B() const
{
return origin + fraction * direction;
}
b3Vec3 direction;
b3Vec3 origin;
float32 fraction;
};
// A plane in constant normal form.
// dot(n, p) - d = 0.
struct b3Plane