Go to the documentation of this file.
157 int32 proxyCount =
f->m_proxyCount;
158 for (
int32 i = 0; i < proxyCount; ++i)
177 fixture->
Create(allocator,
this, def);
232 while (*node !=
nullptr)
234 if (*node == fixture)
257 if (fixture == fixtureA || fixture == fixtureB)
273 fixture->
m_body =
nullptr;
274 fixture->
m_next =
nullptr;
276 fixture->~b2Fixture();
309 if (
f->m_density == 0.0f)
315 f->GetMassData(&massData);
317 localCenter += massData.
mass * massData.
center;
403 if (jn->other == other)
405 if (jn->joint->m_collideConnected ==
false)
454 f->Synchronize(broadPhase, xf1,
m_xf);
483 f->CreateProxies(broadPhase,
m_xf);
497 f->DestroyProxies(broadPhase);
542 b2Dump(
" b2BodyDef bd;\n");
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 DestroyProxies(b2BroadPhase *broadPhase)
void Free(void *p, int32 size)
Free memory. This will use b2Free if the size is larger than b2_maxBlockSize.
float mass
The mass of the shape, usually in kilograms.
void Dump()
Dump this body to a file.
void SetEnabled(bool flag)
TFSIMD_FORCE_INLINE tfScalar angle(const Quaternion &q1, const Quaternion &q2)
const B2_API b2Vec2 b2Vec2_zero
Useful constant.
void SetTransform(const b2Vec2 &position, float angle)
void SynchronizeFixtures()
void SetType(b2BodyType type)
Set the type of this body. This may alter the mass and velocity.
void * Allocate(int32 size)
Allocate memory. This will use b2Alloc if the size is larger than b2_maxBlockSize.
b2Vec2 localCenter
local center of mass position
void TouchProxy(int32 proxyId)
Call to trigger a re-processing of it's pairs on the next call to UpdatePairs.
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)
void b2Dump(const char *string,...)
b2JointEdge * m_jointList
b2ContactEdge * m_contactList
bool ShouldCollide(const b2Body *other) const
bool IsEnabled() const
Get the active state of the body.
void DestroyFixture(b2Fixture *fixture)
void CreateProxies(b2BroadPhase *broadPhase, const b2Transform &xf)
b2Vec2 linearVelocity
The linear velocity of the body's origin in world co-ordinates.
b2ContactManager m_contactManager
bool b2IsValid(float x)
This function is used to ensure that a floating point number is not a NaN or infinity.
b2Vec2 center
The position of the shape's centroid relative to the shape's origin.
float angle
The world angle of the body in radians.
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 angularVelocity
The angular velocity of the body.
void SetMassData(const b2MassData *data)
bool IsLocked() const
Is the world locked (in the middle of a time step).
float density
The density, usually in kg/m^2.
bool enabled
Does this body start out enabled?
bool IsValid() const
Does this vector contain finite coordinates?
void Destroy(b2BlockAllocator *allocator)
b2BodyUserData m_userData
b2BlockAllocator m_blockAllocator
b2JointEdge * next
the next joint edge in the body's joint list
float gravityScale
Scale the gravity applied to this body.
float I
The rotational inertia of the shape about the local origin.
void SetFixedRotation(bool flag)
bool fixedRotation
Should this body be prevented from rotating? Useful for characters.
void Create(b2BlockAllocator *allocator, b2Body *body, const b2FixtureDef *def)
This holds the mass data computed for a shape.
b2Body(const b2BodyDef *bd, b2World *world)
b2Vec2 c
center world positions
b2BodyUserData userData
Use this to store application specific body data.
b2Fixture * CreateFixture(const b2FixtureDef *def)
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:06