Package edu.cmu.cs.stage3.util

Examples of edu.cmu.cs.stage3.util.HowMuch


        if (pg.getVertices()!=null) {
            Vertex3d[] verts = new Vertex3d[pg.getVertices().length];
            double height = getSceneGraphGeometry().getBoundingBox().getHeight()/(double)lineCount;
            for (int i=0; i<verts.length; i++) {
                    verts[i] = new Vertex3d((Point3d)pg.getVertices()[i].position.clone(), pg.getVertices()[i].normal, null, null, new TexCoord2f());
                    verts[i].scale(1.0/height,1.0/height,1);
            }
            ((IndexedTriangleArray)this.getSceneGraphGeometry()).setVertices(verts);
        }
    }
View Full Code Here


        Vector3d norm2 = new Vector3d(0,0,1);

        li = triangulator.points.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Point2d curPoint = (Point2d)li.next();
            triVertices[i]=new Vertex3d(new Point3d(curPoint.x,curPoint.y,-extz/2),norm1,null,null,new TexCoord2f());
            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();
View Full Code Here

        java.util.ListIterator li = points.listIterator();
        for (int i=0; li.hasNext(); i++) {
            Point2d point = (Point2d)li.next();

            Point3d pos = new Point3d(point.x,point.y,-extz/2);
            sideVertices[i*2]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2)),null,null,new TexCoord2f());
            sideVertices[i*2+1]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2+1)),null,null,new TexCoord2f());
            pos = new Point3d(point.x,point.y,extz/2);
            sideVertices[points.size()*2+i*2]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2)),null,null,new TexCoord2f());
            sideVertices[points.size()*2+i*2+1]=new Vertex3d(pos,new Vector3d((Vector3f)normals.elementAt(i*2+1)),null,null,new TexCoord2f());
        }

        for (int i=0; i<points.size()-1; i++) {
            //if (outside) {
                indices[i*6]=2*i;
 
View Full Code Here

    }
  }
  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

      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.util.HowMuch

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.