class BroadPhase
package oimo.collision.broadphase
extended by BruteForceBroadPhase, BvhBroadPhase
The abstract class of a broad-phase collision detection algorithm.
Methods
aabbTest(aabb:Aabb, callback:BroadPhaseProxyCallback):Void
Performs an AABB query. callback.process
is called for all proxies that their AABB
and aabb
intersect.
collectPairs():Void
Collects overlapping pairs of the proxies and put them into a linked list. The linked list
can be get through BroadPhase.getProxyPairList
method.
Note that in order to collect pairs, the broad-phase algorithm requires to be informed of
movements of proxies through BroadPhase.moveProxy
method.
convexCast(convex:ConvexGeometry, begin:Transform, translation:Vec3, callback:BroadPhaseProxyCallback):Void
Performs a convex casting. callback.process
is called for all shapes the convex geometry
convex
hits. The convex geometry translates by translation
starting from the beginning
transform begin
.
createProxy(userData:Any, aabb:Aabb):Proxy
Returns a new proxy connected with the user data userData
containing the axis-aligned
bounding box aabb
, and adds the proxy into the collision space.
inlineisIncremental():Bool
Returns whether to collect only pairs created in the last step. If this returns true, the pairs that are not collected might still be overlapping. Otherwise, such pairs are guaranteed to be separated.
inlineisOverlapping(proxy1:Proxy, proxy2:Proxy):Bool
Returns whether the pair of proxy1
and proxy2
is overlapping. As proxies can be larger
than the containing AABBs, two proxies may overlap even though their inner AABBs are separate.
moveProxy(proxy:Proxy, aabb:Aabb, displacement:Vec3):Void
Moves the proxy proxy
to the axis-aligned bounding box aabb
. displacement
is the
difference between current and previous center of the AABB. This is used for predicting
movement of the proxy.
rayCast(begin:Vec3, end:Vec3, callback:BroadPhaseProxyCallback):Void
Performs a ray casting. callback.process
is called for all proxies the line segment
from begin
to end
intersects.