Package edu.cmu.cs.stage3.math

Examples of edu.cmu.cs.stage3.math.Box


    }
  }
  protected void onBoundsChange() {
    m_boundingBox = null;
    m_boundingSphere = null;
    onBoundsChange( new BoundEvent( this ) );
  }
View Full Code Here


            triVertices[triangulator.points.size()+i]=new Vertex3d(new Point3d(curPoint.x,curPoint.y,extz/2),norm2,null,null,new TexCoord2f());
        }

        li = triangulator.triangles.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Triangle curTri = (Triangle)li.next();
            indices[i*3]=triangulator.indexOfPoint(curTri.vertices[2]);
            indices[i*3+1]=triangulator.indexOfPoint(curTri.vertices[1]);
            indices[i*3+2]=triangulator.indexOfPoint(curTri.vertices[0]);
            indices[triangulator.triangles.size()*3+i*3]=triangulator.points.size()+indices[i*3+2];
            indices[triangulator.triangles.size()*3+i*3+1]=triangulator.points.size()+indices[i*3+1];
 
View Full Code Here

  }
  public Box getBoundingBox( ReferenceFrame asSeenBy, HowMuch howMuch, boolean ignoreHidden ) {
    if( asSeenBy==null ) {
      asSeenBy = this;
    }
    Box box = new Box( null, null );
    updateBoundingBox( box, asSeenBy, howMuch, ignoreHidden );
    return box;
  }
View Full Code Here

    Box box = new Box( null, null );
    updateBoundingBox( box, asSeenBy, howMuch, ignoreHidden );
    return box;
  }
  public Vector3 getSize( ReferenceFrame asSeenBy, HowMuch howMuch, boolean ignoreHidden ) {
    Box box = getBoundingBox( asSeenBy, howMuch, ignoreHidden );
    if( box!=null ) {
      return new Vector3( box.getWidth(), box.getHeight(), box.getDepth() );
    } else {
      return new Vector3( 0, 0, 0 );
    }
  }
View Full Code Here

    } else {
      return new Vector3( 0, 0, 0 );
    }
  }
  public double getSizeAlongDimension( Dimension dimension, ReferenceFrame asSeenBy, HowMuch howMuch, boolean ignoreHidden ) {
    Box box = getBoundingBox( asSeenBy, howMuch, ignoreHidden );
    if( box != null ) {
      if( dimension==Dimension.LEFT_TO_RIGHT ) {
        return box.getWidth();
      } else if( dimension==Dimension.TOP_TO_BOTTOM ) {
        return box.getHeight();
      } else if( dimension==Dimension.FRONT_TO_BACK ) {
        return box.getDepth();
      } else {
        throw new IllegalArgumentException( dimension + " is expected to be in [LEFT_TO_RIGHT, TOP_TO_BOTTOM, FRONT_TO_BACK]." );
      }
    } else {
      //todo: Double.NaN?
View Full Code Here

      return Math.sqrt(vec.x * vec.x + vec.y * vec.y + vec.z * vec.z);
    }
   
    double getAngle(Vector3 a, Vector3 b) { 
      // calculate angle
      Vector3 c = Vector3.subtract(a, b);
      double cLength = getLength(c);
      double aLength = getLength(a);
      double bLength = getLength(b);   
      double cosC = ((cLength * cLength) - (aLength * aLength) - (bLength * bLength)) / (-2.0 * aLength * bLength);
     
 
View Full Code Here

    /*protected Vector3 getHandForward() {
      return null;
    }*/
   
    protected void setVectors() {
      Vector3 rightUpperPos = upperLimb.getPosition(upperLimb);
      Vector3 targetPos = getTargetPosition(); //m_target.getPosition(upperLimb); 
      targetVector = Vector3.subtract(targetPos,rightUpperPos);
      //targetVector.normalize();
     
      javax.vecmath.Vector3d currentDir = null;
      if (lowerLimb == null) {
View Full Code Here

      if (asb == null) asb = upperLimb;
     
      javax.vecmath.Vector3d targPos = m_target.getBoundingBox(asb).getCenter();
      Vector3d offsetDir = null;
     
      HowMuch howMuch = HowMuch.INSTANCE_AND_PARTS;
      // if target is not a top-level object, just get the bounding box for that one part
      if ( !(m_target.getParent().equals(m_target.getWorld() )) ){
        howMuch = HowMuch.INSTANCE;
      }
     
View Full Code Here

    protected java.util.Vector createPopupStructure() {
      java.util.Vector structure = createExpressionStructure();
      if( (structure != null) && isNullValid ) {
        if( structure.size() > 0 ) {
          structure.insertElementAt( new StringObjectPair( "Separator", javax.swing.JSeparator.class ), 0 );
        }
        //structure.insertElementAt( new StringObjectPair( "<None>", objectRunnableFactory.createRunnable( null ) ), 0 );
      }
      return structure;
    }
View Full Code Here

        structure.add( new edu.cmu.cs.stage3.util.StringObjectPair( "Expressions which evaluate to " + className, expressionStructure ) );
      }

      if( isNullValid ) {
        if( structure.size() > 0 ) {
          structure.insertElementAt( new StringObjectPair( "Separator", javax.swing.JSeparator.class ), 0 );
        }
        //structure.insertElementAt( new StringObjectPair( "<None>", objectRunnableFactory.createRunnable( null ) ), 0 );
      }

      return structure;
View Full Code Here

TOP

Related Classes of edu.cmu.cs.stage3.math.Box

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.