Examples of scaleLocal()


Examples of org.mt4j.util.math.Vector3D.scaleLocal()

   * @param factor the factor
   */
  public void zoomFactor(float factor){
    factor = 1/factor;
    Vector3D dirToCamVect = camPos.getSubtracted(viewCenterPos);
    dirToCamVect.scaleLocal(factor);
    if (dirToCamVect.length() > zoomMinDistance){
      Vector3D toCam = viewCenterPos.getAdded(dirToCamVect);
      camPos.setXYZ(toCam.getX(), toCam.getY(), toCam.getZ());
     
      this.dirty = true;
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

    //get the length of that vector
    float mag = dirToCamVect.length();
    //normalize the vector
    dirToCamVect.normalizeLocal();
    //scale the normalized vector with the original amount + the zoom amount
    dirToCamVect.scaleLocal(mag + amount);
   
    if (dirToCamVect.length() > zoomMinDistance){
      //Get the Vector to the camera from origin
      Vector3D toCam = viewCenterPos.getAdded(dirToCamVect);
      //set the new camPos
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

      if (invertNormals){
        Vector3D[] normals = mesh.getGeometryInfo().getNormals();
        for (int j = 0; j < normals.length; j++) {
          Vector3D vector3d = normals[j];
          vector3d.scaleLocal(-1);
        }
        mesh.getGeometryInfo().setNormals(mesh.getGeometryInfo().getNormals(), mesh.isUseDirectGL(), mesh.isUseVBOs());
      }

      //If the mesh has more than 20 vertices, use a display list for faster rendering
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

      case MTGestureEvent.GESTURE_ENDED:
        if (canDrag){
          theListCellContainer.setDragging(false);
         
          Vector3D vel = de.getDragCursor().getVelocityVector(140);
          vel.scaleLocal(0.8f);
          vel = vel.getLimited(15);
          IMTController oldController = theListCellContainer.getController();
          theListCellContainer.setController(new InertiaListController(theListCellContainer, vel, oldController));
        }
        canDrag = false;
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

    Vertex v1 = getVerticesLocal()[1];

    if (v0.z == 0 && v1.z == 0){ //Only create bounding poly if the line is in the z=0 plane
      Vector3D dir = v1.getSubtracted(v0);
      dir.normalizeLocal();
      dir.scaleLocal(10);
      dir.rotateZ(PApplet.radians(90));
      Vector3D bv0 = new Vector3D(v0.getAdded(dir));
      Vector3D bv1 = new Vector3D(v0.getAdded(dir.getScaled(-1)));
      Vector3D bv2 = new Vector3D(v1.getAdded(dir.getScaled(-1)));
      Vector3D bv3 = new Vector3D(v1.getAdded(dir));
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

  }
 
  private Vector3D calcCenterPointLocal(){
    Vector3D tmp0 = this.boundingPointsLocal[0].getCopy();
    Vector3D tmp1 = this.boundingPointsLocal[1].getSubtracted(this.boundingPointsLocal[0]);
    tmp1.scaleLocal(0.5f);
   
    Vector3D tmp2 = this.boundingPointsLocal[3].getSubtracted(this.boundingPointsLocal[0]);
    tmp2.scaleLocal(0.5f);
   
    tmp0.addLocal(tmp1);
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

    Vector3D tmp0 = this.boundingPointsLocal[0].getCopy();
    Vector3D tmp1 = this.boundingPointsLocal[1].getSubtracted(this.boundingPointsLocal[0]);
    tmp1.scaleLocal(0.5f);
   
    Vector3D tmp2 = this.boundingPointsLocal[3].getSubtracted(this.boundingPointsLocal[0]);
    tmp2.scaleLocal(0.5f);
   
    tmp0.addLocal(tmp1);
    tmp0.addLocal(tmp2);
    return tmp0;
  }
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

        if (notEntirelyClipped && (t[0] != saveT0 || t[1] != saveT1)) {
            if (t[1] > t[0]) {
                float[] distances = t;
               
                Vector3D point1 = new Vector3D(rayDirection);
                point1.scaleLocal(distances[0]);
                point1.addLocal(ray.getRayStartPoint());
               
                Vector3D point2 = new Vector3D(rayDirection);
                point2.scaleLocal(distances[1]);
                point2.addLocal(ray.getRayStartPoint());
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

                Vector3D point1 = new Vector3D(rayDirection);
                point1.scaleLocal(distances[0]);
                point1.addLocal(ray.getRayStartPoint());
               
                Vector3D point2 = new Vector3D(rayDirection);
                point2.scaleLocal(distances[1]);
                point2.addLocal(ray.getRayStartPoint());
               
//                Vector3D[] points = new Vector3D[] {
//                    point1,
//                    point2
View Full Code Here

Examples of org.mt4j.util.math.Vector3D.scaleLocal()

                return (dist1Length > dist2Length? point2 : point1); //point 1 or 2!
            }
               
            float[] distances = new float[] { t[0] };
            Vector3D point3 = new Vector3D(rayDirection);
            point3.scaleLocal(distances[0]);
            point3.addLocal(ray.getRayStartPoint());
           
           
//            Vector3D[] points = new Vector3D[] {
//                point3
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.