mirror of
https://github.com/whoahq/whoa.git
synced 2026-03-18 05:31:07 +03:00
feat(ui): add CSimpleCamera::GetScene
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
Some checks failed
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:cl compiler_name:MSVC cxx:cl os:windows-latest system_name:Windows test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:clang compiler_name:Clang cxx:clang++ os:macos-latest system_name:macOS test_path:WhoaTest]) (push) Has been cancelled
Push / ${{ matrix.build.system_name }} / ${{ matrix.build.build_type }} / ${{ matrix.build.compiler_name }} (map[build_type:Release cc:gcc compiler_name:GCC cxx:g++ os:ubuntu-latest system_name:Linux test_path:WhoaTest]) (push) Has been cancelled
This commit is contained in:
parent
2711c752ba
commit
7d491570e4
@ -1,4 +1,5 @@
|
||||
#include "ui/simple/CSimpleCamera.hpp"
|
||||
#include "model/Model2.hpp"
|
||||
#include <tempest/Math.hpp>
|
||||
|
||||
namespace {
|
||||
@ -52,7 +53,7 @@ void BuildBillboardMatrix(const C3Vector& direction, C33Matrix& rotation) {
|
||||
}
|
||||
|
||||
CSimpleCamera::CSimpleCamera(float nearZ, float farZ, float fov) {
|
||||
this->float10 = 0.0f;
|
||||
this->m_scene = nullptr;
|
||||
|
||||
this->m_nearZ = nearZ;
|
||||
this->m_farZ = farZ;
|
||||
@ -70,6 +71,14 @@ C3Vector CSimpleCamera::Forward() const {
|
||||
return { this->m_facing.a0, this->m_facing.a1, this->m_facing.a2 };
|
||||
}
|
||||
|
||||
CM2Scene* CSimpleCamera::GetScene() {
|
||||
if (!this->m_scene) {
|
||||
this->m_scene = M2CreateScene();
|
||||
}
|
||||
|
||||
return this->m_scene;
|
||||
}
|
||||
|
||||
C3Vector CSimpleCamera::Right() const {
|
||||
return { this->m_facing.b0, this->m_facing.b1, this->m_facing.b2 };
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@
|
||||
#include <tempest/Matrix.hpp>
|
||||
#include <tempest/Vector.hpp>
|
||||
|
||||
class CM2Scene;
|
||||
|
||||
class CSimpleCamera {
|
||||
public:
|
||||
// Virtual public member functions
|
||||
@ -14,6 +16,7 @@ class CSimpleCamera {
|
||||
|
||||
// Public member functions
|
||||
CSimpleCamera(float nearZ, float farZ, float fov);
|
||||
CM2Scene* GetScene();
|
||||
void SetFacing(const C3Vector& forward);
|
||||
void SetFacing(const C3Vector& forward, const C3Vector& up);
|
||||
void SetFacing(float yaw, float pitch, float roll);
|
||||
@ -23,8 +26,8 @@ class CSimpleCamera {
|
||||
|
||||
protected:
|
||||
// Protected member variables
|
||||
CM2Scene* m_scene;
|
||||
C3Vector m_position;
|
||||
float float10;
|
||||
C33Matrix m_facing;
|
||||
float m_nearZ;
|
||||
float m_farZ;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user