Exemplo n.º 1
0
  public void draw(ShaderProgram program, BoundingFrustum frustum) {
    program.reset();

    final Matrix matrix = getModelMatrix();
    final LWJGLModel3D model = (LWJGLModel3D) getModel();
    for (final Group g : model.getGroups()) {
      for (final IBufferObject ib : g.getBuffers()) {
        BufferObject b = (BufferObject) ib;
        final BoundingSphere sph = TEMP_SPHERE_DRAW.set(b);
        sph.add(matrix.getTranslation());
        if (frustum.contains(sph) != ContainmentType.Disjoint) {
          b.bind(program);
          program.setModelMatrix(matrix);
          b.draw(program);
        }
      }
    }
  }