Ray direction are automatically normalised
This commit is contained in:
parent
4ed7aa3aed
commit
6b9a64233e
File diff suppressed because it is too large
Load Diff
|
@ -219,7 +219,7 @@
|
|||
Scripts:
|
||||
- Type: PhysicsTestObj
|
||||
Enabled: true
|
||||
forceAmount: 50
|
||||
forceAmount: 200
|
||||
torqueAmount: 5
|
||||
- EID: 8
|
||||
Name: Default
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue