Go to the documentation of this file.
57 position.Set(0.0
f, 0.0
f);
59 linearVelocity.Set(0.0
f, 0.0
f);
60 angularVelocity = 0.0f;
62 angularDamping = 0.0f;
65 fixedRotation =
false;
163 void SetTransform(
const b2Vec2& position,
float angle);
171 const b2Vec2& GetPosition()
const;
175 float GetAngle()
const;
178 const b2Vec2& GetWorldCenter()
const;
181 const b2Vec2& GetLocalCenter()
const;
185 void SetLinearVelocity(
const b2Vec2& v);
189 const b2Vec2& GetLinearVelocity()
const;
193 void SetAngularVelocity(
float omega);
197 float GetAngularVelocity()
const;
210 void ApplyForceToCenter(
const b2Vec2& force,
bool wake);
216 void ApplyTorque(
float torque,
bool wake);
224 void ApplyLinearImpulse(
const b2Vec2& impulse,
const b2Vec2& point,
bool wake);
229 void ApplyLinearImpulseToCenter(
const b2Vec2& impulse,
bool wake);
234 void ApplyAngularImpulse(
float impulse,
bool wake);
238 float GetMass()
const;
242 float GetInertia()
const;
258 void ResetMassData();
283 b2Vec2 GetLinearVelocityFromWorldPoint(
const b2Vec2& worldPoint)
const;
288 b2Vec2 GetLinearVelocityFromLocalPoint(
const b2Vec2& localPoint)
const;
291 float GetLinearDamping()
const;
294 void SetLinearDamping(
float linearDamping);
297 float GetAngularDamping()
const;
300 void SetAngularDamping(
float angularDamping);
303 float GetGravityScale()
const;
306 void SetGravityScale(
float scale);
315 void SetBullet(
bool flag);
318 bool IsBullet()
const;
322 void SetSleepingAllowed(
bool flag);
325 bool IsSleepingAllowed()
const;
330 void SetAwake(
bool flag);
334 bool IsAwake()
const;
348 void SetEnabled(
bool flag);
351 bool IsEnabled()
const;
355 void SetFixedRotation(
bool flag);
358 bool IsFixedRotation()
const;
376 const b2Body* GetNext()
const;
382 void SetUserData(
void* data);
386 const b2World* GetWorld()
const;
407 friend class b2RopeJoint;
414 e_islandFlag = 0x0001,
415 e_awakeFlag = 0x0002,
416 e_autoSleepFlag = 0x0004,
417 e_bulletFlag = 0x0008,
418 e_fixedRotationFlag = 0x0010,
419 e_enabledFlag = 0x0020,
426 void SynchronizeFixtures();
427 void SynchronizeTransform();
431 bool ShouldCollide(
const b2Body* other)
const;
433 void Advance(
float t);
float b2Cross(const b2Vec2 &a, const b2Vec2 &b)
Perform the cross product on two vectors. In 2D this produces a scalar.
void Set(float angle)
Set using an angle in radians.
void SetGravityScale(float scale)
Set the gravity scale of the body.
void GetMassData(b2MassData *data) const
void SynchronizeTransform()
const b2Vec2 & GetLinearVelocity() const
b2Fixture * GetFixtureList()
Get the list of all fixtures attached to this body.
float GetAngularVelocity() const
b2BodyType GetType() const
Get the type of this body.
float mass
The mass of the shape, usually in kilograms.
bool IsFixedRotation() const
Does this body have fixed rotation?
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
void ApplyForce(const b2Vec2 &force, const b2Vec2 &point, bool wake)
void Advance(float alpha)
b2Vec2 b2MulT(const b2Mat22 &A, const b2Vec2 &v)
void ApplyAngularImpulse(float impulse, bool wake)
b2Vec2 localCenter
local center of mass position
void SetLinearDamping(float linearDamping)
Set the linear damping of the body.
void ApplyTorque(float torque, bool wake)
bool IsBullet() const
Is this body treated like a bullet for continuous collision detection?
A rigid body. These are created via b2World::CreateBody.
void SetZero()
Set this vector to all zeros.
b2Vec2 b2Mul(const b2Mat22 &A, const b2Vec2 &v)
b2JointEdge * m_jointList
b2ContactEdge * m_contactList
bool IsEnabled() const
Get the active state of the body.
void SetAngularVelocity(float omega)
void SetLinearVelocity(const b2Vec2 &v)
b2BodyDef()
This constructor sets the body definition default values.
b2JointEdge * GetJointList()
Get the list of all joints attached to this body.
b2Vec2 linearVelocity
The linear velocity of the body's origin in world co-ordinates.
void SetAngularDamping(float angularDamping)
Set the angular damping of the body.
You can define this to inject whatever data you want in b2Body.
b2Vec2 GetWorldVector(const b2Vec2 &localVector) const
b2Vec2 center
The position of the shape's centroid relative to the shape's origin.
b2Vec2 GetLinearVelocityFromLocalPoint(const b2Vec2 &localPoint) const
This is an internal class.
void ApplyLinearImpulseToCenter(const b2Vec2 &impulse, bool wake)
const b2Vec2 & GetWorldCenter() const
Get the world position of the center of mass.
float GetLinearDamping() const
Get the linear damping of the body.
float angle
The world angle of the body in radians.
const b2Vec2 & GetLocalCenter() const
Get the local position of the center of mass.
float b2Dot(const b2Vec2 &a, const b2Vec2 &b)
Perform the dot product on two vectors.
bool awake
Is this body initially awake or sleeping?
b2Fixture * m_fixtureList
float GetAngularDamping() const
Get the angular damping of the body.
float angularVelocity
The angular velocity of the body.
void ApplyForceToCenter(const b2Vec2 &force, bool wake)
bool IsSleepingAllowed() const
Is this body allowed to sleep.
b2Vec2 GetLocalPoint(const b2Vec2 &worldPoint) const
b2Body * GetNext()
Get the next body in the world's body list.
bool enabled
Does this body start out enabled?
b2Vec2 GetLocalVector(const b2Vec2 &worldVector) const
b2BodyUserData m_userData
float GetGravityScale() const
Get the gravity scale of the body.
b2Vec2 GetLinearVelocityFromWorldPoint(const b2Vec2 &worldPoint) const
b2ContactEdge * GetContactList()
b2BodyUserData & GetUserData()
Get the user data pointer that was provided in the body definition.
float gravityScale
Scale the gravity applied to this body.
float I
The rotational inertia of the shape about the local origin.
void ApplyLinearImpulse(const b2Vec2 &impulse, const b2Vec2 &point, bool wake)
bool fixedRotation
Should this body be prevented from rotating? Useful for characters.
const b2Vec2 & GetPosition() const
void SetSleepingAllowed(bool flag)
This holds the mass data computed for a shape.
b2World * GetWorld()
Get the parent world of this body.
b2Vec2 c
center world positions
b2Vec2 GetWorldPoint(const b2Vec2 &localPoint) const
const b2Transform & GetTransform() const
b2BodyUserData userData
Use this to store application specific body data.
void SetBullet(bool flag)
Should this body be treated like a bullet for continuous collision detection?
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:06