C# 클래스 Box2D.Collision.Broadphase.DynamicTree

A dynamic tree arranges data in a binary tree to accelerate queries such as volume queries and ray casts. Leafs are proxies with an AABB. In the tree we expand the proxy AABB by _fatAABBFactor so that the proxy AABB is bigger than the client object. This allows the client object to move by small amounts without triggering a tree update.
파일 보기 프로젝트 열기: gerich-home/box2dnet 1 사용 예제들

공개 메소드들

메소드 설명
ComputeHeight ( ) : int

Compute the height of the tree.

CreateProxy ( AABB aabb, Object userData ) : int

Create a proxy. Provide a tight fitting AABB and a userData pointer.

DestroyProxy ( int proxyId ) : void

Destroy a proxy

DrawTree ( DebugDraw argDraw ) : void
DrawTree ( DebugDraw argDraw, int nodeId, int spot, int height ) : void
DynamicTree ( ) : System
GetFatAABB ( int proxyId ) : AABB
GetUserData ( int proxyId ) : object
MoveProxy ( int proxyId, AABB aabb, Vec2 displacement ) : bool

Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, then the proxy is removed from the tree and re-inserted. Otherwise the function returns immediately.

Query ( ITreeCallback callback, AABB aabb ) : void

Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.

Raycast ( ITreeRayCastCallback callback, RayCastInput input ) : void

Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree.

RebuildBottomUp ( ) : void

Build an optimal tree. Very expensive. For testing.

Validate ( ) : void

Validate this tree. For testing.

비공개 메소드들

메소드 설명
AllocateNode ( ) : int
Balance ( int iA ) : int
ComputeHeight ( int nodeId ) : int
FreeNode ( int nodeId ) : void

returns a node to the pool

InsertLeaf ( int leaf ) : void
RemoveLeaf ( int leaf ) : void
ValidateMetrics ( int index ) : void
ValidateStructure ( int index ) : void

메소드 상세

ComputeHeight() 공개 메소드

Compute the height of the tree.
public ComputeHeight ( ) : int
리턴 int

CreateProxy() 공개 메소드

Create a proxy. Provide a tight fitting AABB and a userData pointer.
public CreateProxy ( AABB aabb, Object userData ) : int
aabb AABB
userData Object
리턴 int

DestroyProxy() 공개 메소드

Destroy a proxy
public DestroyProxy ( int proxyId ) : void
proxyId int
리턴 void

DrawTree() 공개 메소드

public DrawTree ( DebugDraw argDraw ) : void
argDraw Box2D.Callbacks.DebugDraw
리턴 void

DrawTree() 공개 메소드

public DrawTree ( DebugDraw argDraw, int nodeId, int spot, int height ) : void
argDraw Box2D.Callbacks.DebugDraw
nodeId int
spot int
height int
리턴 void

DynamicTree() 공개 메소드

public DynamicTree ( ) : System
리턴 System

GetFatAABB() 공개 메소드

public GetFatAABB ( int proxyId ) : AABB
proxyId int
리턴 AABB

GetUserData() 공개 메소드

public GetUserData ( int proxyId ) : object
proxyId int
리턴 object

MoveProxy() 공개 메소드

Move a proxy with a swepted AABB. If the proxy has moved outside of its fattened AABB, then the proxy is removed from the tree and re-inserted. Otherwise the function returns immediately.
public MoveProxy ( int proxyId, AABB aabb, Vec2 displacement ) : bool
proxyId int
aabb AABB
displacement Box2D.Common.Vec2
리턴 bool

Query() 공개 메소드

Query an AABB for overlapping proxies. The callback class is called for each proxy that overlaps the supplied AABB.
public Query ( ITreeCallback callback, AABB aabb ) : void
callback ITreeCallback
aabb AABB
리턴 void

Raycast() 공개 메소드

Ray-cast against the proxies in the tree. This relies on the callback to perform a exact ray-cast in the case were the proxy contains a shape. The callback also performs the any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree.
public Raycast ( ITreeRayCastCallback callback, RayCastInput input ) : void
callback ITreeRayCastCallback a callback class that is called for each proxy that is hit by the ray.
input RayCastInput the ray-cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1).
리턴 void

RebuildBottomUp() 공개 메소드

Build an optimal tree. Very expensive. For testing.
public RebuildBottomUp ( ) : void
리턴 void

Validate() 공개 메소드

Validate this tree. For testing.
public Validate ( ) : void
리턴 void