NaiveBroadphase class

Naive broadphase implementation, used in lack of better ones.

The naive broadphase looks at all possible pairs without restriction, therefore it has complexity N^2 (which is bad)

Inheritance

Constructors

NaiveBroadphase()

Properties

bscDist Vec3
finalinherited
dirty bool
Set to true if the objects in the world moved.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
useBoundingBoxes bool
If set to true, the broadphase uses bounding boxes for intersection tests, else it uses bounding spheres.
getter/setter pairinherited
world World?
The world to search for collisions in.
getter/setter pairinherited

Methods

aabbQuery(World world, AABB aabb, [List<Body>? result]) List<Body>
Returns all the bodies within an AABB. result An array to store resulting bodies in.
override
boundingSphereCheck(Body bodyA, Body bodyB) bool
Check if the bounding spheres of two bodies overlap.
inherited
collisionPairs(World world, List<Body> pairs1, List<Body> pairs2) → void
Get all the collision pairs in the physics world
override
doBoundingBoxBroadphase(Body bodyA, Body bodyB, List<Body> pairs1, List<Body> pairs2) → void
Check if the bounding boxes of two bodies are intersecting.
inherited
doBoundingSphereBroadphase(Body bodyA, Body bodyB, List<Body> pairs1, List<Body> pairs2) → void
Check if the bounding spheres of two bodies are intersecting. pairs1 bodyA is appended to this array if intersection pairs2 bodyB is appended to this array if intersection
inherited
intersectionTest(Body bodyA, Body bodyB, List<Body> pairs1, List<Body> pairs2) → void
Check if the bounding volumes of two bodies intersect.
inherited
makePairsUnique(List<Body> pairs1, List<Body> pairs2) → void
Removes duplicate pairs from the pair arrays.
inherited
needBroadphaseCollision(Body bodyA, Body bodyB) bool
Check if a body pair needs to be intersection tested at all.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setWorld(World world) → void
To be implemented by subcasses
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited