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

Public Member Functions

virtual void addAnim ()
virtual void addEasing ()
 ATTRIB (Animation, m_framenames, string)
 ATTRIB (Animation, object, entity)
 ATTRIB (Keyframe, currentChild, entity)
 ATTRIB (Keyframe, firstChild, entity)
 ATTRIB (Keyframe, lastChild, 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 4 of file keyframe.qh.

Member Function Documentation

◆ addAnim()

void Keyframe::addAnim ( )
virtual

Definition at line 52 of file keyframe.qc.

53 {
54 if (other.parent) error("Can't add already added anim!");
55 if (other.finished) error("Can't add finished anim!");
56
57 other.parent = this;
58
59 entity l = this.lastChild;
60
61 if (l)
62 {
63 l.nextSibling = other;
64 }
65 else
66 {
67 this.currentChild = other;
68 this.firstChild = other;
69 }
70
71 other.prevSibling = l;
72 other.nextSibling = NULL;
73 this.lastChild = other;
74 }
entity other
entity() spawn
entity firstChild
Definition menu_cmd.qc:12
#define NULL
Definition post.qh:14
#define error
Definition pre.qh:6

References addAnim(), entity(), error, firstChild, NULL, and other.

Referenced by addAnim(), and addEasing().

◆ addEasing()

void Keyframe::addEasing ( )
virtual

Definition at line 24 of file keyframe.qc.

25 {
26 entity other = makeEasing(this.object, this.setter, func, getNewChildStart(this), getNewChildDuration(this, animDurationTime), getNewChildValue(this), animEnd);
27 this.addAnim(this, other);
28 return other;
29 }
virtual void addAnim()
Definition keyframe.qc:52
entity makeEasing(entity obj, void(entity, float) objSetter, float(float, float, float, float) func, float animStartTime, float animDuration, float animStartValue, float animEnd)
Definition easing.qc:13
float getNewChildStart(entity)
Definition keyframe.qc:31
float getNewChildDuration(entity, float)
Definition keyframe.qc:37
float getNewChildValue(entity)
Definition keyframe.qc:46

References addAnim(), addEasing(), entity(), getNewChildDuration(), getNewChildStart(), getNewChildValue(), makeEasing(), and other.

Referenced by addEasing().

◆ ATTRIB() [1/5]

Animation::ATTRIB ( Animation ,
m_framenames ,
string  )
inherited

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

Referenced by ATTRIB().

◆ ATTRIB() [2/5]

Animation::ATTRIB ( Animation ,
object ,
entity  )
inherited

References entity().

◆ ATTRIB() [3/5]

Keyframe::ATTRIB ( Keyframe ,
currentChild ,
entity  )

References entity().

◆ ATTRIB() [4/5]

Keyframe::ATTRIB ( Keyframe ,
firstChild ,
entity  )

References entity(), and firstChild.

◆ ATTRIB() [5/5]

Keyframe::ATTRIB ( Keyframe ,
lastChild ,
entity  )

References entity().

◆ calcValue()

void Keyframe::calcValue ( )
virtual

Reimplemented from Animation.

Definition at line 76 of file keyframe.qc.

77 {
78 if (this.currentChild && this.currentChild.finished)
79 this.currentChild = this.currentChild.nextSibling;
80
81 if (this.currentChild)
82 {
83 this.currentChild.tick(this.currentChild, tickTime);
84 return this.currentChild.value;
85 }
86
87 return animStartValue + animDelta;
88 }

References calcValue(), and entity().

Referenced by calcValue().

◆ configureAnimation()

void Animation::configureAnimation ( )
virtualinherited

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 ( )
virtualinherited

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 )
inherited

References registered_id.

◆ resumeAnim()

void Animation::resumeAnim ( )
virtualinherited

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 ( )
virtualinherited

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  )
inlineinherited

Definition at line 18 of file animation.qh.

18{}

Referenced by void().

◆ setTimeStartDuration()

void Animation::setTimeStartDuration ( )
virtualinherited

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 ( )
virtualinherited

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 ( )
virtualinherited

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 ( )
virtualinherited

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 ( )
virtualinherited

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 ( )
virtualinherited

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  )
inherited

References setterDummy().

Member Data Documentation

◆ delta

float Animation::delta = 0
inherited

Definition at line 24 of file animation.qh.

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

◆ duration

float Animation::duration = 0
inherited

Definition at line 22 of file animation.qh.

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

◆ finished

float Animation::finished = false
inherited

Definition at line 26 of file animation.qh.

Referenced by finishAnim(), and tick().

◆ return

Animation::return
inherited

Definition at line 21 of file animdecide.qh.

◆ startTime

float Animation::startTime = 0
inherited

Definition at line 21 of file animation.qh.

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

◆ startValue

float Animation::startValue = 0
inherited

Definition at line 23 of file animation.qh.

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

◆ stopped

float Animation::stopped = false
inherited

Definition at line 25 of file animation.qh.

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

◆ value

float Animation::value = 0
inherited

Definition at line 20 of file animation.qh.

Referenced by finishAnim(), and tick().


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