C# 클래스 Box2D.Dynamics.Body

A rigid body. These are created via World.createBody.
파일 보기 프로젝트 열기: gerich-home/box2dnet 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
FixtureCount int
Flags TypeFlags
Force Box2D.Common.Vec2
I float
InvI float
InvMass float
IslandIndex int
Prev Body
SleepTime float
Sweep Box2D.Common.Sweep
Torque float
Xf Box2D.Common.Transform

공개 메소드들

메소드 설명
ApplyAngularImpulse ( float impulse ) : void

Apply an angular impulse.

ApplyForce ( Vec2 force, Vec2 point ) : void

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.

ApplyForceToCenter ( Vec2 force ) : void

Apply a force to the center of mass. This wakes up the body.

ApplyLinearImpulse ( Vec2 impulse, Vec2 point ) : void

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.

ApplyTorque ( float torque ) : void

Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.

Body ( BodyDef bd, World world ) : System
CreateFixture ( FixtureDef def ) : Fixture

Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates the mass of the body. Contacts are not created until the next time step.

CreateFixture ( Shape shape, float density ) : Fixture

Creates a fixture from a shape and attach it to this body. This is a convenience function. Use FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically updates the mass of the body.

DestroyFixture ( Fixture fixture ) : void

Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All fixtures attached to a body are implicitly destroyed when the body is destroyed.

GetLinearVelocityFromLocalPoint ( Vec2 localPoint ) : Vec2

Get the world velocity of a local point.

GetLinearVelocityFromLocalPointToOut ( Vec2 localPoint, Vec2 result ) : void
GetLinearVelocityFromWorldPoint ( Vec2 worldPoint ) : Vec2

Get the world linear velocity of a world point attached to this body.

GetLinearVelocityFromWorldPointToOut ( Vec2 worldPoint, Vec2 result ) : void
GetLocalPoint ( Vec2 worldPoint ) : Vec2

Gets a local point relative to the body's origin given a world point.

GetLocalPointToOut ( Vec2 worldPoint, Vec2 result ) : void
GetLocalVector ( Vec2 worldVector ) : Vec2

Gets a local vector given a world vector.

GetLocalVectorToOut ( Vec2 worldVector, Vec2 result ) : void
GetLocalVectorToOutUnsafe ( Vec2 worldVector, Vec2 result ) : void
GetMassData ( MassData data ) : void

Get the mass data of the body. The rotational inertia is relative to the center of mass.

GetTransform ( ) : Transform

Get the body transform for the body's origin.

GetWorldPoint ( Vec2 localPoint ) : Vec2

Get the world coordinates of a point given the local coordinates.

GetWorldPointToOut ( Vec2 localPoint, Vec2 result ) : void
GetWorldVector ( Vec2 localVector ) : Vec2

Get the world coordinates of a vector given the local coordinates.

GetWorldVectorToOut ( Vec2 localVector, Vec2 result ) : void
GetWorldVectorToOutUnsafe ( Vec2 localVector, Vec2 result ) : void
ResetMassData ( ) : void

This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called unless you called setMassData to override the mass and you later want to reset the mass.

SetMassData ( MassData massData ) : void

Set the mass properties to override the mass properties of the fixtures. Note that this changes the center of mass position. Note that creating or destroying fixtures can also alter the mass. This function has no effect if the body isn't dynamic.

SetTransform ( Vec2 position, float angle ) : void

Set the position of the body's origin and rotation. This breaks any contacts and wakes the other bodies. Manipulating a body's transform may cause non-physical behavior.

ShouldCollide ( Body other ) : bool

This is used to prevent connected bodies from colliding. It may lie, depending on the collideConnected flag.

SynchronizeTransform ( ) : void

비공개 메소드들

메소드 설명
Advance ( float t ) : void
SynchronizeFixtures ( ) : void

메소드 상세

ApplyAngularImpulse() 공개 메소드

Apply an angular impulse.
public ApplyAngularImpulse ( float impulse ) : void
impulse float the angular impulse in units of kg*m*m/s
리턴 void

ApplyForce() 공개 메소드

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.
public ApplyForce ( Vec2 force, Vec2 point ) : void
force Box2D.Common.Vec2 the world force vector, usually in Newtons (N).
point Box2D.Common.Vec2 the world position of the point of application.
리턴 void

ApplyForceToCenter() 공개 메소드

Apply a force to the center of mass. This wakes up the body.
public ApplyForceToCenter ( Vec2 force ) : void
force Box2D.Common.Vec2 the world force vector, usually in Newtons (N).
리턴 void

ApplyLinearImpulse() 공개 메소드

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.
public ApplyLinearImpulse ( Vec2 impulse, Vec2 point ) : void
impulse Box2D.Common.Vec2 the world impulse vector, usually in N-seconds or kg-m/s.
point Box2D.Common.Vec2 the world position of the point of application.
리턴 void

ApplyTorque() 공개 메소드

Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.
public ApplyTorque ( float torque ) : void
torque float about the z-axis (out of the screen), usually in N-m.
리턴 void

Body() 공개 메소드

public Body ( BodyDef bd, World world ) : System
bd BodyDef
world World
리턴 System

CreateFixture() 공개 메소드

Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates the mass of the body. Contacts are not created until the next time step.
public CreateFixture ( FixtureDef def ) : Fixture
def FixtureDef the fixture definition.
리턴 Fixture

CreateFixture() 공개 메소드

Creates a fixture from a shape and attach it to this body. This is a convenience function. Use FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically updates the mass of the body.
public CreateFixture ( Shape shape, float density ) : Fixture
shape Box2D.Collision.Shapes.Shape the shape to be cloned.
density float the shape density (set to zero for static bodies).
리턴 Fixture

DestroyFixture() 공개 메소드

Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All fixtures attached to a body are implicitly destroyed when the body is destroyed.
public DestroyFixture ( Fixture fixture ) : void
fixture Fixture the fixture to be removed.
리턴 void

GetLinearVelocityFromLocalPoint() 공개 메소드

Get the world velocity of a local point.
public GetLinearVelocityFromLocalPoint ( Vec2 localPoint ) : Vec2
localPoint Box2D.Common.Vec2 point in local coordinates.
리턴 Box2D.Common.Vec2

GetLinearVelocityFromLocalPointToOut() 공개 메소드

public GetLinearVelocityFromLocalPointToOut ( Vec2 localPoint, Vec2 result ) : void
localPoint Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetLinearVelocityFromWorldPoint() 공개 메소드

Get the world linear velocity of a world point attached to this body.
public GetLinearVelocityFromWorldPoint ( Vec2 worldPoint ) : Vec2
worldPoint Box2D.Common.Vec2 point in world coordinates.
리턴 Box2D.Common.Vec2

GetLinearVelocityFromWorldPointToOut() 공개 메소드

public GetLinearVelocityFromWorldPointToOut ( Vec2 worldPoint, Vec2 result ) : void
worldPoint Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetLocalPoint() 공개 메소드

Gets a local point relative to the body's origin given a world point.
public GetLocalPoint ( Vec2 worldPoint ) : Vec2
worldPoint Box2D.Common.Vec2 point in world coordinates.
리턴 Box2D.Common.Vec2

GetLocalPointToOut() 공개 메소드

public GetLocalPointToOut ( Vec2 worldPoint, Vec2 result ) : void
worldPoint Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetLocalVector() 공개 메소드

Gets a local vector given a world vector.
public GetLocalVector ( Vec2 worldVector ) : Vec2
worldVector Box2D.Common.Vec2 vector in world coordinates.
리턴 Box2D.Common.Vec2

GetLocalVectorToOut() 공개 메소드

public GetLocalVectorToOut ( Vec2 worldVector, Vec2 result ) : void
worldVector Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetLocalVectorToOutUnsafe() 공개 메소드

public GetLocalVectorToOutUnsafe ( Vec2 worldVector, Vec2 result ) : void
worldVector Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetMassData() 공개 메소드

Get the mass data of the body. The rotational inertia is relative to the center of mass.
public GetMassData ( MassData data ) : void
data Box2D.Collision.Shapes.MassData
리턴 void

GetTransform() 공개 메소드

Get the body transform for the body's origin.
public GetTransform ( ) : Transform
리턴 Box2D.Common.Transform

GetWorldPoint() 공개 메소드

Get the world coordinates of a point given the local coordinates.
public GetWorldPoint ( Vec2 localPoint ) : Vec2
localPoint Box2D.Common.Vec2 a point on the body measured relative the the body's origin.
리턴 Box2D.Common.Vec2

GetWorldPointToOut() 공개 메소드

public GetWorldPointToOut ( Vec2 localPoint, Vec2 result ) : void
localPoint Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetWorldVector() 공개 메소드

Get the world coordinates of a vector given the local coordinates.
public GetWorldVector ( Vec2 localVector ) : Vec2
localVector Box2D.Common.Vec2 a vector fixed in the body.
리턴 Box2D.Common.Vec2

GetWorldVectorToOut() 공개 메소드

public GetWorldVectorToOut ( Vec2 localVector, Vec2 result ) : void
localVector Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

GetWorldVectorToOutUnsafe() 공개 메소드

public GetWorldVectorToOutUnsafe ( Vec2 localVector, Vec2 result ) : void
localVector Box2D.Common.Vec2
result Box2D.Common.Vec2
리턴 void

ResetMassData() 공개 메소드

This resets the mass properties to the sum of the mass properties of the fixtures. This normally does not need to be called unless you called setMassData to override the mass and you later want to reset the mass.
public ResetMassData ( ) : void
리턴 void

SetMassData() 공개 메소드

Set the mass properties to override the mass properties of the fixtures. Note that this changes the center of mass position. Note that creating or destroying fixtures can also alter the mass. This function has no effect if the body isn't dynamic.
public SetMassData ( MassData massData ) : void
massData Box2D.Collision.Shapes.MassData the mass properties.
리턴 void

SetTransform() 공개 메소드

Set the position of the body's origin and rotation. This breaks any contacts and wakes the other bodies. Manipulating a body's transform may cause non-physical behavior.
public SetTransform ( Vec2 position, float angle ) : void
position Box2D.Common.Vec2 the world position of the body's local origin.
angle float the world rotation in radians.
리턴 void

ShouldCollide() 공개 메소드

This is used to prevent connected bodies from colliding. It may lie, depending on the collideConnected flag.
public ShouldCollide ( Body other ) : bool
other Body
리턴 bool

SynchronizeTransform() 공개 메소드

public SynchronizeTransform ( ) : void
리턴 void

프로퍼티 상세

FixtureCount 공개적으로 프로퍼티

public int FixtureCount
리턴 int

Flags 공개적으로 프로퍼티

public TypeFlags Flags
리턴 TypeFlags

Force 공개적으로 프로퍼티

public Vec2,Box2D.Common Force
리턴 Box2D.Common.Vec2

I 공개적으로 프로퍼티

public float I
리턴 float

InvI 공개적으로 프로퍼티

public float InvI
리턴 float

InvMass 공개적으로 프로퍼티

public float InvMass
리턴 float

IslandIndex 공개적으로 프로퍼티

public int IslandIndex
리턴 int

Prev 공개적으로 프로퍼티

public Body,Box2D.Dynamics Prev
리턴 Body

SleepTime 공개적으로 프로퍼티

public float SleepTime
리턴 float

Sweep 공개적으로 프로퍼티

The swept motion for CCD
public Sweep,Box2D.Common Sweep
리턴 Box2D.Common.Sweep

Torque 공개적으로 프로퍼티

public float Torque
리턴 float

Xf 공개적으로 프로퍼티

The body origin transform.
public Transform,Box2D.Common Xf
리턴 Box2D.Common.Transform