Package com.jme.bounding

Examples of com.jme.bounding.BoundingBox


     */
    @Override
    protected Spatial[] getSpatials() {
        if (quad == null) {
            quad = new TexturedQuad(texture, "FrameTexRect-Quad", width, height);
            quad.setModelBound(new BoundingBox());
            quad.updateModelBound();
        }
        return new Spatial[]{quad};
    }
View Full Code Here


        // unfortunately, we don't know the pixel scale at this point so, out of
        // desparation, we choose the default value of 0.01 meters per pixel.
        // This gives values of approx. A radius of 10 x 10 for the local width and height
        // of the bounds. 5 meters (in front) should be reasonable for the depth because the
        // step per window stack level is only 0.01 meter and the stack never gets too large.
        super(new BoundingBox(new Vector3f(), 10, 10, 5), new CellTransform(null, null));
    }
View Full Code Here

                new ConeOfSilenceCellServerState();

  cellServerState.setName("ConeOfSilence");

        // Give the hint for the bounding volume for initial Cell placement
        BoundingBox box = new BoundingBox(new Vector3f(), 2f, 0f, 2f);
     
  BoundingVolumeHint hint = new BoundingVolumeHint(true, box);
  cellServerState.setBoundingVolumeHint(hint);

        return (T) cellServerState;
View Full Code Here

        float radius = 0.25f;

        if (selectedForInput) {      
            Spatial collisionGraph = new Sphere("AvatarCollision", origin, 10, 10, radius);
           
            collisionGraph.setModelBound(new BoundingBox());
            collisionGraph.updateModelBound();

            // Fetch the JME Collision system using the server manager of the Cell
            // to which this renderer is attached.
            ServerSessionManager manager =
View Full Code Here

      if (boundsType.equals(COSBoundsType.CELL_BOUNDS)) {
    boundingVolume[0] = cellRef.get().getLocalBounds();
    logger.warning("COS Using cell local bounds:  " + boundingVolume[0]);
    System.out.println("COS Using cell local bounds:  " + boundingVolume[0]);
      } else if (boundsType.equals(COSBoundsType.BOX)) {
                boundingVolume[0] = new BoundingBox(new Vector3f(), bounds.getX(),
        bounds.getY(), bounds.getZ());
    logger.warning("COS Using specified BOX:  " + boundingVolume[0]);
    System.out.println("COS Using specified BOX:  " + boundingVolume[0]);
      } else {
                boundingVolume[0] = new BoundingSphere(bounds.getX(), new Vector3f());
View Full Code Here

      boundsViewerEntity.showBounds(editor.getCell().getLocalBounds());
  } else if (specifyRadiusRadioButton.isSelected()) {
      boundsViewerEntity.showBounds(new BoundingSphere(
    (Float) fullVolumeRadiusModel.getValue(), new Vector3f()));
  } else {
      boundsViewerEntity.showBounds(new BoundingBox(new Vector3f(),
    (Float) xExtentModel.getValue(),
    (Float) yExtentModel.getValue(),
    (Float) zExtentModel.getValue()));
  }
    }
View Full Code Here

  spatializer.setAttenuator(volume);
  return spatializer;
    }

    private Spatializer getSpatializer(BoundingBox bounds) {
  BoundingBox boundingBox = (BoundingBox) bounds;

  Vector3f center = boundingBox.getCenter();
  Vector3f extent = boundingBox.getExtent(null);

  double lowerLeftX = center.getX() - extent.getX();
        double lowerLeftY = center.getY() - extent.getY();
  double lowerLeftZ = center.getZ() - extent.getZ();
View Full Code Here

              BufferUtils.createFloatBuffer(normals),
              null, null,BufferUtils.createIntBuffer(indexes));
     
     
     
      mesh.setModelBound(new BoundingBox());
      mesh.updateModelBound();
     
      tankNode = new Node("TankNode");
      tankTurret = new Node("tankTurret");
        tankTurretBarrel = new Cylinder("tankTurretBarrel", 16, 16, .1f, BARREL_LENGTH );
        tankTurretBarrel.setModelBound(new BoundingBox());
        tankTurretBarrel.updateModelBound();

        tankTurretBarrel.setLocalTranslation(barrelPosition);
        tankTurret.attachChild(tankTurretBarrel);
        //tankTurret.attachChild(dome);
View Full Code Here

        Vector3f terrainScale = new Vector3f(4, 0.1575f, 4);
        // create a terraiwblock
         tb = new TerrainBlock("Terrain", heightMap.getSize(), terrainScale,
                heightMap.getHeightMap(), new Vector3f(0, 0, 0), false);
        //tb.setLocalTranslation(new Vector3f(-20, -60, -20));
        tb.setModelBound(new BoundingBox());
        tb.updateModelBound();

        // generate a terrain texture with 2 textures
        ProceduralTextureGenerator pt = new ProceduralTextureGenerator(
                heightMap);
View Full Code Here

      // start.  Also, set the size, color and bounding box of the bullet.
      Box box = new Box("position"+t, new Vector3f(-.5f, -.5f, -.5f), new Vector3f(.5f, .5f, .5f));
      box.setLocalTranslation(new Vector3f(xe, Yb, ze));
      box.setLocalScale(3f);
    box.setDefaultColor(ColorRGBA.red);
    box.setModelBound(new BoundingBox());
    box.updateModelBound();
   
    // Create a node for the missle trajectory.  This makes it possible to apply
    // a light state to the bullets.  Now that I think of it, this could probably
    // be removed by applying the LightState to the getRootNode()... but I don't really
View Full Code Here

TOP

Related Classes of com.jme.bounding.BoundingBox

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.