Package com.math

Examples of com.math.Vector


  /**
   * Constructor
   */
  public Camera(Vector pos,Quat rot) {//Vector rot
    super(new Vector(1,1,2), pos, rot,int2color(0));
 
View Full Code Here


    rad += dz;
    rotate(0,0,0);
  }

  public void reset(){
    p = new Vector(0,0,-500);
    r = new Quat();
    center.set(0,0,0);
    rad = 500f;
    xy = 0; xz = 0;
    cm = CamMode.stand;
View Full Code Here

    cm = CamMode.stand;
    e.set(0,0,-3000);
  }

  public Vector getRay(){
    Vector ray = new Vector(0,0,1);
    //    r.rotateVector(ray);
    r.rotate(ray);
    return ray;   
  }
View Full Code Here

      p.z = center.z - (float)Math.cos(xz)*rad;
      p.y = center.y + (float)Math.sin(xy)*rad;

      //    System.out.println(p+"---"+center);
      //    System.out.println(center.sub(p).length());
      r.fromTo(p,new Vector(center.x,center.y,center.z-rad));
      r.invert();
    }
  }
View Full Code Here

 
  public static void initSim(){
    shapes = new ArrayList<Shape> ();
    sim_shapes = new ArrayList<Shape> ();
    distroy_shapes = new ArrayList<Shape> ();
    cam  = new Camera(new Vector(0,0,-500),new Quat());
  }
View Full Code Here

  public Fish(Camera cam,Vector dim,Vector pos,Quat rot,String type){
    shapeS = new ArrayList<>();

    this.cam = cam;

    d = new Vector(dim);

    this.color = Shape.int2color(6);

    points_num = Route.FORWARD_STATE_NUM+2+2;
    points = new Vector[points_num];

    x = new int[points_num];
    y = new int[points_num];

    this.p = new Vector(pos);
    this.r = new Quat(rot);

    target = new Vector(0,0,0);

    shape = buildMeSomeFish(type,this);
    SHAPE_NUM = shape.length;

    this.type = type;
View Full Code Here

    route = new Route(this);
    route.calcNewRoute();

    for(int i=0;i<points_num;i++)
      points[i] = new Vector();


  }
View Full Code Here

    }
    else{
//      Fish f = World.getFirstOfType(this.type);
      Fish f = World.getClosestFishWithoutFish(sp,this.type,this);
      if(f != null){
        Vector p = f.p;
        while(true){
          tmp.set(rand.nextFloat()-0.5f,rand.nextFloat()-0.5f,rand.nextFloat()-0.5f);

          float mag = tmp.length();
View Full Code Here

    return fish;
  }

  public static Fish fromXML(Element e, Camera cam){
    Vector p = Vector.parseVector(e.getAttribute("position"));
    Quat r = Quat.parseQuat(e.getAttribute("rotation"));
    Vector d = Vector.parseVector(e.getAttribute("dimmention"));
    String type = e.getAttribute("type");

    Fish f = new Fish(cam,d,p,r,type);

    f.name = e.getAttribute("name");
View Full Code Here

  State tmpState;
 
  public Route(Fish fish2) {
    this.fish = fish2;
   
    target = new Vector();
   
//    tmpStates = new State[FORWARD_STATE_NUM];
//    for(int i = 0;i<FORWARD_STATE_NUM;i++)
//      tmpStates[i] = new State(fish2);
   
View Full Code Here

TOP

Related Classes of com.math.Vector

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.