Package com.google.android.filament
Class Skybox
- java.lang.Object
-
- com.google.android.filament.Skybox
-
public class Skybox extends java.lang.ObjectSkyboxWhen added to a
Scene, theSkyboxfills all untouched pixels.Creation and destruction
ASkyboxobject is created using theSkybox.Builderand destroyed by callingEngine.destroySkybox(com.google.android.filament.Skybox).
Engine engine = Engine.create(); Scene scene = engine.createScene(); Skybox skybox = new Skybox.Builder() .environment(cubemap) .build(engine); scene.setSkybox(skybox);Currently onlyTexturebased sky boxes are supported.- See Also:
Scene,IndirectLight
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSkybox.BuilderUseBuilderto construct aSkyboxobject instance.
-
Constructor Summary
Constructors Constructor Description Skybox(long nativeSkybox)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatgetIntensity()Returns theSkybox's intensity in lux, or lumen/m^2.intgetLayerMask()longgetNativeObject()TexturegetTexture()voidsetColor(float[] color)Mutates theSkybox's constant color.voidsetColor(float r, float g, float b, float a)Mutates theSkybox's constant color.voidsetLayerMask(int select, int values)Sets bits in a visibility mask.
-
-
-
Method Detail
-
setColor
public void setColor(float r, float g, float b, float a)Mutates theSkybox's constant color. Ignored if an environment is set.
-
setColor
public void setColor(@NonNull @Size(min=4L) float[] color)Mutates theSkybox's constant color. Ignored if an environment is set.- Parameters:
color- an array of 4 floats
-
setLayerMask
public void setLayerMask(@IntRange(from=0L,to=255L) int select, @IntRange(from=0L,to=255L) int values)Sets bits in a visibility mask. By default, this is0x1.This provides a simple mechanism for hiding or showing this
Skyboxin aScene.For example, to set bit 1 and reset bits 0 and 2 while leaving all other bits unaffected, call:
setLayerMask(7, 2).- Parameters:
select- the set of bits to affectvalues- the replacement values for the affected bits- See Also:
View.setVisibleLayers(int, int)
-
getLayerMask
public int getLayerMask()
- Returns:
- the visibility mask bits
-
getIntensity
public float getIntensity()
Returns theSkybox's intensity in lux, or lumen/m^2.
-
getTexture
@Nullable public Texture getTexture()
- Returns:
- the associated texture, or null if it does not exist
-
getNativeObject
public long getNativeObject()
-
-