17 #include <core/utils.h> 18 #include <core/math_2d.h> 19 #include <core/outline_2d.h> 20 #include <third_party/box2d/box2d.h> 32 float area_width = 40.0f;
33 float area_height = 20.0f;
34 float curb_width = 0.1f;
36 bool solid_gate_posts =
true;
37 float curb_friction = 0.5f;
42 using Seed = std::random_device::result_type;
45 Track(Seed seed,
const TrackConfig& config);
47 int nodesCount()
const {
return int(outer_outline_.nodes().size()); }
48 int updateTrackDistance(
int old_distance,
const b2Vec2& pos)
const;
49 const math::Outline::Node& distanceToNode(
int distance)
const;
51 void createFixtures(b2World* world)
const;
55 const math::Outline& innerOutline()
const {
return inner_outline_; }
56 const math::Outline& outerOutline()
const {
return outer_outline_; }
59 int distanceToNodeIndex(
int distance)
const;
60 void generateTrackPath();
62 void createCurb(b2World* world,
65 float curb_width)
const;
67 void createGates(b2World* world)
const;
70 default_random_engine rnd_;
71 const TrackConfig config_;
Definition: accelerometer.cpp:19
Classes derived from this are not copyable or movable.
Definition: utils.h:69
A spline aproximation.
Definition: outline_2d.h:28