com.visioglobe.libVisioDevKit
Class VgLight

java.lang.Object
  extended by com.visioglobe.libVisioDevKit.VgReferenced
      extended by com.visioglobe.libVisioDevKit.VgLight

public class VgLight
extends VgReferenced

This interface handles light management.

Note:
Currently only supported on OpenGL ES2.

Field Summary
 
Fields inherited from class com.visioglobe.libVisioDevKit.VgReferenced
swigCMemOwn, swigRefPtr
 
Constructor Summary
VgLight(long cPtr, boolean cMemoryOwn)
          This constructor initializes an useless empty light
 
Method Summary
 void delete()
           
 VgAnimationRefPtr editAnimation(java.lang.String pName)
          Gets an animation from the light's animation map for editing.
 VgColor getAmbient()
           
 VgAnimationConstRefPtr getAnimation(java.lang.String pName)
          Gets an animation from the light's animation map.
 void getAnimationNames(VgStringList pNameList)
          Gets the list of the stored animation names.
static long getCPtr(VgLight obj)
           
 VgColor getDiffuse()
           
 VgColor getEmission()
           
 VgOrientation getOrientation()
          Gets lights's orientation.
 VgPosition getPosition()
          Gets light's position.
 VgColor getSpecular()
           
 double getSpotCutoff()
           
 double getSpotExponent()
           
 boolean isDirectional()
          Tell if the light is directional.
 void setAmbient(VgColor pColor)
          Sets the ambient light color for the light.
 void setAnimation(java.lang.String pAnimationName, VgAnimationRefPtr pAnimation)
          Sets an animation on this light.
 void setDiffuse(VgColor pColor)
          Sets the diffuse light color for the light.
 void setDirectional(boolean pDirectional)
          Sets the light to be directional.
 void setEmission(VgColor pColor)
          Sets the emission light color for the light.
 void setOrientation(VgOrientation pOrientation)
          Sets the light's orientation.
 void setPosition(VgPosition pPosition)
          Sets the light's position.
 void setSpecular(VgColor pColor)
          Sets the specular light color for the light.
 void setSpotCutoff(double pCutoff)
          Sets the current spot cutoff value.
 void setSpotExponent(double pExponent)
           
 
Methods inherited from class com.visioglobe.libVisioDevKit.VgReferenced
finalize, getCPtr, getNbReferences, ref, unref
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VgLight

public VgLight(long cPtr,
               boolean cMemoryOwn)
This constructor initializes an useless empty light

Method Detail

getCPtr

public static long getCPtr(VgLight obj)

delete

public void delete()
Overrides:
delete in class VgReferenced

setAnimation

public void setAnimation(java.lang.String pAnimationName,
                         VgAnimationRefPtr pAnimation)
Sets an animation on this light. As of version 2.0.8744, multiple animations can be set (and played) on a light at the same time. This is the reason why a name has to be provided along with the animation. If an animation already exists in the light with that name, the new one will replace the old one (and the previous one will one less reference to it).

Parameters:
pAnimationName - The name to associate the animation with in this spatial
pAnimation - An animation to animate the spatial with.

getAnimation

public VgAnimationConstRefPtr getAnimation(java.lang.String pName)
Gets an animation from the light's animation map.

Parameters:
pName - The name of the animation to fetch.
Returns:
A const reference pointer that is valid if an animation exists by that name in this light.

editAnimation

public VgAnimationRefPtr editAnimation(java.lang.String pName)
Gets an animation from the light's animation map for editing.

Parameters:
pName - The name of the animation to fetch.
Returns:
A reference pointer that is valid if an animation exists by that name in this light.

getAnimationNames

public void getAnimationNames(VgStringList pNameList)
Gets the list of the stored animation names.

Parameters:
pNameList - The list of strings to feed with the names.

getPosition

public VgPosition getPosition()
Gets light's position.

Returns:
The light's position. This value is ignored if the light is set to be directional.

setPosition

public void setPosition(VgPosition pPosition)
Sets the light's position.

Parameters:
pPosition - The position to put the light at. This value is ignored if the light is set to be directional

getOrientation

public VgOrientation getOrientation()
Gets lights's orientation.

Returns:
The light's orientation. This value is only valid if the spot cut-off is different than -1.0.

setOrientation

public void setOrientation(VgOrientation pOrientation)
Sets the light's orientation.

Parameters:
pOrientation - The orientation to set on the light. This value is only valid if the spot cut-off is different than -1.0.

getAmbient

public VgColor getAmbient()

setAmbient

public void setAmbient(VgColor pColor)
Sets the ambient light color for the light.

Parameters:
pColor - Ambient light color to set

getDiffuse

public VgColor getDiffuse()

setDiffuse

public void setDiffuse(VgColor pColor)
Sets the diffuse light color for the light.

Parameters:
pColor - Diffuse light color to set

getSpecular

public VgColor getSpecular()

setSpecular

public void setSpecular(VgColor pColor)
Sets the specular light color for the light.

Parameters:
pColor - Specular light color to set

getEmission

public VgColor getEmission()

setEmission

public void setEmission(VgColor pColor)
Sets the emission light color for the light.

Parameters:
pColor - Emission light color to set

getSpotCutoff

public double getSpotCutoff()

setSpotCutoff

public void setSpotCutoff(double pCutoff)
Sets the current spot cutoff value. Valid values are between -1.0 and 1.0 inclusive. Higher values means smaller spot angle.

Parameters:
pCutoff - Diffuse light color to set

getSpotExponent

public double getSpotExponent()

setSpotExponent

public void setSpotExponent(double pExponent)

isDirectional

public boolean isDirectional()
Tell if the light is directional. When a light is directional, every point in the scene is lit along the same direction. The same principle as the light coming from the sun, where all rays are parallel.

Returns:
true If the light is directional.

setDirectional

public void setDirectional(boolean pDirectional)
Sets the light to be directional.

Parameters:
pDirectional - True to set the light to be directional

VisioDevKit 2.0, Visioglobe® 2013