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.
13 lines
421 B
13 lines
421 B
#include"Ray.h"
|
|
Ray::Ray(const Vector3& origin, const Vector3& direction, const Vector3& attenuation) {
|
|
Set(origin, direction, attenuation);
|
|
}
|
|
void Ray::Set(const Vector3& origin, const Vector3& direction, const Vector3& attenuation) {
|
|
mOrigin = origin;
|
|
mDirection = direction;
|
|
mDirection.Normalize();
|
|
mLightAttenuation = attenuation;
|
|
}
|
|
Vector3 Ray::PointAt(float k) {
|
|
return mOrigin + k * mDirection;
|
|
}
|