KudanAR - Android  1.6.0
ARLightMaterial Class Reference

Inherits ARMaterial.

Public Member Functions

 ARLightMaterial ()
 
void setColour (float r, float g, float b)
 
Vector3f getColour ()
 
void setDiffuse (float r, float g, float b)
 
Vector3f getDiffuse ()
 
void setAmbient (float r, float g, float b)
 
Vector3f getAmbient ()
 
void setSpecular (float r, float g, float b)
 
Vector3f getSpecular ()
 
void setShininess (float shininess)
 
float getShininess ()
 
float getAlpha ()
 
void setAlpha (float alpha)
 
void setReflectivity (float reflectivity)
 
float getReflectivity ()
 
void setTexture (ARTexture2D texture)
 
void setCubeTexture (ARTexture3D cubeTexture)
 
boolean prepareRendererWithNode (ARNode node)
 
- Public Member Functions inherited from ARMaterial
boolean getTransparent ()
 
void setTransparent (boolean transparent)
 
boolean getDepthOnly ()
 
void setDepthOnly (boolean depthOnly)
 
void setDepthWrite (boolean depthWrite)
 
boolean getDepthWrite ()
 
void setDepthTest (boolean depthTest)
 
boolean getDepthTest ()
 
void setName (String name)
 
String getName ()
 

Detailed Description

An ARLightMaterial is a material for shading using dynamic lighting. This is most commonly used with 3D models.

Example of use:

ARLightMaterial lightMaterial = new ARLightMaterial();
lightMaterial.setColour(0.882, 0.125, 0.250);
lightMaterial.setDiffuse(0.3, 0.4, 0.5);
lightMaterial.setAmbient(0.2, 0.2, 0.2);

Constructor & Destructor Documentation

◆ ARLightMaterial()

ARLightMaterial.ARLightMaterial ( )

Initialise an empty ARLightMaterial.

Member Function Documentation

◆ getAlpha()

float ARLightMaterial.getAlpha ( )

Returns the transparancy of this material. 1.0f for fully opaque objetcs. 0.0f for fully transparent objects.

Returns
The transparency of this material in the 0..1 range. 1 means no transparency is used.

◆ getAmbient()

Vector3f ARLightMaterial.getAmbient ( )

Returns the ambient component of lighting applied to this material. Represents a solid colour unaffected by other lighting in the scene.

Example of use:

Vector3f materialAmbient = lightMaterial.getAmbient();
Returns
The ambient lighting applied to this material.

◆ getColour()

Vector3f ARLightMaterial.getColour ( )

Returns the base colour of the material represented as RGB values in the 0..1 range stored in a Vector3f. If there is a texture set on this material then the colour will not be used.

Returns
The base colour of the material.

◆ getDiffuse()

Vector3f ARLightMaterial.getDiffuse ( )

Sets the diffuse component of lighting applied to this material. The lighting on the surface decreases as the angle between it and the light decreases. The lighting depends only on this angle, and does not change as objects move around.

Example of use:

Vector3f materialDiffuse = lightMaterial.getDiffuse();
Returns
The diffuse lighting applied to this material.

◆ getReflectivity()

float ARLightMaterial.getReflectivity ( )

Returns the reflectivity of this material. 0.0 is no reflectivity. 1.0 is full reflectivity.

Returns
The reflectivity of this material in the 0..1 range.

◆ getShininess()

float ARLightMaterial.getShininess ( )

Returns the shininess factor that affects the amount of specular light reflected by this material. Higher values result in a smaller and brighter specular highlight, while low values have a larger but less bright highlight. Ranges from 1..100.

Returns
The shininess of this material.

◆ getSpecular()

Vector3f ARLightMaterial.getSpecular ( )

Returns the specular component of lighting applied to this material. A specular highlight is dependent on the surface angle, light angle, and viewing angle. The highlight is actually just a real-time suitable way to simulate blurred reflections of a light source. The level of blur for the highlight is controlled with the shininess property. Represents the reflection of light at the reflection angle from an incident light source.

Returns
The specular lighting applied to this material.

◆ prepareRendererWithNode()

boolean ARLightMaterial.prepareRendererWithNode ( ARNode  node)

Prepares renderer to draw material.

Parameters
nodeThe node attached to the material.
Returns
true.

Reimplemented from ARMaterial.

◆ setAlpha()

void ARLightMaterial.setAlpha ( float  alpha)

Sets the alpha value of an ARLightMaterial.

Parameters
alpha

◆ setAmbient()

void ARLightMaterial.setAmbient ( float  r,
float  g,
float  b 
)

Sets the colour of the ambient lighting using R, G, B floats.

Parameters
rRed value.
gGreen value.
bBlue value.

◆ setColour()

void ARLightMaterial.setColour ( float  r,
float  g,
float  b 
)

Sets the base colour of the material using RGB values in the 0..1 range.

Example of use:

lightMaterial.setColour(0.882f, 0.125f, 0.250f);
Parameters
rThe red component of the colour.
gThe green component of the colour.
bThe blue component of the colour.

◆ setCubeTexture()

void ARLightMaterial.setCubeTexture ( ARTexture3D  cubeTexture)

Sets the environment map for this material. The environment map is a texture cube that simulates the environment surrounding the material. It must be assigned a cube map for reflection to occur.

Parameters
cubeTextureThe environment map to be used for reflectivity.

◆ setDiffuse()

void ARLightMaterial.setDiffuse ( float  r,
float  g,
float  b 
)

Sets the colour of the diffuse lighting using R, G, B floats.

Parameters
r
g
b

◆ setReflectivity()

void ARLightMaterial.setReflectivity ( float  reflectivity)

Set the reflectivity of a material. This determines how much of the environment cube is reflected off the material.

Parameters
reflectivity

◆ setShininess()

void ARLightMaterial.setShininess ( float  shininess)

Sets the shininess of an ARLightMaterial.

Parameters
shininess

◆ setSpecular()

void ARLightMaterial.setSpecular ( float  r,
float  g,
float  b 
)

Sets the colour of the specular lighting using R,G,B floats.

Parameters
rRed value.
gGreen value.
bBlue value.

◆ setTexture()

void ARLightMaterial.setTexture ( ARTexture2D  texture)

Sets the texture of an ARLightMaterial.

Parameters
texture

The documentation for this class was generated from the following file: