Package com.jme3.math

Examples of com.jme3.math.Vector2f


    private void setColor(Node node, ColorRGBA color){
  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
View Full Code Here


     * Sets the color of the geometries of the children and home.
     * Note, this is a recursive method.
     * @param node the node that contains children
     **/
    private void setColor(Geometry geometry, ColorRGBA color){
        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        material.setColor("m_Color",color);
        geometry.setMaterial(material);
        System.out.println("Spatial: "+geometry.getName());
    }
View Full Code Here

            Spatial spatial = assetManager.loadModel(obj);
            //Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
            //spatial.setMaterial(mat);
            node.attachChild(spatial);

      node.setModelBound(new BoundingSphere());
      node.updateModelBound();
  } catch (Exception e) {
            e.printStackTrace();
      //logger.logp(Level.SEVERE, this.getClass().toString(),"loadNode()", "Exception", e);
      node = null;
View Full Code Here

    public void simpleInitApp() {
        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry geom = new Geometry("Box", b);
        geom.updateModelBound();

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        mat.setColor("m_Color", ColorRGBA.Blue);
        geom.setMaterial(mat);

        rootNode.attachChild(geom);
    }
View Full Code Here

  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
      }else if(spatial instanceof Node){
    setColor((Node)spatial,color);
View Full Code Here

     * Note, this is a recursive method.
     * @param node the node that contains children
     **/
    private void setColor(Geometry geometry, ColorRGBA color){
        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        material.setColor("m_Color",color);
        geometry.setMaterial(material);
        System.out.println("Spatial: "+geometry.getName());
    }
View Full Code Here

        eyesRV.add("Models/Eyes/Eye1R.j3o");
    }
    private void setupColors(){
  // setup skin colors
  skinColorV = new Vector<ColorRGBA>();
  skinColorV.add(new ColorRGBA(0.941f,0.859f,0.808f,1.0f));
  skinColorV.add(new ColorRGBA(0.965f,0.788f,0.580f,1.0f));
  skinColorV.add(new ColorRGBA(0.871f,0.627f,0.384f,1.0f));
  skinColorV.add(new ColorRGBA(0.957f,0.741f,0.616f,1.0f));
  skinColorV.add(new ColorRGBA(0.647f,0.380f,0.220f,1.0f));
  skinColorV.add(new ColorRGBA(0.376f,0.243f,0.145f,1.0f));
  // pants
  pantsColor = new ColorRGBA(0.05f,0.05f,0.05f,1f);
  // favorite colors
  favoriteColorV = new Vector<ColorRGBA>();
  favoriteColorV.add(new ColorRGBA(0.820f,0.282f,0.153f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.953f,0.600f,0.282f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.941f,0.812f,0.251f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.643f,0.745f,0.216f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.157f,0.447f,0.235f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.133f,0.275f,0.651f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.424f,0.651f,0.831f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.961f,0.537f,0.537f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.451f,0.224f,0.671f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.463f,0.353f,0.231f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.824f,0.824f,0.824f,1.0f));
  favoriteColorV.add(new ColorRGBA(0.263f,0.263f,0.263f,1.0f));

  //ColorV.add(new ColorRGBA(0.f,0.f,0.f,1.0f));
  //You can also use new ColorRGBA(0.0,1.0,0.0,1.0).
    }
View Full Code Here

    ti.onNew(0, 0, 0);
    gestureSystem.update(1);
    ti.onRelease(0);
    gestureSystem.update(1);
    //printList(clickVectors);
    Assert.assertTrue(clickVectors.get(0).equals(new Vector2f(0,0)));
    Assert.assertTrue(zoomValues.isEmpty());
  }
View Full Code Here

   
    float rw = radius/width;
   
    //left center
    vertices[0] = ref.clone();
    texCoord[0] = new Vector2f(0.5f, rw);
   
    // draw left half circle
    int lastPoint = 0;
    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+1;
      int indicesBase = (i-1)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f((x * 0.5f) + 0.5f, rw-(z * rw));
      System.out.println(texCoord[verticesBase]);
      if (lastPoint > 0) {
        indices[indicesBase] = 0;
        indices[indicesBase+1] = verticesBase;
        indices[indicesBase+2] = lastPoint;
      }
      lastPoint = verticesBase;
      angle += rate;
    }
   
    // right center
    ref.z = radius-width/2f;
    int base2 = samples+2;
    vertices[base2] = ref.clone();
   
    float rbw = (width-radius)/width;
    texCoord[base2] = new Vector2f(0.5f, rbw);
    angle = FastMath.PI;
    lastPoint = 0;
   
    // draw right half circle
    for (int i = 0; i <= samples; i++) {
      float x = FastMath.cos(angle);
      float z = FastMath.sin(angle);
      int verticesBase = i+samples+3;
      int indicesBase = (i+samples)*3;
      vertices[verticesBase] = new Vector3f((x * radius) + ref.x, ref.y, (z * radius) + ref.z);
      texCoord[verticesBase] = new Vector2f((x * 0.5f) + 0.5f, 1 - (z * rw));
      if (lastPoint > 0) {
        indices[indicesBase] = base2;
        indices[indicesBase+1] = verticesBase;
        indices[indicesBase+2] = lastPoint;
      }
View Full Code Here

      float y = FastMath.sin(angle) + center.y;
      int base = i*2;
      int indicesBase = i*6;
      vertices[base] = new Vector3f(x * radius, y * radius, center.z);
      vertices[base+1] = new Vector3f(x * (radius-width), y * (radius-width), center.z);
      texCoord[base] = new Vector2f(x * radius, y * radius);
      texCoord[base+1] = new Vector2f(x * (radius-width), y * (radius-width));
     
      indices[indicesBase] = base;
      indices[indicesBase+1] = calc(base+1);
      indices[indicesBase+2] = calc(base-1);
     
View Full Code Here

TOP

Related Classes of com.jme3.math.Vector2f

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.