Package com.jme3.font

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


        BitmapText vertId = new BitmapText(guiFont);
        vertId.setSize(.1f);
        vertId.setText("x0, y0, z0");
        vertId.setName("Gridlabel - x0, y0, z0");
        vertId.setLocalTranslation(pos);
        vertId.addControl(bc.cloneForSpatial(vertId));
        labelNode.attachChild(vertId);

        for (int x = 1; x < offset; x++) {
            pos.set(x, 0, 0);
            vertId = new BitmapText(guiFont);
View Full Code Here


        try {
          // trows an Exception if lod is not supported
          modelGeom.setLodLevel(0);

          LodControl control = new LodControl();
          modelGeom.addControl(control);
        } catch (Exception e) {}
        assetLogger.modelFinished();
        camNode.detachAllChildren();
        camNode.attachChild(model);
        return null;
View Full Code Here

        Box b = new Box(Vector3f.ZERO, 1, 1, 1);
        Geometry g = new Geometry("b", b);
        BoxCollisionShape boxCollisionShape = new BoxCollisionShape(new Vector3f(1, 1, 1));
        g.setMaterial(new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md" ));
        g.addControl(new RigidBodyControl(boxCollisionShape, 1));
        g.getControl(RigidBodyControl.class).setKinematic(true);
        bulletAppState.getPhysicsSpace().add(g);
        rootNode.attachChild(g);

        Geometry g1 = g.clone(false);
View Full Code Here

        g.getControl(RigidBodyControl.class).setKinematic(true);
        bulletAppState.getPhysicsSpace().add(g);
        rootNode.attachChild(g);

        Geometry g1 = g.clone(false);
        g1.addControl(new RigidBodyControl(boxCollisionShape, 1));
        g1.getControl(RigidBodyControl.class).setKinematic(true);
        bulletAppState.getPhysicsSpace().add(g1);
        rootNode.attachChild(g1);

        bulletAppState.getPhysicsSpace().enableDebug(assetManager);
View Full Code Here

    float dimension = SECTION_LENGTH * numJoints * 2.3f;
    Box floorBox = new Box(dimension, .5f, dimension);
    Geometry floorGeometry = new Geometry("Floor", floorBox);
    floorGeometry.setMaterial(material);
    floorGeometry.setLocalTranslation(0, -1.0f * HEAD_RADIUS - .5f, 0);
    floorGeometry.addControl(new RigidBodyControl(0));
    localRootNode.attachChild(floorGeometry);

    pivots = new Node[numJoints];
    sections = new Geometry[numJoints];
    joints = new Geometry[numJoints];
View Full Code Here

    floor_geo.setMaterial(floor_mat);
    floor_geo.setLocalTranslation(0, -0.1f, 0);
    this.rootNode.attachChild(floor_geo);
    /* Make the floor physical with mass 0.0f! */
    floor_phy = new RigidBodyControl(0.0f);
    floor_geo.addControl(floor_phy);
    bulletAppState.getPhysicsSpace().add(floor_phy);
  }

  /** This loop builds a wall out of individual bricks. */
  public void initWall() {
View Full Code Here

    /** Position the brick geometry */
    brick_geo.setLocalTranslation(loc);
    /** Make brick physical with a mass > 0.0f. */
    brick_phy = new RigidBodyControl(2f);
    /** Add physical brick to physics space. */
    brick_geo.addControl(brick_phy);
    bulletAppState.getPhysicsSpace().add(brick_phy);
  }

  /**
   * This method creates one individual physical cannon ball. By defaul, the ball is accelerated and flies from the camera position in the camera direction.
View Full Code Here

    /** Position the cannon ball */
    ball_geo.setLocalTranslation(cam.getLocation());
    /** Make the ball physcial with a mass > 0.0f */
    ball_phy = new RigidBodyControl(1f);
    /** Add physical ball to physics space. */
    ball_geo.addControl(ball_phy);
    bulletAppState.getPhysicsSpace().add(ball_phy);
    /** Accelerate the physcial ball to shoot it. */
    ball_phy.setLinearVelocity(cam.getDirection().mult(25));
  }

View Full Code Here

  public void onAction(String name, boolean isPressed, float tpf) {
    if (name.equals("Shoot") && !isPressed) {
      Geometry shot = makeSphere("shot", 0.2f);

      shot.setLocalTranslation(cam.getDirection());
      shot.addControl(new ShotController(1f, 0.01f, cam.getDirection()));
      rootNode.attachChild(shot);
      shot.setCullHint(CullHint.Never);
    }

  }
View Full Code Here

    rootNode.attachChild(southWallGeom);
    physicsSpace.add(southWallGeom);
    eastWallGeom.addControl(new RigidBodyControl(0));
    rootNode.attachChild(eastWallGeom);
    physicsSpace.add(eastWallGeom);
    westWallGeom.addControl(new RigidBodyControl(0));
    rootNode.attachChild(westWallGeom);
    physicsSpace.add(westWallGeom);

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