com.io7m.r2.core

## Class R2LightSphericalSingle

- java.lang.Object
- - com.io7m.r2.core.R2LightSphericalSingle

- All Implemented Interfaces:
    R2LightReadableType, R2LightSingleReadableType, R2LightSingleType, R2LightSingleWritableType, R2LightSphericalReadableType, R2LightSphericalSingleReadableType, R2LightSphericalSingleType, R2LightSphericalSingleWritableType, R2LightSphericalWritableType, R2LightVolumeSingleReadableType, R2LightVolumeSingleType, R2LightVolumeSingleWritableType, R2LightWritableType

      public final class R2LightSphericalSingle
      extends Object
      implements R2LightSphericalSingleType

  Parameters for simple spherical lights that operate by rendering scaled unit spheres.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `com.io7m.jcanephora.core.JCGLArrayObjectUsableType` | `arrayObject()`
    `com.io7m.jtensors.parameterized.PVector3FType<R2SpaceRGBType>` | `color()`
    `com.io7m.jtensors.parameterized.PVector3FType<R2SpaceRGBType>` | `colorWritable()`
    `float` | `falloff()`
    `float` | `geometryScaleFactor()`
    `float` | `intensity()`
    `long` | `lightID()`
    `static R2LightSphericalSingleType` | `newLight(R2UnitSphereUsableType in_sphere, R2IDPoolType in_pool)` Construct a new light.
    `com.io7m.jtensors.parameterized.PVectorReadable3FType<R2SpaceWorldType>` | `originPosition()`
    `com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType>` | `originPositionWritable()`
    `float` | `radius()`
    `void` | `setFalloff(float f)` Set the light falloff exponent
    `void` | `setGeometryScaleFactor(float f)` Set the geometry scale factor.
    `void` | `setIntensity(float i)` Set the current light intensity
    `void` | `setRadius(float r)` Set the light radius in world-space units.
    `R2TransformReadableType` | `transform()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.io7m.r2.core.R2LightSphericalSingleReadableType

      `matchLightVolumeSingleReadable`

    - ### Methods inherited from interface com.io7m.r2.core.R2LightVolumeSingleType

      `matchLightSingle`

- - ### Method Detail

    - #### newLight

          public static R2LightSphericalSingleType newLight(R2UnitSphereUsableType in_sphere,
                                                            R2IDPoolType in_pool)

      Construct a new light.
      Parameters:
        `in_sphere` - The light volume
        `in_pool` - The ID pool
      Returns:
        A new light

    - #### radius

          public float radius()

      Specified by:
        `radius` in interface `R2LightSphericalReadableType`
      Returns:
        The light radius

    - #### setRadius

          public void setRadius(float r)

      Description copied from interface: `R2LightSphericalWritableType`
      Set the light radius in world-space units.
      Specified by:
        `setRadius` in interface `R2LightSphericalWritableType`
      Parameters:
        `r` - The light radius

    - #### falloff

          public float falloff()

      Specified by:
        `falloff` in interface `R2LightSphericalReadableType`
      Returns:
        The light falloff exponent

    - #### setFalloff

          public void setFalloff(float f)

      Description copied from interface: `R2LightSphericalWritableType`
      Set the light falloff exponent
      Specified by:
        `setFalloff` in interface `R2LightSphericalWritableType`
      Parameters:
        `f` - The light falloff

    - #### color

          public com.io7m.jtensors.parameterized.PVector3FType<R2SpaceRGBType> color()

      Specified by:
        `color` in interface `R2LightReadableType`
      Returns:
        The readable light color

    - #### intensity

          public float intensity()

      Specified by:
        `intensity` in interface `R2LightReadableType`
      Returns:
        The current light intensity

    - #### setIntensity

          public void setIntensity(float i)

      Description copied from interface: `R2LightWritableType`
      Set the current light intensity
      Specified by:
        `setIntensity` in interface `R2LightWritableType`
      Parameters:
        `i` - The intensity (typically `[0.0 .. 1.0]`)

    - #### colorWritable

          public com.io7m.jtensors.parameterized.PVector3FType<R2SpaceRGBType> colorWritable()

      Specified by:
        `colorWritable` in interface `R2LightWritableType`
      Returns:
        The readable/writable light color

    - #### originPosition

          public com.io7m.jtensors.parameterized.PVectorReadable3FType<R2SpaceWorldType> originPosition()

      Specified by:
        `originPosition` in interface `R2LightSphericalReadableType`
      Returns:
        The position of the origin of the light in world-space

    - #### arrayObject

          public com.io7m.jcanephora.core.JCGLArrayObjectUsableType arrayObject()

      Specified by:
        `arrayObject` in interface `R2LightSingleReadableType`
      Returns:
        The array object that will be used to render the light geometry

    - #### lightID

          public long lightID()

      Specified by:
        `lightID` in interface `R2LightReadableType`
      Returns:
        The unique light ID

    - #### transform

          public R2TransformReadableType transform()

      Specified by:
        `transform` in interface `R2LightSingleReadableType`
      Returns:
        The transform for the light origin

    - #### originPositionWritable

          public com.io7m.jtensors.parameterized.PVector3FType<R2SpaceWorldType> originPositionWritable()

      Specified by:
        `originPositionWritable` in interface `R2LightSphericalSingleWritableType`
      Returns:
        The position of the origin of the light in world-space

    - #### geometryScaleFactor

          public float geometryScaleFactor()

      Specified by:
        `geometryScaleFactor` in interface `R2LightSphericalSingleReadableType`
      Returns:
        The scale factor for the light volume geometry
      See Also:
        `R2LightSphericalSingleWritableType.setGeometryScaleFactor(float)`

    - #### setGeometryScaleFactor

          public void setGeometryScaleFactor(float f)

      Description copied from interface: `R2LightSphericalSingleWritableType`
      Set the geometry scale factor. The final rendered scale of the light volume geometry is given by `R2LightSphericalReadableType.radius()` * `f`. This is used to artificially enlarge the light volume to account for, for example, the fact that a low-polygon approximation of a sphere will typically have a smaller volume than a real sphere would.
      Specified by:
        `setGeometryScaleFactor` in interface `R2LightSphericalSingleWritableType`
      Parameters:
        `f` - The scale factor

Copyright © 2017 <code@io7m.com> http://io7m.com