Module ffi

Module ffi 

Source

Structs§

b2AABB
An axis aligned bounding box.
b2BlockAllocator
This is a small object allocator used for allocating small objects that persist for more than one time step. See: http://www.codeproject.com/useritems/Small_Block_Allocator.asp
b2Body
A rigid body. These are created via b2World::CreateBody.
b2BodyDef
A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions. Shapes are added to a body after construction.
b2BodyUserData
You can define this to inject whatever data you want in b2Body
b2BroadPhase
The broad-phase is used for computing pairs and performing volume queries and ray casts. This broad-phase does not persist pairs. Instead, this reports potentially new pairs. It is up to the client to consume the new pairs and to track subsequent overlap.
b2ChainShape
A chain shape is a free form sequence of line segments. The chain has one-sided collision, with the surface normal pointing to the right of the edge. This provides a counter-clockwise winding like the polygon shape. Connectivity information is used to create smooth collisions. @warning the chain will not collide properly if there are self-intersections.
b2CircleShape
A solid circle shape
b2Contact
The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no contact points.
b2ContactEdge
A contact edge is used to connect bodies and contacts together in a contact graph where each body is a node and each contact is an edge. A contact edge belongs to a doubly linked list maintained in each attached body. Each contact has two contact nodes, one for each attached body.
b2ContactFilter
Implement this class to provide collision filtering. In other words, you can implement this class if you want finer control over contact creation.
b2ContactImpulse
Contact impulses for reporting. Impulses are used instead of forces because sub-step forces may approach infinity for rigid body collisions. These match up one-to-one with the contact points in b2Manifold.
b2ContactListener
Implement this class to get contact information. You can use these results for things like sounds and game logic. You can also get contact results by traversing the contact lists after the time step. However, you might miss some contacts because continuous physics leads to sub-stepping. Additionally you may receive multiple callbacks for the same contact in a single time step. You should strive to make your callbacks efficient because there may be many callbacks per time step. @warning You cannot create/destroy Box2D entities inside these callbacks.
b2ContactListenerWrapper
b2ContactListenerWrapperCpp
b2ContactListenerWrapperHolder
b2ContactManager
b2DestructionListener
Joints and fixtures are destroyed when their associated body is destroyed. Implement this listener so that you may nullify references to these joints and shapes.
b2DistanceJoint
A distance joint constrains two points on two bodies to remain at a fixed distance from each other. You can view this as a massless, rigid rod.
b2DistanceJointDef
Distance joint definition. This requires defining an anchor point on both bodies and the non-zero distance of the distance joint. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. This helps when saving and loading a game.
b2Draw
Implement and register this class with a b2World to provide debug drawing of physics entities in your game.
b2EdgeShape
A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. Edges created independently are two-sided and do no provide smooth movement across junctions.
b2Filter
This holds contact filtering data.
b2Fixture
A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via b2Body::CreateFixture. @warning you cannot reuse fixtures.
b2FixtureDef
A fixture definition is used to create a fixture. This class defines an abstract fixture definition. You can reuse fixture definitions safely.
b2FixtureUserData
You can define this to inject whatever data you want in b2Fixture
b2FrictionJoint
Friction joint. This is used for top-down friction. It provides 2D translational friction and angular friction.
b2FrictionJointDef
Friction joint definition.
b2GearJoint
A gear joint is used to connect two joints together. Either joint can be a revolute or prismatic joint. You specify a gear ratio to bind the motions together: coordinate1 + ratio * coordinate2 = constant The ratio can be negative or positive. If one joint is a revolute joint and the other joint is a prismatic joint, then the ratio will have units of length or units of 1/length. @warning You have to manually destroy the gear joint if joint1 or joint2 is destroyed.
b2GearJointDef
Gear joint definition. This definition requires two existing revolute or prismatic joints (any combination will work). @warning bodyB on the input joints must both be dynamic
b2Joint
The base joint class. Joints are used to constraint two bodies together in various fashions. Some joints also feature limits and motors.
b2JointDef
Joint definitions are used to construct joints.
b2JointEdge
A joint edge is used to connect bodies and joints together in a joint graph where each body is a node and each joint is an edge. A joint edge belongs to a doubly linked list maintained in each attached body. Each joint has two joint nodes, one for each attached body.
b2JointUserData
You can define this to inject whatever data you want in b2Joint
b2Manifold
A manifold for two touching convex shapes. Box2D supports multiple types of contact:
b2MassData
This holds the mass data computed for a shape.
b2MotorJoint
A motor joint is used to control the relative motion between two bodies. A typical usage is to control the movement of a dynamic body with respect to the ground.
b2MotorJointDef
Motor joint definition.
b2MouseJoint
A mouse joint is used to make a point on a body track a specified world point. This a soft constraint with a maximum force. This allows the constraint to stretch and without applying huge forces. NOTE: this joint is not documented in the manual because it was developed to be used in the testbed. If you want to learn how to use the mouse joint, look at the testbed.
b2ParticleBodyContact
b2ParticleColor
Small color object for each particle
b2ParticleContact
b2ParticleDef
A particle definition holds all the data needed to construct a particle. You can safely re-use these definitions.
b2ParticleGroup
A group of particles. b2ParticleGroup::CreateParticleGroup creates these.
b2ParticleGroupDef
A particle group definition holds all the data needed to construct a particle group. You can safely re-use these definitions.
b2ParticleHandle
Handle to a particle. Particle indices are ephemeral: the same index might refer to a different particle, from frame-to-frame. If you need to keep a reference to a particular particle across frames, you should acquire a b2ParticleHandle. Use #b2ParticleSystem::GetParticleHandleFromIndex() to retrieve the b2ParticleHandle of a particle from the particle system.
b2ParticlePair
Connection between two particles
b2ParticleSystem
b2ParticleSystemDef
b2ParticleTriad
Connection between three particles
b2PolygonShape
A solid convex polygon. It is assumed that the interior of the polygon is to the left of each edge. Polygons have a maximum number of vertices equal to b2_maxPolygonVertices. In most cases you should not need many vertices for a convex polygon.
b2PrismaticJoint
A prismatic joint. This joint provides one degree of freedom: translation along an axis fixed in bodyA. Relative rotation is prevented. You can use a joint limit to restrict the range of motion and a joint motor to drive the motion or to model joint friction.
b2PrismaticJointDef
Prismatic joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.
b2Profile
Profiling data. Times are in milliseconds.
b2PulleyJoint
The pulley joint is connected to two bodies and two fixed ground points. The pulley supports a ratio such that: length1 + ratio * length2 <= constant Yes, the force transmitted is scaled by the ratio. Warning: the pulley joint can get a bit squirrelly by itself. They often work better when combined with prismatic joints. You should also cover the the anchor points with static shapes to prevent one side from going to zero length.
b2PulleyJointDef
Pulley joint definition. This requires two ground anchors, two dynamic body anchor points, and a pulley ratio.
b2QueryCallback
Callback class for AABB queries. See b2World::Query
b2RayCastCallback
Callback class for ray casts. See b2World::RayCast
b2RayCastCallbackWrapper
b2RayCastCallbackWrapperCpp
b2RayCastCallbackWrapperHolder
b2RayCastInput
Ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).
b2RayCastOutput
Ray-cast output data. The ray hits at p1 + fraction * (p2 - p1), where p1 and p2 come from b2RayCastInput.
b2RevoluteJoint
A revolute joint constrains two bodies to share a common point while they are free to rotate about the point. The relative rotation about the shared point is the joint angle. You can limit the relative rotation with a joint limit that specifies a lower and upper angle. You can use a motor to drive the relative rotation about the shared point. A maximum motor torque is provided so that infinite forces are not generated.
b2RevoluteJointDef
Revolute joint definition. This requires defining an anchor point where the bodies are joined. The definition uses local anchor points so that the initial configuration can violate the constraint slightly. You also need to specify the initial relative angle for joint limits. This helps when saving and loading a game. The local anchor points are measured from the body’s origin rather than the center of mass because:
b2Rot
Rotation
b2Shape
@file Structures and functions used for computing contact points, distance queries, and TOI queries.
b2SolverData
Solver Data
b2Transform
A transform contains translation and rotation. It is used to represent the position and orientation of rigid frames.
b2Vec2
A 2D column vector.
b2Version
Version numbering scheme. See http://en.wikipedia.org/wiki/Software_versioning
b2WeldJoint
A weld joint essentially glues two bodies together. A weld joint may distort somewhat because the island constraint solver is approximate.
b2WeldJointDef
Weld joint definition. You need to specify local anchor points where they are attached and the relative body angle. The position of the anchor points is important for computing the reaction torque.
b2WheelJoint
A wheel joint. This joint provides two degrees of freedom: translation along an axis fixed in bodyA and rotation in the plane. In other words, it is a point to line constraint with a rotational motor and a linear spring/damper. The spring/damper is initialized upon creation. This joint is designed for vehicle suspensions.
b2WheelJointDef
Wheel joint definition. This requires defining a line of motion using an axis and an anchor point. The definition uses local anchor points and a local axis so that the initial configuration can violate the constraint slightly. The joint translation is zero when the local anchor points coincide in world space. Using local anchors and a local axis helps when saving and loading a game.
b2World
The world class manages all physics entities, dynamic simulation, and asynchronous queries. The world also contains efficient memory management facilities.
b2WorldManifold
This is used to compute the current state of a contact manifold.

Enums§

b2BodyType
The body type. static: zero mass, zero velocity, may be manually moved kinematic: zero mass, non-zero velocity set by user, moved by solver dynamic: positive mass, non-zero velocity determined by forces, moved by solver
b2JointType
b2ParticleFlag
The particle type. Can be combined with the | operator.
b2Shape_Type

Traits§

ToCppString
b2ContactListenerImpl
b2ContactListener_methods
b2ContactListener_supers
b2RayCastCallbackImpl
b2RayCastCallback_methods
b2RayCastCallback_supers

Functions§

CreateDistanceJoint
CreateFrictionJoint
CreateGearJoint
CreateMotorJoint
CreateMouseJoint
CreateParticleGroupDef
CreatePrismaticJoint
CreatePulleyJoint
CreateRevoluteJoint
CreateWeldJoint
CreateWheelJoint
SetCirclePosition
SetCircleRadius
b2ContactListenerWrapper_remove_ownership
b2RayCastCallbackWrapper_remove_ownership
make_string

Type Aliases§

int16
int32
uint8
uint16
uint32