Home | Trees | Indices | Help |
|
---|
|
A rigid body.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
thisown The membership flag |
|||
userData GetUserData(self) -> PyObject |
|||
massData Get a b2MassData object that represents this b2Body |
|||
position GetPosition(self) -> b2Vec2 |
|||
angle GetAngle(self) -> float32 |
|||
linearDamping GetLinearDamping(self) -> float32 |
|||
angularDamping GetAngularDamping(self) -> float32 |
|||
allowSleep CanSleep(self) -> bool |
|||
isSleeping IsSleeping(self) -> bool |
|||
fixedRotation IsRotationFixed(self) -> bool |
|||
isBullet IsBullet(self) -> bool |
|||
angularVelocity GetAngularVelocity(self) -> float32 |
|||
linearVelocity GetLinearVelocity(self) -> b2Vec2 |
|||
shapeList Get a list of the shapes in this body |
|
|
|
Everything is essentially generic_getstate, except for edge shape handling. TODO: I can see a possible issue in this if joints are used on an edge shape or a body with edge shapes and other shapes. The shape list order could be improperly recreated. We'll see if anything happens... |
Set the angle without altering the position angle in radians. |
Get a b2MassData object that represents this b2Body NOTE: To just get the mass, use body.mass (body.GetMass()) |
Get a list of the shapes in this body Defaults to returning the typecasted objects. e.g., if there is a b2CircleShape and a b2PolygonShape: GetShapeList(True) = [b2CircleShape, b2PolygonShape] GetShapeList(False)= [b2Shape, b2Shape] |
b2Body_SetMass(b2Body self, b2MassData massData) Set the mass properties. Note that this changes the center of mass position. If you are not sure how to compute mass properties, use SetMassFromShapes. The inertia tensor is assumed to be relative to the center of mass. Parameters: ----------- massData: the mass properties. |
b2Body_SetMassFromShapes(b2Body self) Compute the mass properties from the attached shapes. You typically call this after adding all the shapes. If you add or remove shapes later, you may want to call this again. Note that this changes the center of mass position. |
b2Body_SetXForm(b2Body self, b2Vec2 position, float32 angle) -> bool Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies. Parameters: ----------- position: the new world position of the body's origin (not necessarily the center of mass). angle: the new world rotation angle of the body in radians. false if the movement put a shape outside the world. In this case the body is automatically frozen. |
b2Body_GetXForm(b2Body self) -> b2XForm Get the body transform for the body's origin. the world transform of the body's origin. |
b2Body_GetPosition(b2Body self) -> b2Vec2 Get the world body origin position. the world position of the body's origin. |
b2Body_GetAngle(b2Body self) -> float32 Get the angle in radians. the current world rotation angle in radians. |
b2Body_GetLinearDamping(b2Body self) -> float32 Get the linear damping. |
b2Body_GetAngularDamping(b2Body self) -> float32 Get the angular damping. |
b2Body_GetWorldCenter(b2Body self) -> b2Vec2 Get the world position of the center of mass. |
b2Body_GetLocalCenter(b2Body self) -> b2Vec2 Get the local position of the center of mass. |
b2Body_SetLinearVelocity(b2Body self, b2Vec2 v) Set the linear velocity of the center of mass. Parameters: ----------- v: the new linear velocity of the center of mass. |
b2Body_GetLinearVelocity(b2Body self) -> b2Vec2 Get the linear velocity of the center of mass. the linear velocity of the center of mass. |
b2Body_SetAngularVelocity(b2Body self, float32 omega) Set the angular velocity. Parameters: ----------- omega: the new angular velocity in radians/second. |
b2Body_GetAngularVelocity(b2Body self) -> float32 Get the angular velocity. the angular velocity in radians/second. |
b2Body_ApplyForce(b2Body self, b2Vec2 force, b2Vec2 point) Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This wakes up the body. Parameters: ----------- force: the world force vector, usually in Newtons (N). point: the world position of the point of application. |
b2Body_ApplyTorque(b2Body self, float32 torque) Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body. Parameters: ----------- torque: about the z-axis (out of the screen), usually in N-m. |
b2Body_ApplyImpulse(b2Body self, b2Vec2 impulse, b2Vec2 point) Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This wakes up the body. Parameters: ----------- impulse: the world impulse vector, usually in N-seconds or kg-m/s. point: the world position of the point of application. |
b2Body_GetMass(b2Body self) -> float32 Get the total mass of the body. the mass, usually in kilograms (kg). |
b2Body_GetInertia(b2Body self) -> float32 Get the central rotational inertia of the body. the rotational inertia, usually in kg-m^2. |
b2Body_GetWorldPoint(b2Body self, b2Vec2 localPoint) -> b2Vec2 Get the world coordinates of a point given the local coordinates. Parameters: ----------- localPoint: a point on the body measured relative the the body's origin. the same point expressed in world coordinates. |
b2Body_GetWorldVector(b2Body self, b2Vec2 localVector) -> b2Vec2 Get the world coordinates of a vector given the local coordinates. Parameters: ----------- localVector: a vector fixed in the body. the same vector expressed in world coordinates. |
b2Body_GetLocalPoint(b2Body self, b2Vec2 worldPoint) -> b2Vec2 Gets a local point relative to the body's origin given a world point. Parameters: ----------- a: point in world coordinates. the corresponding local point relative to the body's origin. |
b2Body_GetLocalVector(b2Body self, b2Vec2 worldVector) -> b2Vec2 Gets a local vector given a world vector. Parameters: ----------- a: vector in world coordinates. the corresponding local vector. |
b2Body_GetLinearVelocityFromWorldPoint(b2Body self, b2Vec2 worldPoint) -> b2Vec2 Get the world linear velocity of a world point attached to this body. Parameters: ----------- a: point in world coordinates. the world velocity of a point. |
b2Body_GetLinearVelocityFromLocalPoint(b2Body self, b2Vec2 localPoint) -> b2Vec2 Get the world velocity of a local point. Parameters: ----------- a: point in local coordinates. the world velocity of a point. |
b2Body_IsBullet(b2Body self) -> bool Is this body treated like a bullet for continuous collision detection? |
b2Body_SetBullet(b2Body self, bool flag) Should this body be treated like a bullet for continuous collision detection? |
b2Body_IsStatic(b2Body self) -> bool Is this body static (immovable)? |
b2Body_IsDynamic(b2Body self) -> bool Is this body dynamic (movable)? |
b2Body_IsFrozen(b2Body self) -> bool Is this body frozen? |
b2Body_IsSleeping(b2Body self) -> bool Is this body sleeping (not simulating). |
b2Body_AllowSleeping(b2Body self, bool flag) You can disable sleeping on this body. |
b2Body_CanSleep(b2Body self) -> bool Get whether or not this body is allowed to sleep. |
b2Body_IsRotationFixed(b2Body self) -> bool Get whether or not this body is allowed to rotate. |
b2Body_WakeUp(b2Body self) Wake up this body so it will begin simulating. |
b2Body_PutToSleep(b2Body self) Put this body to sleep so it will stop simulating. This also sets the velocity to zero. |
b2Body__GetShapeList(b2Body self) -> b2Shape Get the list of all shapes attached to this body. |
b2Body_GetJointList(b2Body self) -> b2JointEdge Get the list of all joints attached to this body. |
b2Body_GetControllerList(b2Body self) -> b2ControllerEdge Get the list of all controllers attached to this body. |
b2Body_GetNext(b2Body self) -> b2Body Get the next body in the world's body list. |
b2Body_GetWorld(b2Body self) -> b2World Get the parent world of this body. |
b2Body_DestroyShape(b2Body self, b2Shape shape) Destroy a shape. This removes the shape from the broad-phase and therefore destroys any contacts associated with this shape. All shapes attached to a body are implicitly destroyed when the body is destroyed. Parameters: ----------- shape: the shape to be removed. WARNING: This function is locked during callbacks. |
b2Body_CreateShape(b2Body self, b2ShapeDef defn) -> b2Shape Creates a shape and attach it to this body. Parameters: ----------- shapeDef: the shape definition. WARNING: This function is locked during callbacks. |
b2Body_GetUserData(b2Body self) -> PyObject Get the user data pointer that was provided in the body definition. |
b2Body_SetUserData(b2Body self, PyObject data) Set the user data. Use this to store your application specific data. |
b2Body___hash__(b2Body self) -> int32
|
|
thisownThe membership flag |
userDataGetUserData(self) -> PyObject Get the user data pointer that was provided in the body definition. |
massDataGet a b2MassData object that represents this b2Body NOTE: To just get the mass, use body.mass (body.GetMass())
|
positionGetPosition(self) -> b2Vec2 Get the world body origin position. the world position of the body's origin.
|
angleGetAngle(self) -> float32 Get the angle in radians. the current world rotation angle in radians.
|
linearDampingGetLinearDamping(self) -> float32 Get the linear damping. |
angularDampingGetAngularDamping(self) -> float32 Get the angular damping. |
allowSleepCanSleep(self) -> bool Get whether or not this body is allowed to sleep. |
isSleepingIsSleeping(self) -> bool Is this body sleeping (not simulating). |
fixedRotationIsRotationFixed(self) -> bool Get whether or not this body is allowed to rotate. |
isBulletIsBullet(self) -> bool Is this body treated like a bullet for continuous collision detection? |
angularVelocityGetAngularVelocity(self) -> float32 Get the angular velocity. the angular velocity in radians/second. |
linearVelocityGetLinearVelocity(self) -> b2Vec2 Get the linear velocity of the center of mass. the linear velocity of the center of mass. |
shapeListGet a list of the shapes in this body Defaults to returning the typecasted objects. e.g., if there is a b2CircleShape and a b2PolygonShape: GetShapeList(True) = [b2CircleShape, b2PolygonShape] GetShapeList(False)= [b2Shape, b2Shape]
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Tue Feb 24 18:39:58 2009 | http://epydoc.sourceforge.net |