C# 클래스 Box2DX.Dynamics.Body

상속: IDisposable
파일 보기 프로젝트 열기: KrugerHeavyIndustries/box2d-unity 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
bodyID int

공개 메소드들

메소드 설명
AllowSleeping ( bool flag ) : void

You can disable sleeping on this body.

ApplyForce ( System.Vector2 force, System.Vector2 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.

ApplyImpulse ( System.Vector2 impulse, System.Vector2 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.

CreateFixture ( FixtureDef def ) : Fixture

Creates a fixture and attach it to this body. @warning This function is locked during callbacks.

DestroyFixture ( Fixture fixture ) : void

Destroy a fixture. This removes the fixture from the broad-phase and therefore destroys any contacts associated with this fixture. All fixtures attached to a body are implicitly destroyed when the body is destroyed. @warning This function is locked during callbacks.

Dispose ( ) : void
GetAngle ( ) : float

Get the angle in radians.

GetAngularDamping ( ) : float
GetAngularVelocity ( ) : float

Get the angular velocity.

GetControllerList ( ) : ControllerEdge
GetFixtureList ( ) : Fixture

Get the list of all fixtures attached to this body.

GetInertia ( ) : float

Get the central rotational inertia of the body.

GetJointList ( ) : JointEdge

Get the list of all joints attached to this body.

GetLinearDamping ( ) : float
GetLinearVelocity ( ) : System.Vector2

Get the linear velocity of the center of mass.

GetLinearVelocityFromLocalPoint ( System.Vector2 localPoint ) : System.Vector2

Get the world velocity of a local point.

GetLinearVelocityFromWorldPoint ( System.Vector2 worldPoint ) : System.Vector2

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

GetLocalCenter ( ) : System.Vector2

Get the local position of the center of mass.

GetLocalPoint ( System.Vector2 worldPoint ) : System.Vector2

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

GetLocalVector ( System.Vector2 worldVector ) : System.Vector2

Gets a local vector given a world vector.

GetMass ( ) : float

Get the total mass of the body.

GetMassData ( ) : MassData

Get the mass data of the body.

GetNext ( ) : Body

Get the next body in the world's body list.

GetPosition ( ) : System.Vector2

Get the world body origin position.

GetTransform ( ) : Box2DX.Common.Transform

Get the body Transform for the body's origin.

GetUserData ( ) : object

Get the user data pointer that was provided in the body definition.

GetWorld ( ) : World

Get the parent world of this body.

GetWorldCenter ( ) : System.Vector2

Get the world position of the center of mass.

GetWorldPoint ( System.Vector2 localPoint ) : System.Vector2

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

GetWorldVector ( System.Vector2 localVector ) : System.Vector2

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

IsAllowSleeping ( ) : bool
IsBullet ( ) : bool

Is this body treated like a bullet for continuous collision detection?

IsDynamic ( ) : bool

Is this body dynamic (movable)?

IsFixedRotation ( ) : bool
IsFrozen ( ) : bool

Is this body frozen?

IsSleeping ( ) : bool

Is this body sleeping (not simulating).

IsStatic ( ) : bool

Is this body static (immovable)?

PutToSleep ( ) : void

Put this body to sleep so it will stop simulating. This also sets the velocity to zero.

SetAngle ( float angle ) : void

Set the world body angle.

SetAngularDamping ( float angularDamping ) : void
SetAngularVelocity ( float w ) : void

Set the angular velocity.

SetBullet ( bool flag ) : void

Should this body be treated like a bullet for continuous collision detection?

SetFixedRotation ( bool fixedr ) : void
SetLinearDamping ( float linearDamping ) : void
SetLinearVelocity ( System.Vector2 v ) : void

Set the linear velocity of the center of mass.

SetMass ( MassData massData ) : void

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.

SetMassFromShapes ( ) : void

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.

SetPosition ( System.Vector2 position ) : void

Set the world body origin position.

SetStatic ( ) : void
SetTransform ( Box2DX.Common.Transform xf ) : bool

Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies. Note this is less efficient than the other overload - you should use that if the angle is available.

SetTransform ( System.Vector2 position, Mat22 rotation ) : bool

Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies.

SetTransform ( System.Vector2 position, Quaternion rotation ) : bool
SetTransform ( System.Vector2 position, float angle ) : bool
SetUserData ( object data ) : void

Set the user data. Use this to store your application specific data.

WakeUp ( ) : void

Wake up this body so it will begin simulating.

비공개 메소드들

메소드 설명
Advance ( float t ) : void
Body ( BodyDef bd, World world ) : System
IsConnected ( Body other ) : bool
SynchronizeFixtures ( ) : bool
SynchronizeTransform ( ) : void

메소드 상세

AllowSleeping() 공개 메소드

You can disable sleeping on this body.
public AllowSleeping ( bool flag ) : void
flag bool
리턴 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 ( System.Vector2 force, System.Vector2 point ) : void
force System.Vector2 The world force vector, usually in Newtons (N).
point System.Vector2 The world position of the point of application.
리턴 void

ApplyImpulse() 공개 메소드

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 ApplyImpulse ( System.Vector2 impulse, System.Vector2 point ) : void
impulse System.Vector2 The world impulse vector, usually in N-seconds or kg-m/s.
point System.Vector2 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 Torque about the z-axis (out of the screen), usually in N-m.
리턴 void

CreateFixture() 공개 메소드

Creates a fixture and attach it to this body. @warning This function is locked during callbacks.
public CreateFixture ( FixtureDef def ) : Fixture
def FixtureDef The fixture definition.
리턴 Fixture

DestroyFixture() 공개 메소드

Destroy a fixture. This removes the fixture from the broad-phase and therefore destroys any contacts associated with this fixture. All fixtures attached to a body are implicitly destroyed when the body is destroyed. @warning This function is locked during callbacks.
public DestroyFixture ( Fixture fixture ) : void
fixture Fixture The fixture to be removed.
리턴 void

Dispose() 공개 메소드

public Dispose ( ) : void
리턴 void

GetAngle() 공개 메소드

Get the angle in radians.
public GetAngle ( ) : float
리턴 float

GetAngularDamping() 공개 메소드

public GetAngularDamping ( ) : float
리턴 float

GetAngularVelocity() 공개 메소드

Get the angular velocity.
public GetAngularVelocity ( ) : float
리턴 float

GetControllerList() 공개 메소드

public GetControllerList ( ) : ControllerEdge
리턴 Box2DX.Dynamics.Controllers.ControllerEdge

GetFixtureList() 공개 메소드

Get the list of all fixtures attached to this body.
public GetFixtureList ( ) : Fixture
리턴 Fixture

GetInertia() 공개 메소드

Get the central rotational inertia of the body.
public GetInertia ( ) : float
리턴 float

GetJointList() 공개 메소드

Get the list of all joints attached to this body.
public GetJointList ( ) : JointEdge
리턴 JointEdge

GetLinearDamping() 공개 메소드

public GetLinearDamping ( ) : float
리턴 float

GetLinearVelocity() 공개 메소드

Get the linear velocity of the center of mass.
public GetLinearVelocity ( ) : System.Vector2
리턴 System.Vector2

GetLinearVelocityFromLocalPoint() 공개 메소드

Get the world velocity of a local point.
public GetLinearVelocityFromLocalPoint ( System.Vector2 localPoint ) : System.Vector2
localPoint System.Vector2 A point in local coordinates.
리턴 System.Vector2

GetLinearVelocityFromWorldPoint() 공개 메소드

Get the world linear velocity of a world point attached to this body.
public GetLinearVelocityFromWorldPoint ( System.Vector2 worldPoint ) : System.Vector2
worldPoint System.Vector2 A point in world coordinates.
리턴 System.Vector2

GetLocalCenter() 공개 메소드

Get the local position of the center of mass.
public GetLocalCenter ( ) : System.Vector2
리턴 System.Vector2

GetLocalPoint() 공개 메소드

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

GetLocalVector() 공개 메소드

Gets a local vector given a world vector.
public GetLocalVector ( System.Vector2 worldVector ) : System.Vector2
worldVector System.Vector2 A vector in world coordinates.
리턴 System.Vector2

GetMass() 공개 메소드

Get the total mass of the body.
public GetMass ( ) : float
리턴 float

GetMassData() 공개 메소드

Get the mass data of the body.
public GetMassData ( ) : MassData
리턴 Box2DX.Collision.MassData

GetNext() 공개 메소드

Get the next body in the world's body list.
public GetNext ( ) : Body
리턴 Body

GetPosition() 공개 메소드

Get the world body origin position.
public GetPosition ( ) : System.Vector2
리턴 System.Vector2

GetTransform() 공개 메소드

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

GetUserData() 공개 메소드

Get the user data pointer that was provided in the body definition.
public GetUserData ( ) : object
리턴 object

GetWorld() 공개 메소드

Get the parent world of this body.
public GetWorld ( ) : World
리턴 World

GetWorldCenter() 공개 메소드

Get the world position of the center of mass.
public GetWorldCenter ( ) : System.Vector2
리턴 System.Vector2

GetWorldPoint() 공개 메소드

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

GetWorldVector() 공개 메소드

Get the world coordinates of a vector given the local coordinates.
public GetWorldVector ( System.Vector2 localVector ) : System.Vector2
localVector System.Vector2 A vector fixed in the body.
리턴 System.Vector2

IsAllowSleeping() 공개 메소드

public IsAllowSleeping ( ) : bool
리턴 bool

IsBullet() 공개 메소드

Is this body treated like a bullet for continuous collision detection?
public IsBullet ( ) : bool
리턴 bool

IsDynamic() 공개 메소드

Is this body dynamic (movable)?
public IsDynamic ( ) : bool
리턴 bool

IsFixedRotation() 공개 메소드

public IsFixedRotation ( ) : bool
리턴 bool

IsFrozen() 공개 메소드

Is this body frozen?
public IsFrozen ( ) : bool
리턴 bool

IsSleeping() 공개 메소드

Is this body sleeping (not simulating).
public IsSleeping ( ) : bool
리턴 bool

IsStatic() 공개 메소드

Is this body static (immovable)?
public IsStatic ( ) : bool
리턴 bool

PutToSleep() 공개 메소드

Put this body to sleep so it will stop simulating. This also sets the velocity to zero.
public PutToSleep ( ) : void
리턴 void

SetAngle() 공개 메소드

Set the world body angle.
public SetAngle ( float angle ) : void
angle float The new angle of the body in radians
리턴 void

SetAngularDamping() 공개 메소드

public SetAngularDamping ( float angularDamping ) : void
angularDamping float
리턴 void

SetAngularVelocity() 공개 메소드

Set the angular velocity.
public SetAngularVelocity ( float w ) : void
w float
리턴 void

SetBullet() 공개 메소드

Should this body be treated like a bullet for continuous collision detection?
public SetBullet ( bool flag ) : void
flag bool
리턴 void

SetFixedRotation() 공개 메소드

public SetFixedRotation ( bool fixedr ) : void
fixedr bool
리턴 void

SetLinearDamping() 공개 메소드

public SetLinearDamping ( float linearDamping ) : void
linearDamping float
리턴 void

SetLinearVelocity() 공개 메소드

Set the linear velocity of the center of mass.
public SetLinearVelocity ( System.Vector2 v ) : void
v System.Vector2 The new linear velocity of the center of mass.
리턴 void

SetMass() 공개 메소드

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.
public SetMass ( MassData massData ) : void
massData Box2DX.Collision.MassData The mass properties.
리턴 void

SetMassFromShapes() 공개 메소드

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.
public SetMassFromShapes ( ) : void
리턴 void

SetPosition() 공개 메소드

Set the world body origin position.
public SetPosition ( System.Vector2 position ) : void
position System.Vector2 The new position of the body.
리턴 void

SetStatic() 공개 메소드

public SetStatic ( ) : void
리턴 void

SetTransform() 공개 메소드

Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies. Note this is less efficient than the other overload - you should use that if the angle is available.
public SetTransform ( Box2DX.Common.Transform xf ) : bool
xf Box2DX.Common.Transform The Transform of position and angle to set the body to.
리턴 bool

SetTransform() 공개 메소드

Set the position of the body's origin and rotation (radians). This breaks any contacts and wakes the other bodies.
public SetTransform ( System.Vector2 position, Mat22 rotation ) : bool
position System.Vector2 The new world position of the body's origin (not necessarily /// the center of mass).
rotation Box2DX.Common.Mat22
리턴 bool

SetTransform() 공개 메소드

public SetTransform ( System.Vector2 position, Quaternion rotation ) : bool
position System.Vector2
rotation Quaternion
리턴 bool

SetTransform() 공개 메소드

public SetTransform ( System.Vector2 position, float angle ) : bool
position System.Vector2
angle float
리턴 bool

SetUserData() 공개 메소드

Set the user data. Use this to store your application specific data.
public SetUserData ( object data ) : void
data object
리턴 void

WakeUp() 공개 메소드

Wake up this body so it will begin simulating.
public WakeUp ( ) : void
리턴 void

프로퍼티 상세

bodyID 공개적으로 프로퍼티

public int bodyID
리턴 int