Xonotic QuakeC
The free, fast arena FPS with crisp movement and a wide array of weapons
Animation Class Reference
Inheritance diagram for Animation:
Collaboration diagram for Animation:

Public Member Functions

 ATTRIB (Animation, m_framenames, string)
 ATTRIB (Animation, object, entity)
virtual void calcValue ()
virtual void configureAnimation ()
virtual void finishAnim ()
 LOG_DEBUGF ("Missing animation for %s: %s", modelnameforindex(mdlidx), this.registered_id)
virtual void resumeAnim ()
virtual void setObjectSetter ()
void setterDummy (Animation this, float)
virtual void setTimeStartDuration ()
virtual void setTimeStartEnd ()
virtual void setValueStartEnd ()
virtual void stopAnim ()
virtual void tick ()
virtual void update ()
 void (Animation this, float) setter

Public Attributes

float delta = 0
float duration = 0
float finished = false
 return
float startTime = 0
float startValue = 0
float stopped = false
float value = 0

Detailed Description

Definition at line 10 of file animdecide.qh.

Member Function Documentation

◆ ATTRIB() [1/2]

Animation::ATTRIB ( Animation ,
m_framenames ,
string  )

References ATTRIB(), FOREACH_WORD, STATIC_METHOD, and this.

Referenced by ATTRIB().

◆ ATTRIB() [2/2]

Animation::ATTRIB ( Animation ,
object ,
entity  )

References entity().

◆ calcValue()

void Animation::calcValue ( )
virtual

Reimplemented in Easing, and Keyframe.

Definition at line 52 of file animation.qc.

53 {
54 return animStartValue;
55 }

References calcValue(), and entity().

Referenced by calcValue(), and tick().

◆ configureAnimation()

void Animation::configureAnimation ( )
virtual

Definition at line 5 of file animation.qc.

6 {
7 this.setObjectSetter(this, obj, objSetter);
8 this.setTimeStartDuration(this, animStartTime, animDuration);
9 this.setValueStartEnd(this, animStartValue, animEndValue);
10 }
virtual void setValueStartEnd()
Definition animation.qc:30
virtual void setTimeStartDuration()
Definition animation.qc:24
virtual void setObjectSetter()
Definition animation.qc:36

References configureAnimation(), entity(), setObjectSetter(), setTimeStartDuration(), and setValueStartEnd().

Referenced by configureAnimation().

◆ finishAnim()

void Animation::finishAnim ( )
virtual

Definition at line 67 of file animation.qc.

68 {
69 this.value = this.delta + this.startValue;
70 this.finished = true;
71 this.setter(this.object, this.value);
72 }
float value
Definition animation.qh:20
float delta
Definition animation.qh:24
float finished
Definition animation.qh:26
float startValue
Definition animation.qh:23

References delta, entity(), finishAnim(), finished, startValue, and value.

Referenced by finishAnim(), and tick().

◆ LOG_DEBUGF()

Animation::LOG_DEBUGF ( "Missing animation for %s: %s" ,
modelnameforindex(mdlidx) ,
this. registered_id )

References registered_id.

◆ resumeAnim()

void Animation::resumeAnim ( )
virtual

Definition at line 62 of file animation.qc.

63 {
64 this.stopped = false;
65 }
float stopped
Definition animation.qh:25

References entity(), resumeAnim(), and stopped.

Referenced by resumeAnim().

◆ setObjectSetter()

void Animation::setObjectSetter ( )
virtual

Definition at line 36 of file animation.qc.

37 {
38 this.object = o;
39 this.setter = s;
40 }

References entity(), and setObjectSetter().

Referenced by configureAnimation(), and setObjectSetter().

◆ setterDummy()

void Animation::setterDummy ( Animation this,
float  )
inline

Definition at line 18 of file animation.qh.

18{}

Referenced by void().

◆ setTimeStartDuration()

void Animation::setTimeStartDuration ( )
virtual

Definition at line 24 of file animation.qc.

25 {
26 this.startTime = s;
27 this.duration = d;
28 }
float startTime
Definition animation.qh:21
float duration
Definition animation.qh:22

References duration, entity(), setTimeStartDuration(), and startTime.

Referenced by configureAnimation(), setTimeStartDuration(), and update().

◆ setTimeStartEnd()

void Animation::setTimeStartEnd ( )
virtual

Definition at line 18 of file animation.qc.

19 {
20 this.startTime = s;
21 this.duration = e - s;
22 }

References duration, entity(), setTimeStartEnd(), and startTime.

Referenced by setTimeStartEnd().

◆ setValueStartEnd()

void Animation::setValueStartEnd ( )
virtual

Definition at line 30 of file animation.qc.

31 {
32 this.startValue = s;
33 this.delta = e - s;
34 }

References delta, entity(), setValueStartEnd(), and startValue.

Referenced by configureAnimation(), setValueStartEnd(), and update().

◆ stopAnim()

void Animation::stopAnim ( )
virtual

Definition at line 57 of file animation.qc.

58 {
59 this.stopped = true;
60 }

References entity(), stopAnim(), and stopped.

Referenced by stopAnim().

◆ tick()

void Animation::tick ( )
virtual

Definition at line 42 of file animation.qc.

43 {
44 if (this.stopped || this.finished || (tickTime < this.startTime)) return;
45
46 if (tickTime >= (this.startTime + this.duration)) this.finishAnim(this);
47 else this.value = this.calcValue(this, (tickTime - this.startTime), this.duration, this.startValue, this.delta);
48
49 this.setter(this.object, this.value);
50 }
virtual void calcValue()
Definition animation.qc:52
virtual void finishAnim()
Definition animation.qc:67

References calcValue(), delta, duration, entity(), finishAnim(), finished, startTime, startValue, stopped, tick(), and value.

Referenced by tick().

◆ update()

void Animation::update ( )
virtual

Definition at line 12 of file animation.qc.

13 {
14 this.setTimeStartDuration(this, time, animDuration);
15 this.setValueStartEnd(this, animStartValue, animEndValue);
16 }
float time

References entity(), setTimeStartDuration(), setValueStartEnd(), time, and update().

Referenced by update().

◆ void()

Animation::void ( Animation this,
float  )

References setterDummy().

Member Data Documentation

◆ delta

float Animation::delta = 0

Definition at line 24 of file animation.qh.

Referenced by finishAnim(), setValueStartEnd(), and tick().

◆ duration

float Animation::duration = 0

Definition at line 22 of file animation.qh.

Referenced by setTimeStartDuration(), setTimeStartEnd(), and tick().

◆ finished

float Animation::finished = false

Definition at line 26 of file animation.qh.

Referenced by finishAnim(), and tick().

◆ return

Animation::return

Definition at line 21 of file animdecide.qh.

◆ startTime

float Animation::startTime = 0

Definition at line 21 of file animation.qh.

Referenced by setTimeStartDuration(), setTimeStartEnd(), and tick().

◆ startValue

float Animation::startValue = 0

Definition at line 23 of file animation.qh.

Referenced by finishAnim(), setValueStartEnd(), and tick().

◆ stopped

float Animation::stopped = false

Definition at line 25 of file animation.qh.

Referenced by resumeAnim(), stopAnim(), and tick().

◆ value

float Animation::value = 0

Definition at line 20 of file animation.qh.

Referenced by finishAnim(), and tick().


The documentation for this class was generated from the following files: