22 #ifndef TETRAEDGE_GAME_CHARACTER_H 23 #define TETRAEDGE_GAME_CHARACTER_H 25 #include "common/array.h" 26 #include "common/str.h" 27 #include "common/types.h" 28 #include "common/ptr.h" 29 #include "tetraedge/te/te_animation.h" 30 #include "tetraedge/te/te_model_animation.h" 31 #include "tetraedge/te/te_vector3f32.h" 32 #include "tetraedge/te/te_matrix4x4.h" 33 #include "tetraedge/te/te_model.h" 34 #include "tetraedge/te/te_bezier_curve.h" 35 #include "tetraedge/te/te_free_move_zone.h" 36 #include "tetraedge/te/te_trs.h" 37 #include "tetraedge/te/te_curve_anim2.h" 108 static void animCacheFreeAll();
109 static void animCacheFreeOldest();
112 float animLength(
const TeModelAnimation &modelanim,
int bone,
int lastframe);
113 float animLengthFromFile(
const Common::String &animname, uint32 *pframeCount, uint lastframe = 9999);
114 bool blendAnimation(
const Common::String &animname,
float amount,
bool repeat,
bool returnToIdle);
117 void deleteAllCallback();
124 bool isFramePassed(
int frameno);
126 int leftStepFrame(
enum WalkPart walkpart);
127 int rightStepFrame(
enum WalkPart walkpart);
132 bool onModelAnimationFinished();
133 void permanentUpdate();
137 void removeFromCurve();
140 bool setAnimation(
const Common::String &name,
bool repeat,
bool returnToIdle =
false,
bool unused =
false,
int startFrame = -1,
int endFrame = 9999);
142 void setCurveOffset(
float offset);
144 bool setShadowVisible(
bool visible);
146 float speedFromAnim(
double amount);
148 float translationFromAnim(
const TeModelAnimation &anim,
int bone,
int frame);
151 void update(
double percentval)
override;
152 void updateAnimFrame();
153 void updatePosition(
float curveOffset);
156 void walkTo(
float curveEnd,
bool walkFlag);
163 const CharacterSettings &characterSettings()
const {
return _characterSettings; }
165 const Common::String &curAnimName()
const {
return _curAnimName; }
167 const Common::String &freeMoveZoneName()
const {
return _freeMoveZoneName; }
168 void setFreeMoveZoneName(
const Common::String &val) { _freeMoveZoneName = val; }
169 bool needsSomeUpdate()
const {
return _needsSomeUpdate; }
170 void setNeedsSomeUpdate(
bool val) { _needsSomeUpdate = val; }
171 void setCharLookingAt(
Character *other) { _charLookingAt = other; }
172 void setCharLookingAtOffset(
float val) { _charLookingAtOffset = val; }
173 float charLookingAtOffset()
const {
return _charLookingAtOffset; }
174 const TeVector3f32 &positionCharacter()
const {
return _positionCharacter; }
175 void setPositionCharacter(
const TeVector3f32 &val) { _positionCharacter = val; }
176 bool positionFlag()
const {
return _positionFlag; }
177 void setPositionFlag(
bool val) { _positionFlag = val; }
178 void setCurveStartLocation(
const TeVector3f32 &val) { _curveStartLocation = val; }
179 bool hasAnchor()
const {
return _hasAnchor; }
180 void setHasAnchor(
bool val) { _hasAnchor = val; }
181 const TeVector2f32 &headRotation()
const {
return _headRotation; }
182 void setHeadRotation(
const TeVector2f32 &val) { _headRotation = val; }
183 void setLastHeadRotation(
const TeVector2f32 &val) { _lastHeadRotation = val; }
184 const TeVector3f32 &lastHeadBoneTrans()
const {
return _lastHeadBoneTrans; }
185 Character *charLookingAt() {
return _charLookingAt; }
186 bool lookingAtTallThing()
const {
return _lookingAtTallThing; }
187 void setLookingAtTallThing(
bool val) { _lookingAtTallThing = val; }
189 void setRecallageY(
bool val) { _recallageY = val; }
191 static void cleanup();
194 float _walkCurveStart;
195 float _walkCurveLast;
198 float _walkCurveIncrement;
199 float _walkCurveNextLength;
201 int _walkTotalFrames;
215 float _charLookingAtOffset;
217 uint _animSoundOffset;
223 float _walkStartAnimLen;
224 float _walkLoopAnimLen;
225 float _walkEndGAnimLen;
227 uint32 _walkStartAnimFrameCount;
228 uint32 _walkLoopAnimFrameCount;
229 uint32 _walkEndGAnimFrameCount;
234 bool _returnToIdleAnim;
235 bool _callbacksChanged;
236 bool _needsSomeUpdate;
238 bool _lookingAtTallThing;
263 #endif // TETRAEDGE_GAME_CHARACTER_H Definition: character.h:41
Definition: detection.h:27
Definition: te_free_move_zone.h:57
Definition: te_curve_anim2.h:36
Definition: character.h:79
Definition: te_model_animation.h:40
Definition: te_matrix4x4.h:37
Definition: te_object.h:29
Definition: character.h:46
Definition: character.h:99
Definition: character.h:91
Definition: character.h:59
Definition: te_intrusive_ptr.h:31
Definition: te_animation.h:31
Definition: te_vector3f32.h:33
Definition: te_vector2f32.h:32
Definition: te_signal.h:80
Definition: character.h:53