You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
427 B
19 lines
427 B
#include "Ray.h"
|
|
|
|
Ray::Ray(const Vector3 & origin, const Vector3 & direction, Vector3 & attenuation)
|
|
{
|
|
Set(origin, direction, attenuation);
|
|
}
|
|
|
|
void Ray::Set(const Vector3 & origin, const Vector3 & direction, Vector3 & attenuation)
|
|
{
|
|
mOrigin = origin;
|
|
mDirection = direction;
|
|
mDirection.Normalize();
|
|
mLightAttenuation = attenuation;
|
|
}
|
|
|
|
Vector3 Ray::PointAt(float k)
|
|
{
|
|
return mOrigin + k * mDirection;
|
|
}
|