Examples of distanceSquared()


Examples of com.ardor3d.math.Line3.distanceSquared()

        if (!_calcRay.intersectsPlane(pickPlane, _calcVec3B)) {
            return _calcVec3A.zero();
        }

        // Cast us to the line along our arrow
        arrowLine.distanceSquared(_calcVec3A, _calcVec3C);
        arrowLine.distanceSquared(_calcVec3B, _calcVec3D);

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
View Full Code Here

Examples of com.ardor3d.math.Line3.distanceSquared()

            return _calcVec3A.zero();
        }

        // Cast us to the line along our arrow
        arrowLine.distanceSquared(_calcVec3A, _calcVec3C);
        arrowLine.distanceSquared(_calcVec3B, _calcVec3D);

        // convert to target coord space
        final Node parent = manager.getSpatialTarget().getParent();
        if (parent != null) {
            parent.getWorldTransform().applyInverse(_calcVec3C);
View Full Code Here

Examples of com.jme3.math.Vector2f.distanceSquared()

          for(Vector3f point : c.m_WallMidpoint){
            //not needed, as this will not work, midpoints will be always on the line
//            //to find the one on the border
//            if(!isPointInTile(point.x, point.z)){
              //and which is closer than the ones before the current
              dist = cross.distanceSquared(point.x, point.z);
              if(dist<max){
                max = dist;
                targetCell = c;
                goal = point;
              }
View Full Code Here

Examples of com.jme3.math.Vector3f.distanceSquared()

     
      //reached the waypoint, is it the last? stop, otherwise go to next one
      WayPoint last = com.path.WaypointList().get(com.path.WaypointList().size()-1);
      if(com.cell == last.cell){
        float dist = endPos.distanceSquared(last.position);
        if(dist < 0.000001f){
          com.position.set(last.position);
          signalStopToEnv(com);
          haltPosComponent(com);
          com.path = null;
View Full Code Here

Examples of crazypants.vecmath.Vector3d.distanceSquared()

     
      //Using this scale will give us the block full screen, we will make it 20% of the screen
      scale *= Config.travelAnchorZoomScale;     

      //only apply 70% of the scaling so more distance targets are still smaller than closer targets
      float nf = 1 - MathHelper.clamp_float((float) eyePoint.distanceSquared(loc) / TravelSource.STAFF.maxDistanceTravelledSq, 0, 1);
      scale = scale * (0.3 + 0.7 * nf);

      scale = (scale * mix) + (1 - mix);
      scale = Math.max(1, scale);
     
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.shapes.Line.distanceSquared()

     
      Vector2f lineStartA = vertsA[collPairs[i][0]];
      Vector2f lineEndA = vertsA[(collPairs[i][0]+1) % vertsA.length ];
      Line line = new Line(lineStartA, lineEndA);
           
      float dis2 = line.distanceSquared(bodyB.getPosition());
      float r2 = circle.getRadius() * circle.getRadius();

      if ( dis2 < r2 ) {
        Vector2f pt = new Vector2f();
       
View Full Code Here

Examples of eas.simulation.spatial.sim2D.physicalSimulation.physicsEngine.net.phys2d.raw.shapes.Line.distanceSquared()

     
      Vector2f lineStartA = vertsA[collPairs[i][0]];
      Vector2f lineEndA = vertsA[(collPairs[i][0]+1) % vertsA.length ];
      Line line = new Line(lineStartA, lineEndA);
           
      float dis2 = line.distanceSquared(bodyB.getPosition());
      float r2 = circle.getRadius() * circle.getRadius();

      if ( dis2 < r2 ) {
        Vector2f pt = new Vector2f();
       
View Full Code Here

Examples of javax.vecmath.Point3d.distanceSquared()

      System.err.println("ptope sphere intersect point ="+p);
  }
  if (!inside){
      // if distance between polytope and sphere center is greater than
      // radius then no intersection
      if (p.distanceSquared( sphere.center) >
          sphere.radius*sphere.radius){
    if (debug) {
        System.err.println("ptope_sphere returns false");
    }
    return false;
View Full Code Here

Examples of javax.vecmath.Point3d.distanceSquared()

      } else {
    g.set(gnew);
    break;
      }
      prevDist = dist;
      dist =  pnew.distanceSquared(g);

      if (dist < prevDist) {
    p.set(pnew);
    if( !intersect ) {
        intersect = closest_point( p, poly1.planes, gnew );
View Full Code Here

Examples of javax.vecmath.Point3d.distanceSquared()

/*     */
/* 505 */     boolean inside = closest_point(sphere.center, polyTope.planes, p);
/*     */
/* 509 */     if (!inside)
/*     */     {
/* 512 */       if (p.distanceSquared(sphere.center) > sphere.radius * sphere.radius)
/*     */       {
/* 517 */         return false;
/*     */       }
/*     */
/* 522 */       return true;
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.