Class Skybox


  • public class Skybox
    extends java.lang.Object
    Skybox

    When added to a Scene, the Skybox fills all untouched pixels.

    Creation and destruction

    A Skybox object is created using the Skybox.Builder and destroyed by calling Engine.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 only Texture based sky boxes are supported.
    See Also:
    Scene, IndirectLight
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Skybox.Builder
      Use Builder to construct a Skybox object instance.
    • Constructor Summary

      Constructors 
      Constructor Description
      Skybox​(long nativeSkybox)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float getIntensity()
      Returns the Skybox's intensity in lux, or lumen/m^2.
      int getLayerMask()  
      long getNativeObject()  
      Texture getTexture()  
      void setColor​(float[] color)
      Mutates the Skybox's constant color.
      void setColor​(float r, float g, float b, float a)
      Mutates the Skybox's constant color.
      void setLayerMask​(int select, int values)
      Sets bits in a visibility mask.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Skybox

        public Skybox​(long nativeSkybox)
    • Method Detail

      • setColor

        public void setColor​(float r,
                             float g,
                             float b,
                             float a)
        Mutates the Skybox's constant color. Ignored if an environment is set.
      • setColor

        public void setColor​(@NonNull @Size(min=4L)
                             float[] color)
        Mutates the Skybox'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 is 0x1.

        This provides a simple mechanism for hiding or showing this Skybox in a Scene.

        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 affect
        values - 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 the Skybox'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()