Skip to content

Instantly share code, notes, and snippets.

public abstract class OctNode implements Collidable, Animated, GLRenderable {
protected final OctSpace space;
public OctNode(OctSpace space) {
this.space = space;
}
public OctSpace getSpace() {
return space;
package geometry;
import java.util.Vector;
import javax.media.opengl.GL2;
import octree.collisions.Collidable;
import octree.collisions.CollisionDetails;
import octree.collisions.CollisionFrustrum;
import octree.collisions.NullCollision;
package geometry;
public class Plane {
public final Vertex point;
public final Vertex normal;
public Plane(Vertex point, Vertex normal) {
this.point = point;
this.normal = normal;
public boolean collide(OctSpace space, double accuracy)
{
for (Plane plane : planes)
if(!anyInfrontOfPlane(space, accuracy, plane))
return false;
return true;
}
public boolean collide(OctSpace space, double accuracy)
{
for (Plane plane : planes) {
boolean anyInPlane = false;
for(Vertex point : space.points)
if(infrontOfPlane(point, accuracy, plane))
anyInPlane = true;
if(!anyInPlane)
1 class Population
2 def initialize(population_size, target)
3 @target = target
4
5 @population = []
6 population_size.times do
7 @population.push Individual.create_random(target, target.length)
8 end
9 end
10