Class Index | File Index

Classes


Class CAAT.Module.Collision.SpatialHash


Defined in: SpatialHash.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
Columns to partition the space.
 
A collection ob objects to test collision among them.
 
Space height
 
r0
Spare rectangle to hold temporary calculations.
 
r1
Spare rectangle to hold temporary calculations.
 
Rows to partition the space.
 
Space width
Method Summary
Method Attributes Method Name and Description
<private>  
__getCells(x, y, width, height)
<private>  
_solveCollisionCell(cell, callback)
 
addObject(obj)
Add an element of the form { id, x,y,width,height, rectangular }
 
 
collide(x, y, w, h, oncollide)
 
initialize(w, h, rows, columns)
 
solveCollision(callback)
Class Detail
CAAT.Module.Collision.SpatialHash()
Field Detail
columns
Columns to partition the space.

elements
A collection ob objects to test collision among them.

height
Space height

r0
Spare rectangle to hold temporary calculations.

r1
Spare rectangle to hold temporary calculations.

rows
Rows to partition the space.

width
Space width
Method Detail
<private> __getCells(x, y, width, height)
Parameters:
x
y
width
height

<private> _solveCollisionCell(cell, callback)
Parameters:
cell
callback

addObject(obj)
Add an element of the form { id, x,y,width,height, rectangular }
Parameters:
obj

clearObject()

collide(x, y, w, h, oncollide)
Parameters:
x
y
w
h
oncollide
function that returns boolean. if returns true, stop testing collision.

initialize(w, h, rows, columns)
Parameters:
w
h
rows
columns

solveCollision(callback)
Parameters:
callback

Documentation generated by JsDoc Toolkit 2.4.0 on Mon Jul 01 2013 04:59:19 GMT-0700 (PDT)