Search in sources :

Example 16 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class AABBNearFarAnalyzer method analyze.

@Override
public <T extends RenderableProvider> void analyze(BaseLight light, Camera camera, Iterable<T> renderableProviders) {
    getRenderables(renderableProviders);
    prepareCamera(camera);
    bb1.inf();
    for (Renderable renderable : renderables) {
        renderable.worldTransform.getTranslation(tmpV);
        tmpV.add(renderable.meshPart.center);
        if (camera.frustum.sphereInFrustum(tmpV, renderable.meshPart.radius)) {
            bb1.ext(tmpV, renderable.meshPart.radius);
        }
    }
    computeResult(bb1, camera);
    renderablesPool.flush();
    renderables.clear();
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable)

Example 17 with Renderable

use of com.badlogic.gdx.graphics.g3d.Renderable in project libgdx by libgdx.

the class RenderableShapeBuilder method buildNormals.

/** Builds normal, tangent and binormal of a RenderableProvider.
	 * @param builder
	 * @param renderableProvider
	 * @param vectorSize Size of the normal vector
	 * @param normalColor Normal vector's color
	 * @param tangentColor Tangent vector's color
	 * @param binormalColor Binormal vector's color */
public static void buildNormals(MeshPartBuilder builder, RenderableProvider renderableProvider, float vectorSize, Color normalColor, Color tangentColor, Color binormalColor) {
    renderableProvider.getRenderables(renderables, renderablesPool);
    for (Renderable renderable : renderables) {
        buildNormals(builder, renderable, vectorSize, normalColor, tangentColor, binormalColor);
    }
    renderablesPool.flush();
    renderables.clear();
}
Also used : Renderable(com.badlogic.gdx.graphics.g3d.Renderable)

Aggregations

Renderable (com.badlogic.gdx.graphics.g3d.Renderable)17 Material (com.badlogic.gdx.graphics.g3d.Material)8 ModelBuilder (com.badlogic.gdx.graphics.g3d.utils.ModelBuilder)5 PerspectiveCamera (com.badlogic.gdx.graphics.PerspectiveCamera)3 Model (com.badlogic.gdx.graphics.g3d.Model)3 ModelInstance (com.badlogic.gdx.graphics.g3d.ModelInstance)3 ColorAttribute (com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute)3 AssetManager (com.badlogic.gdx.assets.AssetManager)2 Mesh (com.badlogic.gdx.graphics.Mesh)2 Pixmap (com.badlogic.gdx.graphics.Pixmap)2 Texture (com.badlogic.gdx.graphics.Texture)2 SpriteBatch (com.badlogic.gdx.graphics.g2d.SpriteBatch)2 Environment (com.badlogic.gdx.graphics.g3d.Environment)2 ModelBatch (com.badlogic.gdx.graphics.g3d.ModelBatch)2 Shader (com.badlogic.gdx.graphics.g3d.Shader)2 DirectionalLight (com.badlogic.gdx.graphics.g3d.environment.DirectionalLight)2 PointLight (com.badlogic.gdx.graphics.g3d.environment.PointLight)2 CameraInputController (com.badlogic.gdx.graphics.g3d.utils.CameraInputController)2 DefaultTextureBinder (com.badlogic.gdx.graphics.g3d.utils.DefaultTextureBinder)2 RenderContext (com.badlogic.gdx.graphics.g3d.utils.RenderContext)2