godot/scene/3d/spatial_velocity_tracker.h
Juan Linietsky 2e73be99d8 Lots of work on Audio & Physics engine:
-Added new 3D stream player node
-Added ability for Area to capture sound from streams
-Added small features in physics to be able to properly guess distance to areas for sound
-Fixed 3D CollisionObject so shapes are added the same as in 2D, directly from children
-Fixed KinematicBody API to make it the same as 2D.
2017-07-15 08:32:34 -03:00

32 lines
698 B
C++

#ifndef SPATIAL_VELOCITY_TRACKER_H
#define SPATIAL_VELOCITY_TRACKER_H
#include "scene/3d/spatial.h"
class SpatialVelocityTracker : public Reference {
GDCLASS(SpatialVelocityTracker, Reference)
struct PositionHistory {
uint64_t frame;
Vector3 position;
};
bool fixed_step;
Vector<PositionHistory> position_history;
int position_history_len;
protected:
static void _bind_methods();
public:
void reset(const Vector3 &p_new_pos);
void set_track_fixed_step(bool p_use_fixed_step);
bool is_tracking_fixed_step() const;
void update_position(const Vector3 &p_position);
Vector3 get_tracked_linear_velocity() const;
SpatialVelocityTracker();
};
#endif // SPATIAL_VELOCITY_TRACKER_H