22 #ifndef ALCACHOFA_CAMERA_H 23 #define ALCACHOFA_CAMERA_H 25 #include "alcachofa/common.h" 26 #include "math/matrix4.h" 30 class WalkingCharacter;
34 static constexpr
const int16_t kBaseScale = 300;
35 static constexpr
const float kInvBaseScale = 1.0f / kBaseScale;
39 inline Math::Angle rotation()
const {
return _cur._rotation; }
40 inline Math::Vector2d &shake() {
return _shake; }
44 Math::Vector3d transform2Dto3D(Math::Vector3d v)
const;
45 Math::Vector3d transform3Dto2D(Math::Vector3d v)
const;
47 void resetRotationAndScale();
50 void setPosition(Math::Vector2d v);
51 void setPosition(Math::Vector3d v);
52 void backup(uint slot);
53 void restore(uint slot);
57 Math::Vector2d targetPos,
58 int32 duration, EasingType easingType);
60 Math::Vector3d targetPos,
61 int32 duration, EasingType easingType);
64 int32 duration, EasingType easingType);
67 int32 duration, EasingType easingType);
70 int32 duration, EasingType easingType);
72 Math::Vector3d targetPos,
float targetScale,
73 int32 duration, EasingType moveEasingType, EasingType scaleEasingType);
75 Task *shake(
Process &process, Math::Vector2d amplitude, Math::Vector2d frequency, int32 duration);
78 friend struct CamLerpTask;
79 friend struct CamLerpPosTask;
80 friend struct CamLerpScaleTask;
81 friend struct CamLerpPosScaleTask;
82 friend struct CamLerpRotationTask;
83 friend struct CamShakeTask;
84 friend struct CamWaitToStopTask;
85 friend struct CamSetInactiveAttributeTask;
86 Math::Vector3d setAppliedCenter(Math::Vector3d center);
87 void setupMatricesAround(Math::Vector3d center);
88 void updateFollowing(
float deltaTime);
91 Math::Vector3d _usedCenter = Math::Vector3d(512, 384, 0);
95 _maxSpeedFactor = 230.0f;
96 Math::Angle _rotation;
97 bool _isBraking =
false;
98 bool _isFollowingTarget =
false;
103 static constexpr uint kStateBackupCount = 2;
104 State _cur, _backups[kStateBackupCount];
106 uint32 _lastUpdateTime = 0;
107 bool _isChanging =
false,
109 float _roomScale = 1.0f;
111 _roomMin = Math::Vector2d(-10000, -10000),
112 _roomMax = Math::Vector2d(10000, 10000),
114 Math::Vector3d _appliedCenter;
122 #endif // ALCACHOFA_CAMERA_H Definition: objects.h:461
Definition: alcachofa.h:45
Definition: scheduler.h:84
Definition: scheduler.h:164
Definition: serializer.h:79