Polyphase Game Engine
Loading...
Searching...
No Matches
FunctionCallClip.h
Go to the documentation of this file.
1#pragma once
2
4
5#include <vector>
6#include <string>
7
9{
10 float mTime = 0.0f;
11 std::string mFunctionName;
12};
13
15{
16public:
18
20 virtual ~FunctionCallClip();
21
22 virtual void SaveStream(Stream& stream) override;
23 virtual void LoadStream(Stream& stream, uint32_t version) override;
24 virtual void GatherProperties(std::vector<Property>& outProps) override;
25
26 virtual bool SupportsKeyframes() const override { return true; }
27 virtual uint32_t GetNumKeyframes() const override { return (uint32_t)mKeyframes.size(); }
28 virtual float GetKeyframeTime(uint32_t index) const override { return mKeyframes[index].mTime; }
29 virtual void SetKeyframeTime(uint32_t index, float time) override;
30 virtual void AddKeyframeAtTime(float localTime, Node* targetNode) override;
31 virtual void RemoveKeyframe(uint32_t index) override;
32
33 const std::string& GetKeyframeFunctionName(uint32_t index) const { return mKeyframes[index].mFunctionName; }
34 void SetKeyframeFunctionName(uint32_t index, const std::string& name);
35
36 // Fire-once tracking (reset by FunctionCallTrack::Reset)
37 int32_t mLastFiredKeyframe = -1;
38
39protected:
40 std::vector<FunctionCallKeyframe> mKeyframes;
41};
Definition FunctionCallClip.h:15
virtual bool SupportsKeyframes() const override
Definition FunctionCallClip.h:26
int32_t mLastFiredKeyframe
Definition FunctionCallClip.h:37
virtual void LoadStream(Stream &stream, uint32_t version) override
Definition FunctionCallClip.cpp:27
FunctionCallClip()
Definition FunctionCallClip.cpp:7
virtual ~FunctionCallClip()
Definition FunctionCallClip.cpp:11
virtual uint32_t GetNumKeyframes() const override
Definition FunctionCallClip.h:27
virtual float GetKeyframeTime(uint32_t index) const override
Definition FunctionCallClip.h:28
void SetKeyframeFunctionName(uint32_t index, const std::string &name)
Definition FunctionCallClip.cpp:64
virtual void GatherProperties(std::vector< Property > &outProps) override
Definition FunctionCallClip.cpp:40
virtual void RemoveKeyframe(uint32_t index) override
Definition FunctionCallClip.cpp:103
DECLARE_CLIP(FunctionCallClip, TimelineClip)
virtual void SetKeyframeTime(uint32_t index, float time) override
Definition FunctionCallClip.cpp:72
virtual void AddKeyframeAtTime(float localTime, Node *targetNode) override
Definition FunctionCallClip.cpp:80
virtual void SaveStream(Stream &stream) override
Definition FunctionCallClip.cpp:15
const std::string & GetKeyframeFunctionName(uint32_t index) const
Definition FunctionCallClip.h:33
std::vector< FunctionCallKeyframe > mKeyframes
Definition FunctionCallClip.h:40
Definition Node.h:67
Definition Stream.h:21
Definition TimelineClip.h:24
Definition FunctionCallClip.h:9
std::string mFunctionName
Definition FunctionCallClip.h:11
float mTime
Definition FunctionCallClip.h:10