Package com.jme3.font

Examples of com.jme3.font.BitmapText.addControl()


    floorGeometry.setMaterial(material);
    floorGeometry.setLocalTranslation(0, -0.25f, 0);
    // Plane plane = new Plane();
    // plane.setOriginNormal(new Vector3f(0, 0.25f, 0), Vector3f.UNIT_Y);
    // floorGeometry.addControl(new RigidBodyControl(new PlaneCollisionShape(plane), 0));
    floorGeometry.addControl(new RigidBodyControl(0));
    rootNode.attachChild(floorGeometry);
    space.add(floorGeometry);

    // movable spheres
    for (int i = 0; i < 5; i++) {
View Full Code Here


      Sphere sphere = new Sphere(16, 16, .5f);
      Geometry ballGeometry = new Geometry("Soccer ball", sphere);
      ballGeometry.setMaterial(material);
      ballGeometry.setLocalTranslation(i, 2, -3);
      // RigidBodyControl automatically uses Sphere collision shapes when attached to single geometry with sphere mesh
      ballGeometry.addControl(new RigidBodyControl(.001f));
      ballGeometry.getControl(RigidBodyControl.class).setRestitution(1);
      rootNode.attachChild(ballGeometry);
      space.add(ballGeometry);
    }
View Full Code Here

    // immovable Box with mesh collision shape
    Box box = new Box(1, 1, 1);
    Geometry boxGeometry = new Geometry("Box", box);
    boxGeometry.setMaterial(material);
    boxGeometry.setLocalTranslation(4, 1, 2);
    boxGeometry.addControl(new RigidBodyControl(new MeshCollisionShape(box), 0));
    rootNode.attachChild(boxGeometry);
    space.add(boxGeometry);

  }
View Full Code Here

    material.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
    Box box = new Box(0.25f, 0.25f, 0.25f);
    Geometry boxGeometry = new Geometry("Box", box);
    boxGeometry.setMaterial(material);
    // RigidBodyControl automatically uses box collision shapes when attached to single geometry with box mesh
    boxGeometry.addControl(new RigidBodyControl(2));
    return boxGeometry;
  }

  /**
   * creates a sphere geometry with a RigidBodyControl\
View Full Code Here

    material.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg"));
    Sphere sphere = new Sphere(8, 8, 0.25f);
    Geometry boxGeometry = new Geometry("Sphere", sphere);
    boxGeometry.setMaterial(material);
    // RigidBodyControl automatically uses sphere collision shapes when attached to single geometry with sphere mesh
    boxGeometry.addControl(new RigidBodyControl(2));
    return boxGeometry;
  }

  /**
   * creates an empty node with a RigidBodyControl
View Full Code Here

          Geometry bulletg = new Geometry("bullet", bullet);
          bulletg.setMaterial(mat2);
          bulletg.setShadowMode(ShadowMode.CastAndReceive);
          bulletg.setLocalTranslation(app.getCamera().getLocation());
          RigidBodyControl bulletControl = new RigidBodyControl(1);
          bulletg.addControl(bulletControl);
          bulletControl.setLinearVelocity(app.getCamera().getDirection().mult(25));
          bulletg.addControl(bulletControl);
          rootNode.attachChild(bulletg);
          space.add(bulletControl);
        }
View Full Code Here

          bulletg.setShadowMode(ShadowMode.CastAndReceive);
          bulletg.setLocalTranslation(app.getCamera().getLocation());
          RigidBodyControl bulletControl = new RigidBodyControl(1);
          bulletg.addControl(bulletControl);
          bulletControl.setLinearVelocity(app.getCamera().getDirection().mult(25));
          bulletg.addControl(bulletControl);
          rootNode.attachChild(bulletg);
          space.add(bulletControl);
        }
      }
    };
View Full Code Here

    floorGeometry.setLocalTranslation(0, -2, 0);

    // Plane plane = new Plane();
    // plane.setOriginNormal(new Vector3f(0, 0.25f, 0), Vector3f.UNIT_Y);
    // floorGeometry.addControl(new RigidBodyControl(new PlaneCollisionShape(plane), 0));
    floorGeometry.addControl(new RigidBodyControl(0));
    rootNode.attachChild(floorGeometry);
    space.add(floorGeometry);

    // movable boxes
    for (int i = 0; i < 12; i++) {
View Full Code Here

      Box box = new Box(0.25f, 0.25f, 0.25f);
      Geometry boxGeometry = new Geometry("Box", box);
      boxGeometry.setMaterial(material);
      boxGeometry.setLocalTranslation(i, 5, -3);
      // RigidBodyControl automatically uses box collision shapes when attached to single geometry with box mesh
      boxGeometry.addControl(new RigidBodyControl(2));
      rootNode.attachChild(boxGeometry);
      space.add(boxGeometry);
    }

    // immovable sphere with mesh collision shape
View Full Code Here

    // immovable sphere with mesh collision shape
    Sphere sphere = new Sphere(8, 8, 1);
    Geometry sphereGeometry = new Geometry("Sphere", sphere);
    sphereGeometry.setMaterial(material);
    sphereGeometry.setLocalTranslation(4, -4, 2);
    sphereGeometry.addControl(new RigidBodyControl(new MeshCollisionShape(sphere), 0));
    rootNode.attachChild(sphereGeometry);
    space.add(sphereGeometry);

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