WaterMaterial


class WaterMaterial : Material


A Material which implements a water effect.

Summary

Public companion functions

ListenableFuture<WaterMaterial>
@MainThread
create(session: Session, isAlphaMapVersion: Boolean)

Public factory function for a WaterMaterial, where the material is asynchronously loaded.

Public functions

Unit

Disposes the given water material resource.

Unit

Sets the alpha map for the alpha map version of the water material.

Unit
@MainThread
setAlphaStepMultiplier(alphaStepMultiplier: Float)

Sets the alpha step multiplier for the alpha map version of the water material.

Unit

Sets the normal boundary for the alpha map version of the water material.

Unit

Sets the normal map texture for the water material.

Unit

Sets the normal speed for the water material.

Unit

Sets the normal tiling for the water material.

Unit

Sets the normal z for the alpha map version of the water material.

Unit

Sets the reflection cube texture for the water material.

Public companion functions

create

Added in 1.0.0-alpha04
@MainThread
fun create(session: Session, isAlphaMapVersion: Boolean): ListenableFuture<WaterMaterial>

Public factory function for a WaterMaterial, where the material is asynchronously loaded.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
session: Session

The Session to use for loading the model.

isAlphaMapVersion: Boolean

If the water material should be the alpha map version or not.

Returns
ListenableFuture<WaterMaterial>

a ListenableFuture. Listeners will be called on the main thread if Runnable::run is supplied.

Public functions

dispose

Added in 1.0.0-alpha04
@MainThread
fun dispose(): Unit

Disposes the given water material resource.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Currently, a glTF model (which this material will be used with) can't be disposed. This means that calling dispose on the material will lead to a crash if the call is made out of order, that is, if the material is disposed before the glTF model that uses it.

setAlphaMap

Added in 1.0.0-alpha04
@MainThread
fun setAlphaMap(alphaMap: Texture): Unit

Sets the alpha map for the alpha map version of the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
alphaMap: Texture

The alpha map.

Throws
kotlin.IllegalStateException

if the water material is not the alpha map version.

setAlphaStepMultiplier

Added in 1.0.0-alpha04
@MainThread
fun setAlphaStepMultiplier(alphaStepMultiplier: Float): Unit

Sets the alpha step multiplier for the alpha map version of the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
alphaStepMultiplier: Float

The alpha step multiplier.

Throws
kotlin.IllegalStateException

if the water material is not the alpha map version.

setNormalBoundary

Added in 1.0.0-alpha04
@MainThread
fun setNormalBoundary(normalBoundary: Float): Unit

Sets the normal boundary for the alpha map version of the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
normalBoundary: Float

The normal boundary.

Throws
kotlin.IllegalStateException

if the water material is not the alpha map version.

setNormalMap

Added in 1.0.0-alpha04
@MainThread
fun setNormalMap(normalMap: Texture): Unit

Sets the normal map texture for the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
normalMap: Texture

The Texture to be used as the normal map.

setNormalSpeed

Added in 1.0.0-alpha04
@MainThread
fun setNormalSpeed(normalSpeed: Float): Unit

Sets the normal speed for the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
normalSpeed: Float

The speed of the normal map.

setNormalTiling

Added in 1.0.0-alpha04
@MainThread
fun setNormalTiling(normalTiling: Float): Unit

Sets the normal tiling for the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
normalTiling: Float

The tiling of the normal map.

setNormalZ

Added in 1.0.0-alpha04
@MainThread
fun setNormalZ(normalZ: Float): Unit

Sets the normal z for the alpha map version of the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
normalZ: Float

The normal z.

Throws
kotlin.IllegalStateException

if the water material is not the alpha map version.

setReflectionCube

Added in 1.0.0-alpha04
@MainThread
fun setReflectionCube(reflectionCube: CubeMapTexture): Unit

Sets the reflection cube texture for the water material.

This method must be called from the main thread. https://developer.android.com/guide/components/processes-and-threads

Parameters
reflectionCube: CubeMapTexture

The CubeMapTexture to be used as the reflection cube.