Selaa lähdekoodia

circle collision ok

sarl
zephyr 3 vuotta sitten
vanhempi
commit
ff0aebb56a
3 muutettua tiedostoa jossa 7 lisäystä ja 7 poistoa
  1. +1
    -1
      gui/GraphicalMap.java
  2. +5
    -5
      simulator/environment/Environment.java
  3. +1
    -1
      simulator/environment/movingManager/MovingManager.java

+ 1
- 1
gui/GraphicalMap.java Näytä tiedosto

@@ -21,7 +21,7 @@ public class GraphicalMap extends JPanel{
private QuadTree tree;
private Rectangle2f fieldOfView;
private Point2f center;
private float scale = 5;
private float scale = 20;
private ArrayList <DrawingObject> listObj;

+ 5
- 5
simulator/environment/Environment.java Näytä tiedosto

@@ -19,12 +19,12 @@ public class Environment {
MovableObject mo2;
public Environment (float width, float height){
tree = new QuadTree(width,height);
mo = new MovableObject(new Point2f(-5, 0), 2, 5);
mo.setVelocity(new Vector2f(2,0));
mo = new MovableObject(new Point2f(-3, 0), 1, 5);
mo.setVelocity(new Vector2f(1,0));
tree.insertObject(mo);
movingManager.add(mo);
mo2 = new MovableObject(new Point2f(0, 5), 4, 5);
mo2.setVelocity(new Vector2f(0,-1));
mo2 = new MovableObject(new Point2f(3, 0), 1,5);
mo2.setVelocity(new Vector2f(-1,0));
tree.insertObject(mo2);
movingManager.add(mo2);
bodies = new ArrayList<AgentBody> ();
@@ -37,7 +37,7 @@ public class Environment {
System.out.println("SUCCESS");
}
else{
System.out.println("0000000");
System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
}
}
public void perceive (){

+ 1
- 1
simulator/environment/movingManager/MovingManager.java Näytä tiedosto

@@ -44,7 +44,7 @@ public class MovingManager {
}
for(MovableObject mo : this.movingObject){
if(dt!=null){
if(dt <= deltaT && dt > 0){
if(dt <= 1 && dt > 0){
mo.Translate(mo.getVelocity().operator_multiply(deltaT));
mo.getNode().removeObject(mo);
tree.insertObject(mo);

Loading…
Peruuta
Tallenna