Package com.math

Examples of com.math.Vector


  public Shape shape[];
  Box [] boxes;
 
  public Aqu(Camera cam,Vector dim) {
    this.cam = cam;
    d = new Vector(dim);
    p = new Vector();
    r = new Quat();
   
    shapeS = new ArrayList<>();
    boxes = new Box[1];
    shape = new Shape[12];
View Full Code Here


    boxes[0] = new Box(cam, d, p, r, color);
   
//    for(int i = 0;i<SHAPE_NUM/8;i++){
     
//    }
    shape[0] = new Box(cam, new Vector(3,3,d.z-3), p.add(new Vector(d.x,d.y,0)), r, color);
    shape[1] = new Box(cam, new Vector(3,3,d.z-3), p.add(new Vector(d.x,-d.y,0)), r, color);
    shape[2] = new Box(cam, new Vector(3,3,d.z-3), p.add(new Vector(-d.x,d.y,0)), r, color);
    shape[3] = new Box(cam, new Vector(3,3,d.z-3), p.add(new Vector(-d.x,-d.y,0)), r, color);
    shape[4] = new Box(cam, new Vector(d.x+3,3,3), p.add(new Vector(0,d.y,d.z)), r, color);
    shape[5] = new Box(cam, new Vector(d.x+3,3,3), p.add(new Vector(0,d.y,-d.z)), r, color);
    shape[6] = new Box(cam, new Vector(d.x+3,3,3), p.add(new Vector(0,-d.y,d.z)), r, color);
    shape[7] = new Box(cam, new Vector(d.x+3,3,3), p.add(new Vector(0,-d.y,-d.z)), r, color);
    shape[8= new Box(cam, new Vector(3,d.y-3,3), p.add(new Vector(d.x,0,d.z)), r, color);
    shape[9= new Box(cam, new Vector(3,d.y-3,3), p.add(new Vector(d.x,0,-d.z)), r, color);
    shape[10] = new Box(cam, new Vector(3,d.y-3,3), p.add(new Vector(-d.x,0,d.z)), r, color);
    shape[11] = new Box(cam, new Vector(3,d.y-3,3), p.add(new Vector(-d.x,0,-d.z)), r, color);
   
    for(Shape s:shape)
      World.shapes.add(s);
  }
View Full Code Here

    return aqu;
  }

  public static Aqu fromXML(Element e, Camera cam) {
//    Color color =  new Color(Integer.parseInt(e.getAttribute("color")));
    Vector d = Vector.parseVector(e.getAttribute("dimmention"));
//    Vector p = Vector.parseVector(e.getAttribute("position"));
//    Quat r = Quat.parseQuat(e.getAttribute("rotation"));
   
    return new Aqu(cam,d);
  }
View Full Code Here

 
//  static final float MAX_LIN_VEL = 2f;
//  static final float MIN_LIN_VEL = MAX_LIN_VEL/5f;
 
  public State(){
    p = new Vector();
    r = new Quat();
    linVel = new Vector();
    angVel = new Vector();
    target = new Vector();
    build();
  }
View Full Code Here

    target = new Vector();
    build();
  }
 
  public State(Fish f) {
    p = new Vector(0,0,f.d.z);
    p.transformation(f.r, f.p);
    r = new Quat(f.r);
   
    linVel = new Vector();
    angVel = new Vector();
    target = new Vector(f.target);
    fi = f;
    build();
  }
View Full Code Here

    tmpa = new Vector[PREDICT_NUM];
    resetTries();
    p_p = new Vector[PREDICT_NUM];
    p_r = new Quat[PREDICT_NUM]
    for(int i=0;i<PREDICT_NUM;i++){
      p_p[i] = new Vector();
      p_r[i] = new Quat();
    }
   
    for(int i=0;i<PREDICT_NUM;i++)
      tmpa[i] = new Vector();
  }
View Full Code Here

 
  Vector v;
 
  public FishFood(Camera cam) {
    super(cam,dim,
      new Vector( Fish.rand.nextFloat()*2*World.fishtank.d.x - World.fishtank.d.x,
            Fish.rand.nextFloat()*World.fishtank.d.y,
            Fish.rand.nextFloat()*2*World.fishtank.d.z - World.fishtank.d.z),
      Quat.getRandomQuat(),Color.yellow);
    World.shapes.add(this);
    v = new Vector(0,Fish.rand.nextFloat()*VEL_CONST,0);
  }
 
View Full Code Here

 
  public Box(Camera cam,Vector dim,Vector pos,Quat rot,Color color){//Vector rot
    super();
    this.cam = cam;
    this.def_color = color;
    d = new Vector(dim);
    points_num = 8;
    points = new Vector[points_num];
    this.p = new Vector(pos);
//    this.r = new Vector(rot);
    this.r = new Quat(rot);
    guf = new Vector[6][4];
    x = new int[4];
    y = new int[4];
View Full Code Here

  }
 
  public Box(Vector dim,Vector pos,Quat rot,Color color){//Vector rot
    super();
    this.def_color = color;
    d = new Vector(dim);
    points_num = 8;
    points = new Vector[points_num];
    this.p = new Vector(pos);
//    this.r = new Vector(rot);
    this.r = new Quat(rot);
    guf = new Vector[6][4];
    x = new int[4];
    y = new int[4];
View Full Code Here

    build();
  }
 
  public void build(){
    for(int i = 0;i<points_num;i++)
      points[i] = new Vector();
   
    bridg();
   
  }
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.