SiMS
|
|
sims/collision/GridDetector.scala
]
class
GridDetector(val override
world : World)
extends
DetectorDetector
. GridDetector
divides the world into a grid
for faster collision detection.Value Summary | |
val
|
collisionMethods
: scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Collision]]
Array of methods returning collisions. It is assumed that both shapes are colliding.
|
val
|
detectionMethods
: scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Boolean]]
Array of collision detection methods. These methods return
true if two shapes are colliding. |
var
|
gridSide
: Double
Width and height of a grid cell.
|
Method Summary | |
def
|
colliding
(p : Pair) : Boolean
Checks the pair of shapes
p for collision. |
def
|
collidingPairs
: scala.Seq[Pair]
Returns all colliding pairs.
|
def
|
collision
(p : Pair) : Collision
Returns the collision between both shapes of the pair
p . |
def
|
collisions
: scala.Seq[Collision]
Returns all collisions.
|
def
|
getPairs
: scala.Seq[Pair]
Returns potential colliding pairs of shapes of the world
world . |
def
|
pairs
: scala.Seq[Pair]
All potential colliding pairs of the world.
|
Methods inherited from AnyRef | |
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized |
Methods inherited from Any | |
==, !=, isInstanceOf, asInstanceOf |
Value Details |
val
detectionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Boolean]]
true
if two shapes are colliding.
val
collisionMethods : scala.collection.mutable.ArrayBuffer[scala.PartialFunction[(Shape, Shape), Collision]]
var
gridSide : Double
Method Details |
p
for collision.p -
Pair of shapes.p
.p -
Pair of shapes.world
.
A potential colliding pair is a pair of two shapes that comply with the following criteria:
SiMS
|
|