org.rajawali3d.vr.materials / HotspotMaterial

HotspotMaterial

open class HotspotMaterial : Material

Author
dennis.ippel

Constructors

<init>

HotspotMaterial(useTexture: Boolean)
HotspotMaterial(useTexture: Boolean, discardAlpha: Boolean)

Inherited Properties

mCustomFragmentShader

var mCustomFragmentShader: FragmentShader!

mCustomVertexShader

var mCustomVertexShader: VertexShader!

mLights

var mLights: MutableList<ALight!>!

The lights that affect the material. Lights shouldn't be managed by any other class than Scene. To add lights to a scene call Scene#addLight(ALight)

mNormalFloats

val mNormalFloats: FloatArray!

Contains the normal matrix. The normal matrix is used in the shaders to transform the normal into eye space.

mNormalMatrix

var mNormalMatrix: Matrix4!

Scratch normal matrix. The normal matrix is used in the shaders to transform the normal into eye space.

mOwnerIdentity

var mOwnerIdentity: String!

This texture's unique owner identity String. This is usually the fully qualified name of the Renderer instance.

mPlugins

var mPlugins: MutableList<IMaterialPlugin!>!

A list of material plugins that are used by this material. A material plugin is basically a class that contains a vertex shader fragment and a fragment shader fragment. Material plugins can be used for custom shader effects.

mTextureHandles

var mTextureHandles: MutableMap<String!, Int!>!

mTextureList

var mTextureList: ArrayList<ATexture!>!

The list of textures that are assigned by this materials.

Functions

getProgress

open fun getProgress(): Float

setBorderThickness

open fun setBorderThickness(borderThickness: Float): Unit

setCircleCenter

open fun setCircleCenter(center: Vector2!): Unit

setCircleRadius

open fun setCircleRadius(circleRadius: Float): Unit

setProgress

open fun setProgress(progress: Float): Unit

setProgressColor

open fun setProgressColor(color: Int): Unit

setTextureRotationSpeed

open fun setTextureRotationSpeed(textureRotationSpeed: Float): Unit

setTrackColor

open fun setTrackColor(color: Int): Unit

Inherited Functions

addPlugin

open fun addPlugin(plugin: IMaterialPlugin!): Unit

Add a material plugin. A material plugin is basically a class that contains a vertex shader fragment and a fragment shader fragment. Material plugins can be used for custom shader effects.

addTexture

open fun addTexture(texture: ATexture!): Unit

Adds a texture to this material. Throws and error if the maximum number of textures was reached.

applyParams

open fun applyParams(): Unit

Applies parameters that should be set on the shaders. These are parameters like time, color, buffer handles, etc.

bindTextureByName

open fun bindTextureByName(index: Int, texture: ATexture!): Unit
open fun bindTextureByName(name: String!, index: Int, texture: ATexture!): Unit

bindTextures

open fun bindTextures(): Unit

Binds the textures to an OpenGL texturing target. Called every frame by Scene#render(long, double, org.rajawali3d.renderer.RenderTarget). Shouldn't be called manually.

copyTexturesTo

open fun copyTexturesTo(material: Material!): Unit

Copies this material's textures to another material.

createShaders

open fun createShaders(): Unit

Takes all material parameters and creates the vertex shader and fragment shader and then compiles the program. This method should only be called on initialization or when parameters have changed.

enableLighting

open fun enableLighting(value: Boolean): Unit

Indicates whether lighting should be used or not. This must be set to true when using a DiffuseMethod or a SpecularMethod. Lights are added to a scene Scene and are automatically added to the material.

enableTime

open fun enableTime(value: Boolean): Unit

Indicates that the time shader parameter should be used. This is used when creating shaders that should change during the course of time. This is used to accomplish effects like animated vertices, vertex colors, plasma effects, etc. The time needs to be manually updated using the Material#setTime(float) method.

getAmbientColor

open fun getAmbientColor(): Int

Returns this material's ambient color. Ambient color is the color of an object where it is in shadow.

getColor

open fun getColor(): Int

Returns this material's diffuse color.

getColorInfluence

open fun getColorInfluence(): Float

Indicates the color influence. Use .5 for 50% color influence, .75 for 75% color influence, etc.

getDiffuseMethod

open fun getDiffuseMethod(): IDiffuseMethod!

The diffuse method specifies the reflection of light from a surface such that an incident ray is reflected at many angles rather than at just one angle as in the case of specular reflection. This can be set using the setDiffuseMethod() method:


      material.setDiffuseMethod(new DiffuseMethod.Lambert());
      

getInverseViewMatrix

open fun getInverseViewMatrix(): FloatArray!

Returns the inverse view matrix. The inverse view matrix is used to transform reflections.

getModelViewMatrix

open fun getModelViewMatrix(): FloatArray!

Returns the model view matrix. The model view matrix is used to transform vertices to eye coordinates.

getOwnerIdentity

open fun getOwnerIdentity(): String!

getPlugin

open fun getPlugin(pluginClass: Class<*>!): IMaterialPlugin!

Get a material plugin by using its class type. A material plugin is basically a class that contains a vertex shader fragment and a fragment shader fragment. Material plugins can be used for custom shader effects.

getSpecularMethod

open fun getSpecularMethod(): ISpecularMethod!

The specular method specifies the mirror-like reflection of light (or of other kinds of wave) from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. This can be set using the setSpecularMethod() method:


      material.setSpecularMethod(new SpecularMethod.Phong());
      

getTextureList

open fun getTextureList(): ArrayList<ATexture!>!

Gets a list of textures bound to this material.

getTime

open fun getTime(): Float

Sets the time value that is used in the shaders to create animated effects.

lightingEnabled

open fun lightingEnabled(): Boolean

Indicates whether lighting should be used or not. This must be set to true when using a DiffuseMethod or a SpecularMethod. Lights are added to a scene Scene and are automatically added to the material.

onPreFragmentShaderInitialize

open fun onPreFragmentShaderInitialize(fragmentShader: FragmentShader): Unit

Called prior to FragmentShader#initialize() being called when creating auto-generated materials.

onPreVertexShaderInitialize

open fun onPreVertexShaderInitialize(vertexShader: VertexShader): Unit

Called prior to VertexShader#initialize() being called when creating auto-generated materials.

removePlugin

open fun removePlugin(plugin: IMaterialPlugin!): Unit

Remove a material plugin. A material plugin is basically a class that contains a vertex shader fragment and a fragment shader fragment. Material plugins can be used for custom shader effects.

removeTexture

open fun removeTexture(texture: ATexture!): Unit

Removes a texture from this material.

setAmbientColor

open fun setAmbientColor(color: Int): Unit
open fun setAmbientColor(color: FloatArray!): Unit

This material's ambient color. Ambient color is the color of an object where it is in shadow.

setAmbientIntensity

open fun setAmbientIntensity(r: Double, g: Double, b: Double): Unit
open fun setAmbientIntensity(r: Float, g: Float, b: Float): Unit

This material's ambient intensity for the r, g, b channels.

setColor

open fun setColor(color: Int): Unit
open fun setColor(color: FloatArray!): Unit

The material's diffuse color. This can be overwritten by Object3D#setColor(int). This color will be applied to the whole object. For vertex colors use Material#useVertexColors(boolean) and Material#setVertexColors(int).

setColorInfluence

open fun setColorInfluence(influence: Float): Unit

The color influence indicates how big the influence of the color is. This should be used in conjunction with ATexture#setInfluence(float). A value of .5 indicates an influence of 50%. This examples shows how to use 50% color and 50% texture:

setCurrentObject

open fun setCurrentObject(currentObject: Object3D!): Unit

setDiffuseMethod

open fun setDiffuseMethod(diffuseMethod: IDiffuseMethod!): Unit

The diffuse method specifies the reflection of light from a surface such that an incident ray is reflected at many angles rather than at just one angle as in the case of specular reflection. This can be set using the setDiffuseMethod() method:


      material.setDiffuseMethod(new DiffuseMethod.Lambert());
      

setInverseViewMatrix

open fun setInverseViewMatrix(inverseViewMatrix: Matrix4!): Unit

Sets the inverse view matrix. The inverse view matrix is used to transform reflections

setLights

open fun setLights(lights: MutableList<ALight!>!): Unit

The lights that affect the material. Lights shouldn't be managed by any other class than Scene. To add lights to a scene call

setModelMatrix

open fun setModelMatrix(modelMatrix: Matrix4!): Unit

Sets the model matrix. The model matrix holds the object's local coordinates.

setModelViewMatrix

open fun setModelViewMatrix(modelViewMatrix: Matrix4!): Unit

Sets the model view matrix. The model view matrix is used to transform vertices to eye coordinates

setMVPMatrix

open fun setMVPMatrix(mvpMatrix: Matrix4!): Unit

Sets the model view projection matrix. The model view projection matrix is used to transform vertices to screen coordinates.

setNormals

open fun setNormals(normalBufferHandle: Int): Unit
open fun setNormals(bufferInfo: BufferInfo!): Unit

Set the normal buffer handle. This is passed to VertexShader#setNormals(int)

setOwnerIdentity

open fun setOwnerIdentity(identity: String!): Unit

setSpecularMethod

open fun setSpecularMethod(specularMethod: ISpecularMethod!): Unit

The specular method specifies the mirror-like reflection of light (or of other kinds of wave) from a surface, in which light from a single incoming direction (a ray) is reflected into a single outgoing direction. This can be set using the setSpecularMethod() method:


      material.setSpecularMethod(new SpecularMethod.Phong());
      

setTextureCoords

open fun setTextureCoords(textureCoordBufferHandle: Int): Unit
open fun setTextureCoords(bufferInfo: BufferInfo!): Unit

Set the texture coordinates buffer handle. This is passed to VertexShader#setTextureCoords(int)

setTextureHandleForName

open fun setTextureHandleForName(name: String): Unit

setTime

open fun setTime(time: Float): Unit

Sets the time value that is used in the shaders to create animated effects.

setVertexColors

open fun setVertexColors(vertexColorBufferHandle: Int): Unit
open fun setVertexColors(bufferInfo: BufferInfo!): Unit

Set the vertex color buffer handle. This is passed to VertexShader#setVertexColors(int)

setVertices

open fun setVertices(vertexBufferHandle: Int): Unit
open fun setVertices(bufferInfo: BufferInfo!): Unit

Set the vertex buffer handle. This is passed to VertexShader#setVertices(int)

timeEnabled

open fun timeEnabled(): Boolean

Indicates that the time shader parameter should be used. This is used when creating shaders that should change during the course of time. This is used to accomplish effects like animated vertices, vertex colors, plasma effects, etc. The time needs to be manually updated using the Material#setTime(float) method.

unbindTextures

open fun unbindTextures(): Unit

Unbinds the texture from an OpenGL texturing target.

unsetCurrentObject

open fun unsetCurrentObject(currentObject: Object3D!): Unit

useProgram

open fun useProgram(): Unit

Tells the OpenGL context to use this program. This should be called every frame.

useVertexColors

open fun useVertexColors(value: Boolean): Unit

Indicates that this material should use a color value for every vertex. These colors are contained in a separate color buffer.

usingVertexColors

open fun usingVertexColors(): Boolean

Indicates that this material should use a color value for every vertex. These colors are contained in a separate color buffer.