Go to the documentation of this file.
99 vertices[0].
Set(-0.5
f, 0.0
f);
100 vertices[1].
Set(0.5
f, 0.0
f);
101 vertices[2].
Set(0.0
f, 1.5
f);
107 vertices[0].
Set(-0.1
f, 0.0
f);
108 vertices[1].
Set(0.1
f, 0.0
f);
109 vertices[2].
Set(0.0
f, 1.5
f);
115 float b = w / (2.0f +
b2Sqrt(2.0
f));
119 vertices[0].
Set(0.5
f *
s, 0.0
f);
120 vertices[1].
Set(0.5
f * w, b);
121 vertices[2].
Set(0.5
f * w, b +
s);
122 vertices[3].
Set(0.5
f *
s, w);
123 vertices[4].
Set(-0.5
f *
s, w);
124 vertices[5].
Set(-0.5
f * w, b +
s);
125 vertices[6].
Set(-0.5
f * w, b);
126 vertices[7].
Set(-0.5
f *
s, 0.0
f);
void QueryAABB(b2QueryCallback *callback, const b2AABB &aabb) const
void SetEnabled(bool flag)
bool ReportFixture(b2Fixture *fixture) override
b2PolygonShape m_polygons[4]
A rigid body. These are created via b2World::CreateBody.
void Set(float x_, float y_)
Set this vector to some specified coordinates.
bool IsEnabled() const
Get the active state of the body.
void Keyboard(int key) override
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)
virtual void DrawPoint(const b2Vec2 &p, float size, const b2Color &color)=0
Draw a point.
b2Body * m_bodies[e_maxBodies]
float friction
The friction coefficient, usually in the range [0,1].
void DrawString(int x, int y, const char *string,...)
const b2Vec2 & GetWorldCenter() const
Get the world position of the center of mass.
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].
B2_API bool b2TestOverlap(const b2Shape *shapeA, int32 indexA, const b2Shape *shapeB, int32 indexB, const b2Transform &xfA, const b2Transform &xfB)
Determine if two generic shapes overlap.
void SetAsBox(float hx, float hy)
float density
The density, usually in kg/m^2.
void ComputeAABB(b2AABB *aabb, const b2Transform &transform, int32 childIndex) const override
void Step(Settings &settings) override
An axis aligned bounding box.
b2Body * CreateBody(const b2BodyDef *def)
int RegisterTest(const char *category, const char *name, TestCreateFcn *fcn)
void DestroyBody(b2Body *body)
void DrawCircle(const b2Vec2 ¢er, float radius, const b2Color &color) override
Draw a circle.
virtual void Step(Settings &settings)
const b2Transform & GetTransform() const
b2Fixture * CreateFixture(const b2FixtureDef *def)
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08