Add forgotten CMRay

This commit is contained in:
Phillip Stephens 2015-11-08 19:39:51 -08:00
parent 40ca0c3219
commit 35a6a511d8
1 changed files with 47 additions and 0 deletions

47
include/CMRay.hpp Normal file
View File

@ -0,0 +1,47 @@
#ifndef CMRAY_HPP
#define CMRAY_HPP
#include "CVector3f.hpp"
#include "CTransform.hpp"
#include "Math.hpp"
namespace Zeus
{
struct alignas(16) CMRay
{
CMRay(const CVector3f& start, const CVector3f& end, float dir)
: start(start),
dir(dir),
unk3(1.0 / dir),
unk4(end)
{
unk1 = start + (dir * end);
unk2 = (unk1 - start);
}
CMRay(const CVector3f &start, const CVector3f &end, float dir, float unk)
: start(start),
dir(dir),
unk3(unk),
unk4(end)
{
unk1 = start + (dir * end);
unk2 = (unk1 - start);
}
CMRay GetInvUnscaledTransformRay(const CTransform& xfrm)
{
CTransform inv = xfrm.inverse();
return CMRay(newStart, newEnd, dir, unk3);
}
CVector3f start;
CVector3f unk1;
CVector3f unk2;
float dir;
float unk3;
CVector3f unk4;
};
}
#endif