Optimize GetViewDirection and GetRightVector
This commit is contained in:
@@ -115,14 +115,16 @@ namespace OpenVulkano::Scene
|
|||||||
|
|
||||||
[[nodiscard]] Math::Vector3f GetRightVector() const
|
[[nodiscard]] Math::Vector3f GetRightVector() const
|
||||||
{
|
{
|
||||||
return Math::Utils::transpose(m_view)[0];
|
return { m_view[0][0], m_view[1][0], m_view[2][0] };
|
||||||
}
|
}
|
||||||
|
|
||||||
[[nodiscard]] Math::Vector3f GetViewDirection() const
|
[[nodiscard]] Math::Vector3f GetViewDirection() const
|
||||||
{
|
{
|
||||||
return Math::Utils::transpose(m_view)[2];
|
return { m_view[0][2], m_view[1][2], m_view[2][2] };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] auto GetForward() const { return GetViewDirection(); }
|
||||||
|
|
||||||
[[nodiscard]] Math::Frustum GetFrustum() const
|
[[nodiscard]] Math::Frustum GetFrustum() const
|
||||||
{
|
{
|
||||||
return {m_viewProjection};
|
return {m_viewProjection};
|
||||||
|
|||||||
Reference in New Issue
Block a user