mirror of
https://github.com/Relintai/pandemonium_engine_minimal.git
synced 2024-12-21 16:56:50 +01:00
Simplifications to Animation.
This commit is contained in:
parent
14272c1eaf
commit
1223482739
File diff suppressed because it is too large
Load Diff
@ -41,9 +41,6 @@ class Animation : public Resource {
|
||||
public:
|
||||
enum TrackType {
|
||||
TYPE_VALUE, ///< Set a value in a property, can be interpolated.
|
||||
TYPE_POSITION_3D, ///< Position 3D track
|
||||
TYPE_ROTATION_3D, ///< Rotation 3D track
|
||||
TYPE_SCALE_3D, ///< Scale 3D track
|
||||
TYPE_METHOD, ///< Call any method on a specific node.
|
||||
TYPE_BEZIER, ///< Bezier curve
|
||||
TYPE_AUDIO,
|
||||
@ -99,30 +96,6 @@ private:
|
||||
Vector3 scale;
|
||||
};
|
||||
|
||||
/* POSITION TRACK */
|
||||
|
||||
struct PositionTrack : public Track {
|
||||
Vector<TKey<Vector3>> positions;
|
||||
//int32_t compressed_track = -1;
|
||||
PositionTrack() { type = TYPE_POSITION_3D; }
|
||||
};
|
||||
|
||||
/* ROTATION TRACK */
|
||||
|
||||
struct RotationTrack : public Track {
|
||||
Vector<TKey<Quaternion>> rotations;
|
||||
//int32_t compressed_track = -1;
|
||||
RotationTrack() { type = TYPE_ROTATION_3D; }
|
||||
};
|
||||
|
||||
/* SCALE TRACK */
|
||||
|
||||
struct ScaleTrack : public Track {
|
||||
Vector<TKey<Vector3>> scales;
|
||||
//int32_t compressed_track = -1;
|
||||
ScaleTrack() { type = TYPE_SCALE_3D; }
|
||||
};
|
||||
|
||||
/* PROPERTY VALUE TRACK */
|
||||
|
||||
struct ValueTrack : public Track {
|
||||
@ -256,14 +229,6 @@ private:
|
||||
return idxr;
|
||||
}
|
||||
|
||||
bool _position_track_optimize_key(const TKey<Vector3> &t0, const TKey<Vector3> &t1, const TKey<Vector3> &t2, real_t p_alowed_linear_err, real_t p_allowed_angular_error, const Vector3 &p_norm);
|
||||
bool _rotation_track_optimize_key(const TKey<Quaternion> &t0, const TKey<Quaternion> &t1, const TKey<Quaternion> &t2, real_t p_allowed_angular_error, float p_max_optimizable_angle);
|
||||
bool _scale_track_optimize_key(const TKey<Vector3> &t0, const TKey<Vector3> &t1, const TKey<Vector3> &t2, real_t p_allowed_linear_error);
|
||||
|
||||
void _position_track_optimize(int p_idx, real_t p_allowed_linear_err, real_t p_allowed_angular_err);
|
||||
void _rotation_track_optimize(int p_idx, real_t p_allowed_angular_err, real_t p_max_optimizable_angle);
|
||||
void _scale_track_optimize(int p_idx, real_t p_allowed_linear_err);
|
||||
|
||||
protected:
|
||||
bool _set(const StringName &p_name, const Variant &p_value);
|
||||
bool _get(const StringName &p_name, Variant &r_ret) const;
|
||||
@ -305,18 +270,6 @@ public:
|
||||
float track_get_key_time(int p_track, int p_key_idx) const;
|
||||
float track_get_key_transition(int p_track, int p_key_idx) const;
|
||||
|
||||
int position_track_insert_key(int p_track, double p_time, const Vector3 &p_position);
|
||||
Error position_track_get_key(int p_track, int p_key, Vector3 *r_position) const;
|
||||
Error position_track_interpolate(int p_track, double p_time, Vector3 *r_interpolation) const;
|
||||
|
||||
int rotation_track_insert_key(int p_track, double p_time, const Quaternion &p_rotation);
|
||||
Error rotation_track_get_key(int p_track, int p_key, Quaternion *r_rotation) const;
|
||||
Error rotation_track_interpolate(int p_track, double p_time, Quaternion *r_interpolation) const;
|
||||
|
||||
int scale_track_insert_key(int p_track, double p_time, const Vector3 &p_scale);
|
||||
Error scale_track_get_key(int p_track, int p_key, Vector3 *r_scale) const;
|
||||
Error scale_track_interpolate(int p_track, double p_time, Vector3 *r_interpolation) const;
|
||||
|
||||
void track_set_interpolation_type(int p_track, InterpolationType p_interp);
|
||||
InterpolationType track_get_interpolation_type(int p_track) const;
|
||||
|
||||
|
@ -321,12 +321,6 @@ void AnimationPlayer::_animation_process_animation(AnimationData *p_anim, float
|
||||
}
|
||||
|
||||
switch (a->track_get_type(i)) {
|
||||
case Animation::TYPE_POSITION_3D: {
|
||||
} break;
|
||||
case Animation::TYPE_ROTATION_3D: {
|
||||
} break;
|
||||
case Animation::TYPE_SCALE_3D: {
|
||||
} break;
|
||||
case Animation::TYPE_VALUE: {
|
||||
if (!nc->node) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user