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

4 years ago
  1. #include "Ray.h"
  2. Ray::Ray(const Vector3 & origin, const Vector3 & direction, Vector3 & attenuation)
  3. {
  4. Set(origin, direction, attenuation);
  5. }
  6. void Ray::Set(const Vector3 & origin, const Vector3 & direction, Vector3 & attenuation)
  7. {
  8. mOrigin = origin;
  9. mDirection = direction;
  10. mDirection.Normalize();
  11. mLightAttenuation = attenuation;
  12. }
  13. Vector3 Ray::PointAt(float k)
  14. {
  15. return mOrigin + k * mDirection;
  16. }