C# 클래스 FarseerPhysics.Dynamics.World

The world class manages all physics entities, dynamic simulation, and asynchronous queries.
상속: IRayCastCallback
파일 보기 프로젝트 열기: prime31/Nez 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
AwakeBodySet HashSet
addRemoveTime float
bodyList List
breakableBodyList List
contactManager ContactManager
contactsUpdateTime float
continuousPhysicsTime float
controllerList List
controllersUpdateTime float
enabled bool
gravity Vector2
island Island
jointList List
newContactsTime float
onBodyAdded BodyDelegate
onBodyRemoved BodyDelegate
onControllerAdded ControllerDelegate
onControllerRemoved ControllerDelegate
onFixtureAdded FixtureDelegate
onFixtureRemoved FixtureDelegate
onJointAdded JointDelegate
onJointRemoved JointDelegate
solveUpdateTime float
updateTime float

공개 메소드들

메소드 설명
World ( Vector2 gravity ) : System

Initializes a new instance of the World class.

addBreakableBody ( BreakableBody breakableBody ) : void
addController ( Controller controller ) : void
addJoint ( Joint joint ) : void

Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding.

clear ( ) : void
clearForces ( ) : void

Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function.

overlapCircle ( Vector2 center, float radius ) : void
processAddedBodies ( ) : void
processAddedJoints ( ) : void
processChanges ( ) : void

All adds and removes are cached by the World duing a World step. To process the changes before the world updates again, call this method.

processRemovedBodies ( ) : void
processRemovedJoints ( ) : void
queryAABB ( AABB &aabb ) : List

Query the world for all fixtures that potentially overlap the provided AABB. Use the overload with a callback for filtering and better performance.

queryAABB ( bool>.Func callback, AABB &aabb ) : void

Query the world for all fixtures that potentially overlap the provided AABB. Inside the callback: Return true: Continues the query Return false: Terminate the query

rayCast ( Vector2 point1, Vector2 point2 ) : List
rayCast ( Func callback, Vector2 point1, Vector2 point2 ) : void

Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. Inside the callback: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue

removeBody ( Body body ) : void

Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints.

removeBreakableBody ( BreakableBody breakableBody ) : void
removeController ( Controller controller ) : void
removeJoint ( Joint joint ) : void

Destroy a joint. This may cause the connected bodies to begin colliding.

removeJoint ( Joint joint, bool doCheck ) : void
shiftOrigin ( Vector2 newOrigin ) : void
solve ( TimeStep &timeStep ) : void
step ( float dt ) : void

Take a time step. This performs collision detection, integration, and consraint solution.

testPoint ( Vector2 point ) : Fixture
testPointAll ( Vector2 point ) : List

Returns a list of fixtures that are at the specified point.

비공개 메소드들

메소드 설명
addBody ( Body body ) : void

Add a rigid body.

queryAABBCallbackWrapper ( int proxyId ) : bool
rayCastCallbackWrapper ( RayCastInput rayCastInput, int proxyId ) : float
testPointAllCallback ( Fixture fixture ) : bool
testPointCallback ( Fixture fixture ) : bool

메소드 상세

World() 공개 메소드

Initializes a new instance of the World class.
public World ( Vector2 gravity ) : System
gravity Vector2
리턴 System

addBreakableBody() 공개 메소드

public addBreakableBody ( BreakableBody breakableBody ) : void
breakableBody BreakableBody
리턴 void

addController() 공개 메소드

public addController ( Controller controller ) : void
controller FarseerPhysics.Controllers.Controller
리턴 void

addJoint() 공개 메소드

Create a joint to constrain bodies together. This may cause the connected bodies to cease colliding.
public addJoint ( Joint joint ) : void
joint FarseerPhysics.Dynamics.Joints.Joint The joint.
리턴 void

clear() 공개 메소드

public clear ( ) : void
리턴 void

clearForces() 공개 메소드

Call this after you are done with time steps to clear the forces. You normally call this after each call to Step, unless you are performing sub-steps. By default, forces will be automatically cleared, so you don't need to call this function.
public clearForces ( ) : void
리턴 void

overlapCircle() 공개 메소드

public overlapCircle ( Vector2 center, float radius ) : void
center Vector2
radius float
리턴 void

processAddedBodies() 공개 메소드

public processAddedBodies ( ) : void
리턴 void

processAddedJoints() 공개 메소드

public processAddedJoints ( ) : void
리턴 void

processChanges() 공개 메소드

All adds and removes are cached by the World duing a World step. To process the changes before the world updates again, call this method.
public processChanges ( ) : void
리턴 void

processRemovedBodies() 공개 메소드

public processRemovedBodies ( ) : void
리턴 void

processRemovedJoints() 공개 메소드

public processRemovedJoints ( ) : void
리턴 void

queryAABB() 공개 메소드

Query the world for all fixtures that potentially overlap the provided AABB. Use the overload with a callback for filtering and better performance.
public queryAABB ( AABB &aabb ) : List
aabb AABB The aabb query box.
리턴 List

queryAABB() 공개 메소드

Query the world for all fixtures that potentially overlap the provided AABB. Inside the callback: Return true: Continues the query Return false: Terminate the query
public queryAABB ( bool>.Func callback, AABB &aabb ) : void
callback bool>.Func A user implemented callback class.
aabb AABB The aabb query box.
리턴 void

rayCast() 공개 메소드

public rayCast ( Vector2 point1, Vector2 point2 ) : List
point1 Vector2
point2 Vector2
리턴 List

rayCast() 공개 메소드

Ray-cast the world for all fixtures in the path of the ray. Your callback controls whether you get the closest point, any point, or n-points. The ray-cast ignores shapes that contain the starting point. Inside the callback: return -1: ignore this fixture and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue
public rayCast ( Func callback, Vector2 point1, Vector2 point2 ) : void
callback Func A user implemented callback class.
point1 Vector2 The ray starting point.
point2 Vector2 The ray ending point.
리턴 void

removeBody() 공개 메소드

Destroy a rigid body. Warning: This automatically deletes all associated shapes and joints.
public removeBody ( Body body ) : void
body Body The body.
리턴 void

removeBreakableBody() 공개 메소드

public removeBreakableBody ( BreakableBody breakableBody ) : void
breakableBody BreakableBody
리턴 void

removeController() 공개 메소드

public removeController ( Controller controller ) : void
controller Controller
리턴 void

removeJoint() 공개 메소드

Destroy a joint. This may cause the connected bodies to begin colliding.
public removeJoint ( Joint joint ) : void
joint Joint The joint.
리턴 void

removeJoint() 공개 메소드

public removeJoint ( Joint joint, bool doCheck ) : void
joint Joint
doCheck bool
리턴 void

shiftOrigin() 공개 메소드

public shiftOrigin ( Vector2 newOrigin ) : void
newOrigin Vector2
리턴 void

solve() 공개 메소드

public solve ( TimeStep &timeStep ) : void
timeStep TimeStep
리턴 void

step() 공개 메소드

Take a time step. This performs collision detection, integration, and consraint solution.
public step ( float dt ) : void
dt float The amount of time to simulate, this should not vary.
리턴 void

testPoint() 공개 메소드

public testPoint ( Vector2 point ) : Fixture
point Vector2
리턴 Fixture

testPointAll() 공개 메소드

Returns a list of fixtures that are at the specified point.
public testPointAll ( Vector2 point ) : List
point Vector2 The point.
리턴 List

프로퍼티 상세

AwakeBodySet 공개적으로 프로퍼티

public HashSet AwakeBodySet
리턴 HashSet

addRemoveTime 공개적으로 프로퍼티

public float addRemoveTime
리턴 float

bodyList 공개적으로 프로퍼티

Get the world body list.
public List bodyList
리턴 List

breakableBodyList 공개적으로 프로퍼티

public List breakableBodyList
리턴 List

contactManager 공개적으로 프로퍼티

Get the contact manager for testing.
public ContactManager,FarseerPhysics.Dynamics contactManager
리턴 ContactManager

contactsUpdateTime 공개적으로 프로퍼티

public float contactsUpdateTime
리턴 float

continuousPhysicsTime 공개적으로 프로퍼티

public float continuousPhysicsTime
리턴 float

controllerList 공개적으로 프로퍼티

public List controllerList
리턴 List

controllersUpdateTime 공개적으로 프로퍼티

public float controllersUpdateTime
리턴 float

enabled 공개적으로 프로퍼티

If false, the whole simulation stops. It still processes added and removed geometries.
public bool enabled
리턴 bool

gravity 공개적으로 프로퍼티

Change the global gravity vector.
public Vector2 gravity
리턴 Vector2

island 공개적으로 프로퍼티

public Island island
리턴 Island

jointList 공개적으로 프로퍼티

Get the world joint list.
public List jointList
리턴 List

newContactsTime 공개적으로 프로퍼티

public float newContactsTime
리턴 float

onBodyAdded 공개적으로 프로퍼티

Fires whenever a body has been added
public BodyDelegate onBodyAdded
리턴 BodyDelegate

onBodyRemoved 공개적으로 프로퍼티

Fires whenever a body has been removed
public BodyDelegate onBodyRemoved
리턴 BodyDelegate

onControllerAdded 공개적으로 프로퍼티

Fires every time a controller is added to the World.
public ControllerDelegate onControllerAdded
리턴 ControllerDelegate

onControllerRemoved 공개적으로 프로퍼티

Fires every time a controlelr is removed form the World.
public ControllerDelegate onControllerRemoved
리턴 ControllerDelegate

onFixtureAdded 공개적으로 프로퍼티

Fires whenever a fixture has been added
public FixtureDelegate onFixtureAdded
리턴 FixtureDelegate

onFixtureRemoved 공개적으로 프로퍼티

Fires whenever a fixture has been removed
public FixtureDelegate onFixtureRemoved
리턴 FixtureDelegate

onJointAdded 공개적으로 프로퍼티

Fires whenever a joint has been added
public JointDelegate onJointAdded
리턴 JointDelegate

onJointRemoved 공개적으로 프로퍼티

Fires whenever a joint has been removed
public JointDelegate onJointRemoved
리턴 JointDelegate

solveUpdateTime 공개적으로 프로퍼티

public float solveUpdateTime
리턴 float

updateTime 공개적으로 프로퍼티

public float updateTime
리턴 float