2022-11-19 04:21:46 +08:00
|
|
|
/****************************************************************************************
|
|
|
|
* \file Ray.cxx
|
|
|
|
* \author Diren D Bharwani, diren.dbharwani, 390002520
|
|
|
|
* \brief Implementation for the managed Ray struct.
|
|
|
|
*
|
|
|
|
* \copyright Copyright (C) 2022 DigiPen Institute of Technology. Reproduction or
|
|
|
|
* disclosure of this file or its contents without the prior written consent
|
|
|
|
* of DigiPen Institute of Technology is prohibited.
|
|
|
|
****************************************************************************************/
|
2022-10-20 17:07:21 +08:00
|
|
|
|
|
|
|
#include "SHpch.h"
|
2022-11-19 04:21:46 +08:00
|
|
|
|
2022-10-20 17:07:21 +08:00
|
|
|
// Primary Header
|
2022-11-19 04:21:46 +08:00
|
|
|
#include "Ray.hxx"
|
2022-10-20 17:07:21 +08:00
|
|
|
|
|
|
|
namespace SHADE
|
|
|
|
{
|
2022-11-19 04:21:46 +08:00
|
|
|
/*-----------------------------------------------------------------------------------*/
|
|
|
|
/* Constructor Definitions */
|
|
|
|
/*-----------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
Ray::Ray(Vector3 position, Vector3 direction)
|
|
|
|
{
|
|
|
|
Position = position;
|
|
|
|
Direction = direction;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------------*/
|
|
|
|
/* Function Member Definitions */
|
|
|
|
/*-----------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
void Ray::LookAt(Vector3 target)
|
|
|
|
{
|
|
|
|
Direction = (target - Position).GetNormalised();
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace SHADE
|