This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public boolean collide(OctSpace space, double accuracy) | |
| { | |
| for (Plane plane : planes) | |
| if(!anyInfrontOfPlane(space, accuracy, plane)) | |
| return false; | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public abstract class OctNode implements Collidable, Animated, GLRenderable { | |
| protected final OctSpace space; | |
| public OctNode(OctSpace space) { | |
| this.space = space; | |
| } | |
| public OctSpace getSpace() { | |
| return space; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void render(final GL2 gl) { | |
| ArrayUtils.map(elements, new MapFunction<OctNode>(){ | |
| public void map(OctNode input) { | |
| input.render(gl); | |
| } | |
| } | |
| ); | |
| } | |
| public class ArrayUtils{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define MEASURE_FUNCTION_TIME | |
| #include <boost/thread/thread.hpp> | |
| #include <boost/make_shared.hpp> | |
| #include <pcl/common/time.h> //fps calculations | |
| #include <pcl/io/openni_grabber.h> | |
| #include <pcl/visualization/point_cloud_handlers.h> | |
| #include <pcl/visualization/pcl_visualizer.h> | |
| #include <pcl/visualization/image_viewer.h> | |
| #include <pcl/console/print.h> | |
| #include <pcl/console/parse.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <boost/thread/thread.hpp> | |
| #include <boost/make_shared.hpp> | |
| #include <pcl/io/openni_grabber.h> | |
| #include <pcl/visualization/point_cloud_handlers.h> | |
| #include <pcl/visualization/pcl_visualizer.h> | |
| #include <pcl/visualization/image_viewer.h> | |
| #include <pcl/console/print.h> | |
| #include <pcl/console/parse.h> | |
| #include <pcl/console/time.h> | |
| #include <pcl/common/transforms.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <boost/thread/thread.hpp> | |
| #include <boost/make_shared.hpp> | |
| #include <pcl/io/openni_grabber.h> | |
| #include <pcl/visualization/point_cloud_handlers.h> | |
| #include <pcl/visualization/pcl_visualizer.h> | |
| #include <pcl/visualization/image_viewer.h> | |
| #include <pcl/console/print.h> | |
| #include <pcl/console/parse.h> | |
| #include <pcl/console/time.h> | |
| #include <pcl/common/transforms.h> |
OlderNewer