65 lines
1.5 KiB
C++
65 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <unordered_map>
|
|
|
|
#include "entities/SceneComponent.h"
|
|
|
|
#include "osg/Vec3"
|
|
#include "osg/Transform"
|
|
|
|
class ConeWaveComponent : public SceneComponent {
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ConeWaveComponent(SceneComponent* parent = nullptr);
|
|
~ConeWaveComponent();
|
|
|
|
static std::string GetTypeName();
|
|
std::string GetSelfTypeName() override {
|
|
return ConeWaveComponent::GetTypeName();
|
|
}
|
|
|
|
bool SetAttribute(const char* name, const char* value) override;
|
|
bool SaveAttribute(tinyxml2::XMLElement* element) override;
|
|
|
|
void Begin() override;
|
|
void Update(double dt);
|
|
|
|
void SetHeight(float height);
|
|
float GetHeight() const;
|
|
|
|
void SetRadius(float radius);
|
|
float GetRadius() const;
|
|
|
|
void SetBaseColor(const osg::Vec4& color);
|
|
const osg::Vec4 GetBaseColor() const;
|
|
void SetWaveColor(const osg::Vec4& color);
|
|
const osg::Vec4& GetWaveColor() const;
|
|
|
|
void SetWaveRadius(float radius);
|
|
float GetWaveRadius() const;
|
|
|
|
void SetWaveSpeed(float speed);
|
|
float GetWaveSpeed() const;
|
|
|
|
void SetWaveCount(int count);
|
|
int GetWaveCount() const;
|
|
|
|
void SetRingBrightAlpha(float alpha);
|
|
float GetRingBrightAlpha() const;
|
|
void SetRingDarkAlpha(float alpha);
|
|
float GetRingDarkAlpha() const;
|
|
|
|
void SetTimeAction(const QString& path);
|
|
|
|
protected:
|
|
void AddToRender() override;
|
|
void Initialize();
|
|
void UpdateEvent();
|
|
|
|
protected:
|
|
osg::ref_ptr<class ConeWave> coneWave_;
|
|
class TimeAction* timeAction_{ nullptr };
|
|
int currentStatus_{ 0 };
|
|
};
|