Added Forward & LookAt to C# Transforms #260
|
@ -35,7 +35,7 @@ namespace SHADE
|
|||
SHVec3 const SHVec3::Back { 0.0f, 0.0f, -1.0f };
|
||||
SHVec3 const SHVec3::UnitX { 1.0f, 0.0f, 0.0f };
|
||||
SHVec3 const SHVec3::UnitY { 0.0f, 1.0f, 0.0f };
|
||||
SHVec3 const SHVec3::UnitZ { 0.0f, 0.0f, 1.0f };
|
||||
SHVec3 const SHVec3::UnitZ { 0.0f, 0.0f, -1.0f };
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Constructors & Destructor Definitions */
|
||||
|
@ -411,6 +411,14 @@ namespace SHADE
|
|||
return result;
|
||||
}
|
||||
|
||||
SHVec3 SHVec3::Rotate(const SHVec3& v, const SHQuaternion& q) noexcept
|
||||
{
|
||||
SHVec3 result;
|
||||
|
||||
XMStoreFloat3(&result, XMVector3Rotate(v, q));
|
||||
return result;
|
||||
}
|
||||
|
||||
SHVec3 SHVec3::RotateX(const SHVec3& v, float angleInRad) noexcept
|
||||
{
|
||||
SHVec3 result;
|
||||
|
|
|
@ -25,6 +25,8 @@ namespace SHADE
|
|||
/*-----------------------------------------------------------------------------------*/
|
||||
/* Forward Declarations */
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
||||
class SHQuaternion;
|
||||
class SHMatrix;
|
||||
|
||||
/*-----------------------------------------------------------------------------------*/
|
||||
|
@ -136,6 +138,7 @@ namespace SHADE
|
|||
[[nodiscard]] static SHVec3 Project (const SHVec3& v, const SHVec3& u) noexcept;
|
||||
[[nodiscard]] static SHVec3 Reflect (const SHVec3& v, const SHVec3& normal) noexcept;
|
||||
[[nodiscard]] static SHVec3 Rotate (const SHVec3& v, const SHVec3& axis, float angleInRad) noexcept;
|
||||
[[nodiscard]] static SHVec3 Rotate (const SHVec3& v, const SHQuaternion& q) noexcept;
|
||||
[[nodiscard]] static SHVec3 RotateX (const SHVec3& v, float angleInRad) noexcept;
|
||||
[[nodiscard]] static SHVec3 RotateY (const SHVec3& v, float angleInRad) noexcept;
|
||||
[[nodiscard]] static SHVec3 RotateZ (const SHVec3& v, float angleInRad) noexcept;
|
||||
|
|
Loading…
Reference in New Issue