Go to the documentation of this file.
35 const b2Vec2& normal,
float fraction)
override
66 float y1 = 2.0f * cosf(x1 / 10.0
f *
b2_pi);
67 for (
int32 i = 0; i < 80; ++i)
70 float y2 = 2.0f * cosf(x2 / 10.0
f *
b2_pi);
83 vertices[0].
Set(-0.5
f, 0.0
f);
84 vertices[1].
Set(0.5
f, 0.0
f);
85 vertices[2].
Set(0.0
f, 1.5
f);
91 vertices[0].
Set(-0.1
f, 0.0
f);
92 vertices[1].
Set(0.1
f, 0.0
f);
93 vertices[2].
Set(0.0
f, 1.5
f);
99 float b = w / (2.0f +
b2Sqrt(2.0
f));
103 vertices[0].
Set(0.5
f *
s, 0.0
f);
104 vertices[1].
Set(0.5
f * w, b);
105 vertices[2].
Set(0.5
f * w, b +
s);
106 vertices[3].
Set(0.5
f *
s, w);
107 vertices[4].
Set(-0.5
f *
s, w);
108 vertices[5].
Set(-0.5
f * w, b +
s);
109 vertices[6].
Set(-0.5
f * w, b);
110 vertices[7].
Set(-0.5
f *
s, 0.0
f);
float ReportFixture(b2Fixture *fixture, const b2Vec2 &point, const b2Vec2 &normal, float fraction) override
void Step(Settings &settings) override
void DrawSegment(const b2Vec2 &p1, const b2Vec2 &p2, const b2Color &color) override
Draw a line segment.
A rigid body. These are created via b2World::CreateBody.
void Set(float x_, float y_)
Set this vector to some specified coordinates.
void SetTwoSided(const b2Vec2 &v1, const b2Vec2 &v2)
Set this as an isolated edge. Collision is two-sided.
void Set(const b2Vec2 *points, int32 count)
void Keyboard(int key) override
float friction
The friction coefficient, usually in the range [0,1].
b2Body * m_bodies[e_maxBodies]
void DrawString(int x, int y, const char *string,...)
b2PolygonShape m_polygons[4]
void RayCast(b2RayCastCallback *callback, const b2Vec2 &point1, const b2Vec2 &point2) const
float angle
The world angle of the body in radians.
Color for debug drawing. Each value has the range [0,1].
float RandomFloat()
Random number in range [-1,1].
void SetAsBox(float hx, float hy)
float density
The density, usually in kg/m^2.
void DrawPoint(const b2Vec2 &p, float size, const b2Color &color) override
Draw a point.
b2Body * CreateBody(const b2BodyDef *def)
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
void DestroyBody(b2Body *body)
virtual void Step(Settings &settings)
b2Fixture * CreateFixture(const b2FixtureDef *def)
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:07