Ray direction are automatically normalised

This commit is contained in:
Diren D Bharwani 2023-01-26 01:11:57 +08:00
parent 4ed7aa3aed
commit 6b9a64233e
3 changed files with 455 additions and 3 deletions

File diff suppressed because it is too large Load Diff

View File

@ -219,7 +219,7 @@
Scripts:
- Type: PhysicsTestObj
Enabled: true
forceAmount: 50
forceAmount: 200
torqueAmount: 5
- EID: 8
Name: Default

View File

@ -27,8 +27,12 @@ namespace SHADE
SHRay::SHRay(const SHVec3& pos, const SHVec3& dir) noexcept
: position { pos }
, direction { dir }
{}
{
if (dir.LengthSquared() > 1.0f)
direction = SHVec3::Normalise(dir);
else
direction = dir;
}
/*-----------------------------------------------------------------------------------*/
/* Operator Overload Definitions */