17 #include <third_party/box2d/box2d.h> 28 static constexpr
float kMaxLinearAcceleration = 100.0f;
29 static constexpr
float kMaxAngularAcceleration = 120.0f;
34 b2Body* body()
const {
return body_; }
40 void update(
float dt);
43 const b2Vec2& linearAcceleration()
const {
return linear_acceleration_; }
46 float angularAcceleration()
const {
return angular_acceleration_; }
49 b2Body* body_ =
nullptr;
50 b2Vec2 linear_acceleration_;
51 float angular_acceleration_;
52 b2Vec2 last_linear_velocity_;
53 float last_angular_velocity_;
Basic accelerometer.
Definition: accelerometer.h:27
Definition: accelerometer.cpp:19