|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcdx.Reducer
public class Reducer
Reduces the set of collisions to be tested using a voxel hashing algorithm.
Field Summary | |
---|---|
Vector2d |
horizontal
The horizontal side of a voxel. |
Vector2d |
vertical
The vertical side of a voxel. |
float |
voxel_size
The voxel size. |
Constructor Summary | |
---|---|
Reducer(float voxel_size)
Initialise the reducer with a voxel size. |
Method Summary | |
---|---|
protected void |
dfsVoxelHashRecurse(Motion motion,
Vector2d next_voxel,
HashMap voxel_map,
HashMap graph_colors)
Recursive method to check which voxels overlap with a motion |
protected boolean |
isInVoxel(Vector2d voxel,
Motion motion)
Given a voxel and a Motion, determines if they overlap. |
protected void |
performVoxelHashing(Motion motion,
HashMap voxel_map,
HashMap graph_colors)
Colours all of the voxels that overlap with the Motion. |
protected void |
putIntoMap(HashMap voxel_map,
Vector2d voxel,
Motion motion)
Puts a Motion object into the voxel map at a voxel. |
LinkedList |
reduceCollisionSet(LinkedList motions)
Takes a List of Motions and returns an List of Lists of Motions, where the inner lists implement RandomAccess. |
protected void |
voxelHash(Vector3d position,
Vector2d voxel)
Creates a Vector2d that represents a voxel. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final float voxel_size
public final Vector2d horizontal
public final Vector2d vertical
Constructor Detail |
---|
public Reducer(float voxel_size)
voxel_size
- the size of a voxelMethod Detail |
---|
protected void voxelHash(Vector3d position, Vector2d voxel)
position
- a aircraft 3D positionvoxel
- a 2D voxelprotected void putIntoMap(HashMap voxel_map, Vector2d voxel, Motion motion)
voxel_map
- a voxel hashmapvoxel
- a voxelmotion
- a motion to be hashed in the mapprotected boolean isInVoxel(Vector2d voxel, Motion motion)
voxel
- a voxel to be checkedmotion
- a motion to be checked in the voxel
protected void dfsVoxelHashRecurse(Motion motion, Vector2d next_voxel, HashMap voxel_map, HashMap graph_colors)
motion
- a motion to be checked with voxelsnext_voxel
- the next voxel in the mapvoxel_map
- the hashmap for all voxelsgraph_colors
- the hashmap who colors the voxels that overlap with
the motionprotected void performVoxelHashing(Motion motion, HashMap voxel_map, HashMap graph_colors)
motion
- the checked motionvoxel_map
- the hashmap of all voxelsgraph_colors
- the haspmap where coloured voxels overlap with this
motionpublic LinkedList reduceCollisionSet(LinkedList motions)
motions
- a lisit of motions that are to be checked with voxels
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |