@NoOffset @Properties(inherit=liquidfun.class) public class b2Body extends Pointer
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
b2Body(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
ApplyAngularImpulse(float impulse,
boolean wake)
Apply an angular impulse.
|
void |
ApplyForce(b2Vec2 force,
b2Vec2 point,
boolean wake)
Apply a force at a world point.
|
void |
ApplyForceToCenter(b2Vec2 force,
boolean wake)
Apply a force to the center of mass.
|
void |
ApplyLinearImpulse(b2Vec2 impulse,
b2Vec2 point,
boolean wake)
Apply an impulse at a point.
|
void |
ApplyTorque(float torque,
boolean wake)
Apply a torque.
|
b2Fixture |
CreateFixture(b2FixtureDef def)
Creates a fixture and attach it to this body.
|
b2Fixture |
CreateFixture(b2Shape shape,
float density)
Creates a fixture from a shape and attach it to this body.
|
void |
DestroyFixture(b2Fixture fixture)
Destroy a fixture.
|
void |
Dump()
Dump this body to a log file
|
float |
GetAngle()
Get the angle in radians.
|
float |
GetAngularDamping()
Get the angular damping of the body.
|
float |
GetAngularVelocity()
Get the angular velocity.
|
b2ContactEdge |
GetContactList()
Get the list of all contacts attached to this body.
|
b2Fixture |
GetFixtureList()
Get the list of all fixtures attached to this body.
|
float |
GetGravityScale()
Get the gravity scale of the body.
|
float |
GetInertia()
Get the rotational inertia of the body about the local origin.
|
b2JointEdge |
GetJointList()
Get the list of all joints attached to this body.
|
float |
GetLinearDamping()
Get the linear damping of the body.
|
b2Vec2 |
GetLinearVelocity()
Get the linear velocity of the center of mass.
|
b2Vec2 |
GetLinearVelocityFromLocalPoint(b2Vec2 localPoint)
Get the world velocity of a local point.
|
b2Vec2 |
GetLinearVelocityFromWorldPoint(b2Vec2 worldPoint)
Get the world linear velocity of a world point attached to this body.
|
b2Vec2 |
GetLocalCenter()
Get the local position of the center of mass.
|
b2Vec2 |
GetLocalPoint(b2Vec2 worldPoint)
Gets a local point relative to the body's origin given a world point.
|
b2Vec2 |
GetLocalVector(b2Vec2 worldVector)
Gets a local vector given a world vector.
|
float |
GetMass()
Get the total mass of the body.
|
void |
GetMassData(b2MassData data)
Get the mass data of the body.
|
b2Body |
GetNext()
Get the next body in the world's body list.
|
b2Vec2 |
GetPosition()
Get the world body origin position.
|
float |
GetPositionX()
Get x-coordinate of position.
|
float |
GetPositionY()
Get y-coordinate of position.
|
b2Transform |
GetTransform()
Get the body transform for the body's origin.
|
int |
GetType()
Get the type of this body.
|
Pointer |
GetUserData()
Get the user data pointer that was provided in the body definition.
|
b2World |
GetWorld()
Get the parent world of this body.
|
b2Vec2 |
GetWorldCenter()
Get the world position of the center of mass.
|
b2Vec2 |
GetWorldPoint(b2Vec2 localPoint)
Get the world coordinates of a point given the local coordinates.
|
b2Vec2 |
GetWorldVector(b2Vec2 localVector)
Get the world coordinates of a vector given the local coordinates.
|
boolean |
IsActive()
Get the active state of the body.
|
boolean |
IsAwake()
Get the sleeping state of this body.
|
boolean |
IsBullet()
Is this body treated like a bullet for continuous collision detection?
|
boolean |
IsFixedRotation()
Does this body have fixed rotation?
|
boolean |
IsSleepingAllowed()
Is this body allowed to sleep
|
void |
ResetMassData()
This resets the mass properties to the sum of the mass properties of the fixtures.
|
void |
SetActive(boolean flag)
Set the active state of the body.
|
void |
SetAngularDamping(float angularDamping)
Set the angular damping of the body.
|
void |
SetAngularVelocity(float omega)
Set the angular velocity.
|
void |
SetAwake(boolean flag)
Set the sleep state of the body.
|
void |
SetBullet(boolean flag)
Should this body be treated like a bullet for continuous collision detection?
|
void |
SetFixedRotation(boolean flag)
Set this body to have fixed rotation.
|
void |
SetGravityScale(float scale)
Set the gravity scale of the body.
|
void |
SetLinearDamping(float linearDamping)
Set the linear damping of the body.
|
void |
SetLinearVelocity(b2Vec2 v)
Set the linear velocity of the center of mass.
|
void |
SetMassData(b2MassData data)
Set the mass properties to override the mass properties of the fixtures.
|
void |
SetSleepingAllowed(boolean flag)
You can disable sleeping on this body.
|
void |
SetTransform(b2Vec2 _position,
float angle)
Set the position of the body's origin and rotation.
|
void |
SetTransform(float positionX,
float positionY,
float angle)
Set b2Transform using direct floats.
|
void |
SetType(int type)
Set the type of this body.
|
void |
SetUserData(Pointer data)
Set the user data.
|
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public b2Body(Pointer p)
Pointer(Pointer)
.public b2Fixture CreateFixture(@Const b2FixtureDef def)
def
- the fixture definition.
\warning This function is locked during callbacks.public b2Fixture CreateFixture(@Const b2Shape shape, @Cast(value="float32") float density)
shape
- the shape to be cloned.density
- the shape density (set to zero for static bodies).
\warning This function is locked during callbacks.public void DestroyFixture(b2Fixture fixture)
fixture
- the fixture to be removed.
\warning This function is locked during callbacks.public void SetTransform(@Const @ByRef b2Vec2 _position, @Cast(value="float32") float angle)
position
- the world position of the body's local origin.angle
- the world rotation in radians.@Const @ByRef public b2Transform GetTransform()
@Const @ByRef public b2Vec2 GetPosition()
@Cast(value="float32") public float GetAngle()
@Const @ByRef public b2Vec2 GetWorldCenter()
@Const @ByRef public b2Vec2 GetLocalCenter()
public void SetLinearVelocity(@Const @ByRef b2Vec2 v)
v
- the new linear velocity of the center of mass.@Const @ByRef public b2Vec2 GetLinearVelocity()
public void SetAngularVelocity(@Cast(value="float32") float omega)
omega
- the new angular velocity in radians/second.@Cast(value="float32") public float GetAngularVelocity()
public void ApplyForce(@Const @ByRef b2Vec2 force, @Const @ByRef b2Vec2 point, @Cast(value="bool") boolean wake)
force
- the world force vector, usually in Newtons (N).point
- the world position of the point of application.wake
- also wake up the bodypublic void ApplyForceToCenter(@Const @ByRef b2Vec2 force, @Cast(value="bool") boolean wake)
force
- the world force vector, usually in Newtons (N).wake
- also wake up the bodypublic void ApplyTorque(@Cast(value="float32") float torque, @Cast(value="bool") boolean wake)
torque
- about the z-axis (out of the screen), usually in N-m.wake
- also wake up the bodypublic void ApplyLinearImpulse(@Const @ByRef b2Vec2 impulse, @Const @ByRef b2Vec2 point, @Cast(value="bool") boolean wake)
impulse
- the world impulse vector, usually in N-seconds or kg-m/s.point
- the world position of the point of application.wake
- also wake up the bodypublic void ApplyAngularImpulse(@Cast(value="float32") float impulse, @Cast(value="bool") boolean wake)
impulse
- the angular impulse in units of kg*m*m/swake
- also wake up the body@Cast(value="float32") public float GetMass()
@Cast(value="float32") public float GetInertia()
public void GetMassData(b2MassData data)
public void SetMassData(@Const b2MassData data)
massData
- the mass properties.public void ResetMassData()
@ByVal public b2Vec2 GetWorldPoint(@Const @ByRef b2Vec2 localPoint)
localPoint
- a point on the body measured relative the the body's origin.@ByVal public b2Vec2 GetWorldVector(@Const @ByRef b2Vec2 localVector)
localVector
- a vector fixed in the body.@ByVal public b2Vec2 GetLocalPoint(@Const @ByRef b2Vec2 worldPoint)
a
- point in world coordinates.@ByVal public b2Vec2 GetLocalVector(@Const @ByRef b2Vec2 worldVector)
a
- vector in world coordinates.@ByVal public b2Vec2 GetLinearVelocityFromWorldPoint(@Const @ByRef b2Vec2 worldPoint)
a
- point in world coordinates.@ByVal public b2Vec2 GetLinearVelocityFromLocalPoint(@Const @ByRef b2Vec2 localPoint)
a
- point in local coordinates.@Cast(value="float32") public float GetLinearDamping()
public void SetLinearDamping(@Cast(value="float32") float linearDamping)
@Cast(value="float32") public float GetAngularDamping()
public void SetAngularDamping(@Cast(value="float32") float angularDamping)
@Cast(value="float32") public float GetGravityScale()
public void SetGravityScale(@Cast(value="float32") float scale)
public void SetType(@Cast(value="b2BodyType") int type)
public void SetBullet(@Cast(value="bool") boolean flag)
@Cast(value="bool") public boolean IsBullet()
public void SetSleepingAllowed(@Cast(value="bool") boolean flag)
@Cast(value="bool") public boolean IsSleepingAllowed()
public void SetAwake(@Cast(value="bool") boolean flag)
flag
- set to true to wake the body, false to put it to sleep.@Cast(value="bool") public boolean IsAwake()
public void SetActive(@Cast(value="bool") boolean flag)
public void SetFixedRotation(@Cast(value="bool") boolean flag)
@Cast(value="bool") public boolean IsFixedRotation()
public b2Fixture GetFixtureList()
public b2JointEdge GetJointList()
public b2ContactEdge GetContactList()
public b2Body GetNext()
public Pointer GetUserData()
public void SetUserData(Pointer data)
public b2World GetWorld()
public void Dump()
Copyright © 2022. All rights reserved.