mirror of
https://github.com/barkeser2002/flower.git
synced 2026-09-25 19:36:20 +03:00
45 lines
826 B
C++
45 lines
826 B
C++
#pragma once
|
|
|
|
#include "../component.h"
|
|
|
|
namespace engine
|
|
{
|
|
struct PerFrameMMDCamera
|
|
{
|
|
math::mat4 viewMat;
|
|
math::mat4 projMat;
|
|
float fovy;
|
|
math::vec3 worldPos;
|
|
math::vec3 front;
|
|
};
|
|
|
|
class MMDCameraComponent : public Component
|
|
{
|
|
public:
|
|
MMDCameraComponent() = default;
|
|
virtual ~MMDCameraComponent() = default;
|
|
|
|
MMDCameraComponent(std::shared_ptr<SceneNode> sceneNode)
|
|
: Component(sceneNode)
|
|
{
|
|
|
|
}
|
|
|
|
virtual void tick(const RuntimeModuleTickData& tickData) override;
|
|
|
|
bool setVmd(const UUID& id);
|
|
const UUID& getVmdUUID() const { return m_vmdUUID; }
|
|
|
|
PerFrameMMDCamera getCameraPerframe(float width, float height, float zNear, float zFar) const;
|
|
|
|
protected:
|
|
std::unique_ptr<saba::VMDCameraAnimation> m_vmdCameraAnim = nullptr;
|
|
protected:
|
|
ARCHIVE_DECLARE;
|
|
|
|
UUID m_vmdUUID = {};
|
|
};
|
|
}
|
|
|
|
|