Package com.jme.bounding

Examples of com.jme.bounding.BoundingBox


    this.getBatch( 0 ).setTextureBuffer( baseTextureBuffer, 0 );
    this.getBatch( 0 ).setIndexBuffer( index );
   
   
   
    this.setModelBound( new BoundingBox() );
    this.updateModelBound();
    this.updateWorldBound();
   
    TextureState ts = (TextureState) this.getRenderState( RenderState.RS_TEXTURE );
    if( ts == null ) {
View Full Code Here


    ts.setTexture( t0 );

    box = new Box( "box5", new Vector3f( -50, -2, -50 ), new Vector3f( 50, 2, 50 ) );
    box.setLocalTranslation( new Vector3f( 0, -15, 0 ) );
    box.setRenderState( ts );
    box.setModelBound( new BoundingBox() );
    box.updateModelBound();
    objects.attachChild( box );

    return objects;
  }
View Full Code Here

    ts.setTexture( t0 );

    box = new Box( "box5", new Vector3f( -50, -2, -50 ), new Vector3f( 50, 2, 50 ) );
    box.setLocalTranslation( new Vector3f( 0, -15, 0 ) );
    box.setRenderState( ts );
    box.setModelBound( new BoundingBox() );
    box.updateModelBound();
    objects.attachChild( box );

    return objects;
  }
View Full Code Here

    }

    public void batch() {
        // Create a TriMesh
        mesh = new TriMesh();
        mesh.setModelBound(new BoundingBox());

        // Create the batch's buffers
        mesh.setIndexBuffer(BufferUtils.createIntBuffer(creator.getNumIndices()));
        mesh.setVertexBuffer(BufferUtils.createVector3Buffer(creator.getNumVertices()));
        mesh.setNormalBuffer(BufferUtils.createVector3Buffer(creator.getNumVertices()));
View Full Code Here

                markerVertices.add(new Vector3f(-i * spacing, 0, size));
            }
        }
        Geometry regularGrid = new Line("regularLine", regularVertices.toArray(new Vector3f[] {}), null, null, null);
        regularGrid.getDefaultColor().set(new ColorRGBA(1, 1, 1, 0.05f));
        regularGrid.setModelBound(new BoundingBox());
        regularGrid.updateModelBound();
        lines.attachChild(regularGrid);
        Geometry markerGrid = new Line("markerLine", markerVertices.toArray(new Vector3f[] {}), null, null, null);
        markerGrid.getDefaultColor().set(new ColorRGBA(1, 1, 1, 0.1f));
        markerGrid.setModelBound(new BoundingBox());
        markerGrid.updateModelBound();
        lines.attachChild(markerGrid);
        if (rotation != null) lines.getLocalRotation().fromAngles(rotation.x, rotation.y, rotation.z);

        Node axis = new Node("axis");
        this.attachChild(axis);
        Vector3f xAxis = new Vector3f(size + (marker * spacing), 0, 0); // red
        Vector3f yAxis = new Vector3f(0, size + (marker * spacing), 0); // green
        Vector3f zAxis = new Vector3f(0, 0, size + (marker * spacing)); // blue
        Vector3f zero = new Vector3f();
        ColorRGBA red = new ColorRGBA(1, 0, 0, 0.8f);
        ColorRGBA green = new ColorRGBA(0, 1, 0, 0.8f);
        ColorRGBA blue = new ColorRGBA(0, 0, 1, 0.8f);
        Line lx = new Line("xAxis", new Vector3f[] { zero, xAxis }, null, new ColorRGBA[] { red, red }, null);
        Line ly = new Line("yAxis", new Vector3f[] { zero, yAxis }, null, new ColorRGBA[] { green, green }, null);
        Line lz = new Line("zAxis", new Vector3f[] { zero, zAxis }, null, new ColorRGBA[] { blue, blue }, null);
        lx.setModelBound(new BoundingBox());
        lx.updateModelBound();
        ly.setModelBound(new BoundingBox());
        ly.updateModelBound();
        lz.setModelBound(new BoundingBox());
        lz.updateModelBound();
        axis.attachChild(lx);
        axis.attachChild(ly);
        axis.attachChild(lz);

View Full Code Here

        // Scale the data
        Vector3f terrainScale = new Vector3f(10f,1f, 10f);

        tc = new TerrainContinuous("Terrain", terrainScale, false, cam);

        tc.setModelBound(new BoundingBox());
        tc.updateModelBound();
    }
View Full Code Here

  if (getRenderState(RenderState.RS_TEXTURE) == null) {
      TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
      ts.setTexture(texture);
      setRenderState(ts);
      setModelBound(new BoundingBox());
      updateModelBound();
  }

        FloatBuffer tbuf = BufferUtils.createVector2Buffer(4);
        setTextureCoords(new TexCoords(tbuf));
View Full Code Here

      if (faces[i] == null) {
    TriMesh mesh = new TriMesh();
    TextureState ts = DisplaySystem.getDisplaySystem().getRenderer().createTextureState();
    ts.setTexture(texture);
    mesh.setRenderState(ts);
    mesh.setModelBound(new BoundingBox());
    mesh.updateModelBound();
    faces[i] = mesh;
    attachChild(mesh);
      }
  }
View Full Code Here

     */
    GeometryNodeQuad (View2D view) {
        super(view);

        quad = new TexturedQuad(null, "TexturedQuad for Geometry Node of " + view.getName());
        quad.setModelBound(new BoundingBox());
        attachChild(quad);

        // Arbitrary; will be later changed
        setSize(1f, 1f);
        setTexCoords(1f, 1f);
View Full Code Here

     */
    @Override
    protected Spatial[] getSpatials() {
        if (quad == null) {
            quad = new Quad("FrameRect-Quad", width, height);
            quad.setModelBound(new BoundingBox());
            quad.updateModelBound();
        }
        return new Spatial[]{quad};
    }
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.