DYTSrouce/src/entities/PathComponent.h

35 lines
802 B
C
Raw Normal View History

2025-01-04 04:12:51 +00:00
#pragma once
#include "entities/SceneComponent.h"
#include <osg/AnimationPath>
class PathComponent : public SceneComponent {
Q_OBJECT
public:
explicit PathComponent(SceneComponent* parent = nullptr);
~PathComponent();
static std::string GetTypeName();
2025-07-20 07:19:43 +00:00
std::string GetSelfTypeName() const override {
2025-01-04 04:12:51 +00:00
return PathComponent::GetTypeName();
}
bool SetAttribute(const char* name, const char* value) override;
bool SaveAttribute(tinyxml2::XMLElement* element) override;
void Begin() override;
void Update(double dt) override;
void SetPath(const QString& path);
const QString& GetPath() const;
protected:
class TransformPath* transformPath_{nullptr};
double deltaTime_{ 0.0 };
class Timestep* timeStep_{ nullptr };
osg::ref_ptr<osg::AnimationPath> animationPath_;
QString path_;
};