3 #include <DirectXMath.h> 5 #include <MathUtils\MathUtils.h> 18 __forceinline DirectX::XMFLOAT3 GetPosition3f()
const noexcept
22 __forceinline DirectX::XMFLOAT4 GetPosition4f()
const noexcept
24 return DirectX::XMFLOAT4(mPosition.x, mPosition.y, mPosition.z, 1.0f);
26 __forceinline
void SetPosition(
const DirectX::XMFLOAT3& v) noexcept
31 void SetFrustum(
const float verticalFieldOfView,
32 const float aspectRatio,
33 const float nearPlaneZ,
34 const float farPlaneZ) noexcept;
36 void SetLookAndUpVectors(
const DirectX::XMFLOAT3& cameraPosition,
37 const DirectX::XMFLOAT3& targetPosition,
38 const DirectX::XMFLOAT3& upVector) noexcept;
40 __forceinline
const DirectX::XMFLOAT4X4& GetViewMatrix()
const noexcept
44 __forceinline
const DirectX::XMFLOAT4X4& GetInverseViewMatrix()
const noexcept
46 return mInverseViewMatrix;
48 __forceinline DirectX::XMMATRIX GetInverseViewXMMatrix()
const noexcept
50 return DirectX::XMLoadFloat4x4(&GetInverseViewMatrix());
52 __forceinline
const DirectX::XMFLOAT4X4& GetProjectionMatrix()
const noexcept
54 return mProjectionMatrix;
56 __forceinline
const DirectX::XMFLOAT4X4& GetInverseProjectionMatrix()
const noexcept
58 return mInverseProjectionMatrix;
64 void Strafe(
const float distance) noexcept;
65 void Walk(
const float distance) noexcept;
67 void Pitch(
const float angleInRadians) noexcept;
68 void RotateY(
const float angleInRadians) noexcept;
70 void UpdateViewMatrix() noexcept;
73 DirectX::XMFLOAT3 mPosition = { 0.0f, 0.0f, 0.0f };
74 DirectX::XMFLOAT3 mRightVector = { 1.0f, 0.0f, 0.0f };
75 DirectX::XMFLOAT3 mUpVector = { 0.0f, 1.0f, 0.0f };
76 DirectX::XMFLOAT3 mLookVector = { 0.0f, 0.0f, 1.0f };
77 DirectX::XMFLOAT3 mVelocityVector{ 0.0f, 0.0f, 0.0f };
79 DirectX::XMFLOAT4X4 mViewMatrix{ MathUtils::GetIdentity4x4Matrix() };
80 DirectX::XMFLOAT4X4 mInverseViewMatrix{ MathUtils::GetIdentity4x4Matrix() };
81 DirectX::XMFLOAT4X4 mProjectionMatrix{ MathUtils::GetIdentity4x4Matrix() };
82 DirectX::XMFLOAT4X4 mInverseProjectionMatrix{ MathUtils::GetIdentity4x4Matrix() };