/
ifx.h
83 lines (62 loc) · 2.01 KB
/
ifx.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#pragma once
#include "ideclmanager.h"
namespace fx
{
class IFxAction
{
public:
using Ptr = std::shared_ptr<IFxAction>;
enum class Type
{
Undefined = -1,
Light = 0,
Particle,
Decal,
Model,
Sound,
Shake,
AttachLight,
AttachEntity,
Launch,
Shockwave
};
virtual ~IFxAction() {}
virtual Type getType() = 0;
// Returns the name of this action (which might be an empty string)
virtual const std::string& getName() = 0;
// Returns the action delay in seconds
virtual float getDelay() = 0;
// Action duration in seconds
virtual float getDuration() = 0;
// True: Don't shake the entity this effect is attached to
virtual bool getIgnoreMaster() = 0;
// Shake parameters
virtual float getShakeTime() = 0;
virtual float getShakeAmplitude() = 0;
virtual float getShakeDistance() = 0;
virtual bool getShakeFalloff() = 0;
virtual float getShakeImpulse() = 0;
// True: The light in this effect doesn't cast shadows
virtual bool getNoShadows() = 0;
// Causes the sibling action to happen when this action does.
virtual const std::string& getFireSiblingAction() = 0;
// Let the delay be random between min and max (in seconds)
// If both are 0.0 no random delay is active and the regular delay is used instead
virtual std::pair<float, float> getRandomDelay() = 0;
// According to the docs this is not used
virtual float getRotate() = 0;
};
class IFxDeclaration :
public decl::IDeclaration
{
public:
using Ptr = std::shared_ptr<IFxDeclaration>;
// Returns the number of actions in this FX declaration
virtual std::size_t getNumActions() = 0;
// Returns the n-th action (based on the given 0-based index)
virtual IFxAction::Ptr getAction(std::size_t index) = 0;
// Returns the name of the joint this FX should bind to
// Evaluated to an empty string if "bindTo" is not set
virtual std::string getBindTo() = 0;
};
}