crystalspace.jbind.impl.engine.light
Class csLight

java.lang.Object
  extended bycrystalspace.jbind.impl.csNativeObject
      extended bycrystalspace.jbind.impl.csutil.scf.csBase
          extended bycrystalspace.jbind.impl.engine.light.csLight
All Implemented Interfaces:
iBase, iLight, iPointer

public class csLight
extends csBase
implements iLight

Author:
qan To change the template for this generated type comment go to Window>Preferences>Java>Code Generation>Code and Comments

Field Summary
 
Fields inherited from class crystalspace.jbind.impl.csNativeObject
ImplFactory, nPointer
 
Constructor Summary
csLight(iPointer nPointer)
           
 
Method Summary
 void addAffectedLightingInfo(iLightingInfo li)
          Add a mesh to this light.
 void calculateAttenuationVector(int atttype)
          Calculate the attenuation vector for a given attenuation type.
 void calculateAttenuationVector(int atttype, float radius)
          Calculate the attenuation vector for a given attenuation type.
 void calculateAttenuationVector(int atttype, float radius, float brightness)
          Calculate the attenuation vector for a given attenuation type.
 iCrossHalo createCrossHalo(float intensity, float cross)
          Create a cross halo for this light.
 iFlareHalo createFlareHalo()
          Create a flare halo for this light.
 iNovaHalo createNovaHalo(int seed, int num_spokes, float roundness)
          Create a nova halo for this light.
 int getAttenuation()
          Return current attenuation mode.
 csVector3 getAttenuationVector()
          Get attenuation vector csVector3(ant, linear, quadric);.
 float getBrightnessAtDistance(float d)
          Get the brightness of a light at a given distance.
 csVector3 getCenter()
          Get the position of this light.
 csColor getColor()
          Get the color of this light.
 boolean getDistanceForBrightness(float brightness, float distance)
          Get the distance for a given light brightness.
 int getDynamicType()
          Get the dynamic type of this light.
 csFlags getFlags()
          Get flags for this light.
 float getInfluenceRadius()
          Get the influence radius of the light.
 float getInfluenceRadiusSq()
          Get the squared influence radius of the light.
static java.lang.Class getInterfaceClass()
           
static java.lang.String getInterfaceName()
           
static int getInterfaceVersion()
           
 iLightCallback getLightCallback(int idx)
          Get the specified light callback.
 int getLightCallbackCount()
          Get the number of light callbacks.
 java.lang.String getLightID()
          Get the id of this light.
 int getLightNumber()
          Return a number that changes when the light changes (color, or position);.
 java.lang.String getName()
          Return the name of the interface
 iLight getNext()
          Get the next dynamic light in the list. @ TEMPORARY. @ Implemented in csLight::Light, and csIsoFakeLight.
 iSector getSector()
          Get the sector for this light.
 int getVersion()
          Return the version of the interface
static void initSCF()
           
protected  boolean isNativePointerValidSafe()
           
 iObject queryObject()
          Get the iObject for this light.
 void removeAffectedLightingInfo(iLightingInfo li)
          Remove a mesh from this light.
 void removeLightCallback(iLightCallback cb)
          Remove a light callback.
 void setAttenuation(int a)
          Set attenuation mode.
 void setAttenuationVector(csVector3 attenv)
          Set attenuation vector csVector3(ant, linear, quadric); FIXME: examples.
 void setCenter(csVector3 pos)
          Set the position of this light.
 void setColor(csColor col)
          Set the color of this light.
 void setInfluenceRadius(float radius)
          Override the influence radius.
 void setLightCallback(iLightCallback cb)
          Set the light callback.
 void setup()
          For a dynamic light you need to call this to do the actual lighting calculations.
 
Methods inherited from class crystalspace.jbind.impl.csutil.scf.csBase
decRef, equals, finalize, getRefCount, incRef, nDelete, queryInterface, queryInterfaceSafe
 
Methods inherited from class crystalspace.jbind.impl.csNativeObject
changePointer, getPointer, getPointer, getPointerArray, hashCode, isMemoryOwner, isNativePointerValid, isNativePointerValidSafe, newNativeObject, setMemoryOwner, toString
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getRefCount, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Constructor Detail

csLight

public csLight(iPointer nPointer)
Parameters:
nPointer -
Method Detail

getVersion

public int getVersion()
Description copied from interface: iBase
Return the version of the interface

Specified by:
getVersion in interface iBase
Specified by:
getVersion in class csBase

getName

public java.lang.String getName()
Description copied from interface: iBase
Return the name of the interface

Specified by:
getName in interface iBase
Specified by:
getName in class csBase

initSCF

public static void initSCF()

getInterfaceVersion

public static int getInterfaceVersion()

getInterfaceName

public static java.lang.String getInterfaceName()

getInterfaceClass

public static java.lang.Class getInterfaceClass()

isNativePointerValidSafe

protected boolean isNativePointerValidSafe()

addAffectedLightingInfo

public void addAffectedLightingInfo(iLightingInfo li)
Description copied from interface: iLight
Add a mesh to this light. This is usually called during Setup(); by meshes that are hit by the light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
addAffectedLightingInfo in interface iLight
Parameters:
li -
See Also:
iLight.addAffectedLightingInfo(crystalspace.jbind.interfaces.imesh.lighting.iLightingInfo)

calculateAttenuationVector

public void calculateAttenuationVector(int atttype,
                                       float radius,
                                       float brightness)
Description copied from interface: iLight
Calculate the attenuation vector for a given attenuation type. Parameters: atttype Attenuation type ant - CS_ATTN_NONE, CS_ATTN_INVERSE, CS_ATTN_REALISTIC radius Radius where the light is brightness bright brightness Brightness of the light at radius Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
calculateAttenuationVector in interface iLight
Parameters:
atttype -
radius -
brightness -
See Also:
iLight.calculateAttenuationVector(int, float, float)

calculateAttenuationVector

public void calculateAttenuationVector(int atttype,
                                       float radius)
Description copied from interface: iLight
Calculate the attenuation vector for a given attenuation type. Parameters: atttype Attenuation type ant - CS_ATTN_NONE, CS_ATTN_INVERSE, CS_ATTN_REALISTIC radius Radius where the light is brightness bright brightness Brightness of the light at radius Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
calculateAttenuationVector in interface iLight
Parameters:
atttype -
radius -
See Also:
iLight.calculateAttenuationVector(int, float)

calculateAttenuationVector

public void calculateAttenuationVector(int atttype)
Description copied from interface: iLight
Calculate the attenuation vector for a given attenuation type. Parameters: atttype Attenuation type ant - CS_ATTN_NONE, CS_ATTN_INVERSE, CS_ATTN_REALISTIC radius Radius where the light is brightness bright brightness Brightness of the light at radius Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
calculateAttenuationVector in interface iLight
Parameters:
atttype -
See Also:
iLight.calculateAttenuationVector(int)

createCrossHalo

public iCrossHalo createCrossHalo(float intensity,
                                  float cross)
Description copied from interface: iLight
Create a cross halo for this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
createCrossHalo in interface iLight
Parameters:
intensity -
cross -
Returns:
See Also:
iLight.createCrossHalo(float, float)

createFlareHalo

public iFlareHalo createFlareHalo()
Description copied from interface: iLight
Create a flare halo for this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
createFlareHalo in interface iLight
Returns:
See Also:
iLight.createFlareHalo()

createNovaHalo

public iNovaHalo createNovaHalo(int seed,
                                int num_spokes,
                                float roundness)
Description copied from interface: iLight
Create a nova halo for this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
createNovaHalo in interface iLight
Parameters:
seed -
num_spokes -
roundness -
Returns:
See Also:
iLight.createNovaHalo(int, int, float)

getAttenuation

public int getAttenuation()
Description copied from interface: iLight
Return current attenuation mode. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getAttenuation in interface iLight
Returns:
See Also:
iLight.getAttenuation()

getAttenuationVector

public csVector3 getAttenuationVector()
Description copied from interface: iLight
Get attenuation vector csVector3(ant, linear, quadric);. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getAttenuationVector in interface iLight
Returns:
See Also:
iLight.getAttenuationVector()

getBrightnessAtDistance

public float getBrightnessAtDistance(float d)
Description copied from interface: iLight
Get the brightness of a light at a given distance. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getBrightnessAtDistance in interface iLight
Parameters:
d -
Returns:
See Also:
iLight.getBrightnessAtDistance(float)

getCenter

public csVector3 getCenter()
Description copied from interface: iLight
Get the position of this light. Implemented in csLight::Light, and csIsoFakeLight. Referenced by csLightingPolyTexQueue::FinalizeLighting();.

Specified by:
getCenter in interface iLight
Returns:
See Also:
iLight.getCenter()

getColor

public csColor getColor()
Description copied from interface: iLight
Get the color of this light. Implemented in csLight::Light, and csIsoFakeLight. Referenced by csLightingPolyTexQueue::FinalizeLighting();.

Specified by:
getColor in interface iLight
Returns:
See Also:
iLight.getColor()

getDistanceForBrightness

public boolean getDistanceForBrightness(float brightness,
                                        float distance)
Description copied from interface: iLight
Get the distance for a given light brightness. Returns: Returns whether the distance could be calculated. E.g. when attenuation vector only has a ant part. distance is unaltered in this case. Remarks: Might fail when brightness <= 0. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getDistanceForBrightness in interface iLight
Parameters:
brightness -
distance -
Returns:
See Also:
iLight.getDistanceForBrightness(float, float)

getDynamicType

public int getDynamicType()
Description copied from interface: iLight
Get the dynamic type of this light. Supported types: CS_LIGHT_DYNAMICTYPE_STATIC CS_LIGHT_DYNAMICTYPE_PSEUDO CS_LIGHT_DYNAMICTYPE_DYNAMIC Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getDynamicType in interface iLight
Returns:
See Also:
iLight.getDynamicType()

getFlags

public csFlags getFlags()
Description copied from interface: iLight
Get flags for this light. Supported flags: CS_LIGHT_ACTIVEHALO CS_LIGHT_THINGSHADOWS Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getFlags in interface iLight
Returns:
See Also:
iLight.getFlags()

getInfluenceRadius

public float getInfluenceRadius()
Description copied from interface: iLight
Get the influence radius of the light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getInfluenceRadius in interface iLight
Returns:
See Also:
iLight.getInfluenceRadius()

getInfluenceRadiusSq

public float getInfluenceRadiusSq()
Description copied from interface: iLight
Get the squared influence radius of the light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getInfluenceRadiusSq in interface iLight
Returns:
See Also:
iLight.getInfluenceRadiusSq()

getLightCallback

public iLightCallback getLightCallback(int idx)
Description copied from interface: iLight
Get the specified light callback. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getLightCallback in interface iLight
Parameters:
idx -
Returns:
See Also:
iLight.getLightCallback(int)

getLightCallbackCount

public int getLightCallbackCount()
Description copied from interface: iLight
Get the number of light callbacks. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getLightCallbackCount in interface iLight
Returns:
See Also:
iLight.getLightCallbackCount()

getLightID

public java.lang.String getLightID()
Description copied from interface: iLight
Get the id of this light. This is a 16-byte MD5. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getLightID in interface iLight
Returns:
See Also:
iLight.getLightID()

getLightNumber

public int getLightNumber()
Description copied from interface: iLight
Return a number that changes when the light changes (color, or position);. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getLightNumber in interface iLight
Returns:
See Also:
iLight.getLightNumber()

getNext

public iLight getNext()
Description copied from interface: iLight
Get the next dynamic light in the list. @ TEMPORARY. @ Implemented in csLight::Light, and csIsoFakeLight. Referenced by csLight::Light::GetNext();.

Specified by:
getNext in interface iLight
Returns:
See Also:
iLight.getNext()

getSector

public iSector getSector()
Description copied from interface: iLight
Get the sector for this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
getSector in interface iLight
Returns:
See Also:
iLight.getSector()

queryObject

public iObject queryObject()
Description copied from interface: iLight
Get the iObject for this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
queryObject in interface iLight
Returns:
See Also:
iLight.queryObject()

removeAffectedLightingInfo

public void removeAffectedLightingInfo(iLightingInfo li)
Description copied from interface: iLight
Remove a mesh from this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
removeAffectedLightingInfo in interface iLight
Parameters:
li -
See Also:
iLight.removeAffectedLightingInfo(crystalspace.jbind.interfaces.imesh.lighting.iLightingInfo)

removeLightCallback

public void removeLightCallback(iLightCallback cb)
Description copied from interface: iLight
Remove a light callback. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
removeLightCallback in interface iLight
Parameters:
cb -
See Also:
iLight.removeLightCallback(crystalspace.jbind.interfaces.iengine.light.iLightCallback)

setAttenuation

public void setAttenuation(int a)
Description copied from interface: iLight
Set attenuation mode. The following values are possible (default is CS_ATTN_LINEAR);: CS_ATTN_NONE: light 1 CS_ATTN_LINEAR: light (radius - distance); / radius CS_ATTN_INVERSE: light (radius / distance); CS_ATTN_REALISTIC: light (radius^2 / distance^2); CS_ATTN_CLQ: use attenuation vector Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setAttenuation in interface iLight
Parameters:
a -
See Also:
iLight.setAttenuation(int)

setAttenuationVector

public void setAttenuationVector(csVector3 attenv)
Description copied from interface: iLight
Set attenuation vector csVector3(ant, linear, quadric); FIXME: examples. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setAttenuationVector in interface iLight
Parameters:
attenv -
See Also:
iLight.setAttenuationVector(crystalspace.jbind.impl.csgeom.vector3.csVector3)

setCenter

public void setCenter(csVector3 pos)
Description copied from interface: iLight
Set the position of this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setCenter in interface iLight
Parameters:
pos -
See Also:
iLight.setCenter(crystalspace.jbind.impl.csgeom.vector3.csVector3)

setColor

public void setColor(csColor col)
Description copied from interface: iLight
Set the color of this light. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setColor in interface iLight
Parameters:
col -
See Also:
iLight.setColor(crystalspace.jbind.impl.csutil.cscolor.csColor)

setInfluenceRadius

public void setInfluenceRadius(float radius)
Description copied from interface: iLight
Override the influence radius. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setInfluenceRadius in interface iLight
Parameters:
radius -
See Also:
iLight.setInfluenceRadius(float)

setLightCallback

public void setLightCallback(iLightCallback cb)
Description copied from interface: iLight
Set the light callback. This will call IncRef(); on the callback So make sure you call DecRef(); to release your own reference. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setLightCallback in interface iLight
Parameters:
cb -
See Also:
iLight.setLightCallback(crystalspace.jbind.interfaces.iengine.light.iLightCallback)

setup

public void setup()
Description copied from interface: iLight
For a dynamic light you need to call this to do the actual lighting calculations. Implemented in csLight::Light, and csIsoFakeLight.

Specified by:
setup in interface iLight
See Also:
iLight.setup()