crystalspace.jbind.interfaces.iengine.light
Interface iLight

All Superinterfaces:
iBase, iPointer
All Known Implementing Classes:
csLight

public interface iLight
extends iBase

The iLight interface is the SCF interface for the csLight class. First some terminology about all the several types of lights that Crystal Space supports: * Static light. This is a normal static light that cannot move and cannot change intensity/color. All lighting information from all static lights is collected in one static lightmap. * Pseudo-dynamic light. This is a static light that still cannot move but the intensity/color can change. The shadow information from every pseudo-dynamic light is kept in a separate shadow-map. Shadowing is very accurate with pseudo-dynamic lights since they use the same algorithm as static lights. * Dynamic light. This is a light that can move and change intensity/color. These lights are the most flexible. All lighting information from all dynamic lights is collected in one dynamic lightmap (separate from the pseudo-dynamic shadow-maps). Shadows for dynamic lights will be less accurate because things will not cast accurate shadows (due to computation speed limitations).

Author:
Java wrapper - Quentin Anciaux, c++ version - http://crystal.sourceforge.net/docs/online/devapi/structiLight.php

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.
 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);.
 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.
 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 interface crystalspace.jbind.interfaces.iutil.scf.iBase
decRef, getName, getRefCount, getVersion, incRef, queryInterface, queryInterfaceSafe
 
Methods inherited from interface crystalspace.jbind.interfaces.iPointer
changePointer, getPointer, isMemoryOwner, setMemoryOwner
 

Method Detail

addAffectedLightingInfo

public void addAffectedLightingInfo(iLightingInfo li)
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.

Parameters:
li -

calculateAttenuationVector

public void calculateAttenuationVector(int atttype)
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.

Parameters:
atttype -

calculateAttenuationVector

public void calculateAttenuationVector(int atttype,
                                       float radius)
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.

Parameters:
atttype -
radius -

calculateAttenuationVector

public void calculateAttenuationVector(int atttype,
                                       float radius,
                                       float brightness)
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.

Parameters:
atttype -
radius -
brightness -

createCrossHalo

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

Parameters:
intensity -
cross -
Returns:

createFlareHalo

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

Returns:

createNovaHalo

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

Parameters:
seed -
num_spokes -
roundness -
Returns:

getAttenuation

public int getAttenuation()
Return current attenuation mode. Implemented in csLight::Light, and csIsoFakeLight.

Returns:

getAttenuationVector

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

Returns:

getBrightnessAtDistance

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

Parameters:
d -
Returns:

getCenter

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

Returns:

getColor

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

Returns:

getDistanceForBrightness

public boolean getDistanceForBrightness(float brightness,
                                        float distance)
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.

Parameters:
brightness -
distance -
Returns:

getDynamicType

public int getDynamicType()
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.

Returns:

getFlags

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

Returns:

getInfluenceRadius

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

Returns:

getInfluenceRadiusSq

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

Returns:

getLightCallback

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

Parameters:
idx -
Returns:

getLightCallbackCount

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

Returns:

getLightID

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

Returns:

getLightNumber

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

Returns:

getNext

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

Returns:

getSector

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

Returns:

queryObject

public iObject queryObject()
Get the iObject for this light. Implemented in csLight::Light, and csIsoFakeLight.

Returns:

removeAffectedLightingInfo

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

Parameters:
li -

removeLightCallback

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

Parameters:
cb -

setAttenuation

public void setAttenuation(int a)
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.

Parameters:
a -

setAttenuationVector

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

Parameters:
attenv -

setCenter

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

Parameters:
pos -

setColor

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

Parameters:
col -

setInfluenceRadius

public void setInfluenceRadius(float radius)
Override the influence radius. Implemented in csLight::Light, and csIsoFakeLight.

Parameters:
radius -

setLightCallback

public void setLightCallback(iLightCallback cb)
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.

Parameters:
cb -

setup

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