Class Direct3dRMLight
public class Direct3dRMLight implements IDirect3dRMLight
{
// Methods
public int getColor();
public float getConstantAttenuation();
public Direct3dRMFrame getEnableFrame();
public float getLinearAttenuation();
public float getPenumbra();
public float getQuadraticAttenuation();
public float getRange();
public int getType();
public float getUmbra();
public void setColor(int c);
public void setColorRGB(float r, float g, float b);
public void setConstantAttenuation(float atn);
public void setEnableFrame(Direct3dRMFrame f);
public void setLinearAttenuation(float atn);
public void setPenumbra(float p);
public void setQuadraticAttenuation(float atn);
public void setRange(float rng);
public void setType(int t);
public void setUmbra(float u);
}
Applications use the methods of the Direct3dRMLight class to interact with light objects.
The Direct3dRMLight class inherits the following methods from the Direct3dRMObject class:
- addDestroyCallback
- duplicate
- deleteDestroyCallback
- getAppData
- getClassName
- getName
- setAppData
- setName
The Direct3dRMLight object is obtained by calling the createLight or createLightRGB method.
public int getColor();
Retrieves the color of the current Direct3dRMLight object.
Return Value:
Returns the color.
See Also: setColor
public float getConstantAttenuation();
Retrieves the constant attenuation factor for the Direct3dRMLight object.
Return Value:
Returns the constant attenuation value.
Remarks:
The constant attenuation value affects the light intensity inversely. For example, a constant attenuation value of 2 reduces the intensity of the light by half.
See Also: setConstantAttenuation
public Direct3dRMFrame getEnableFrame();
Retrieves the enable frame for a light.
Return Value:
Returns the Direct3dRMFrame object if successful; otherwise, null.
See Also: setEnableFrame
public float getLinearAttenuation();
Retrieves the linear attenuation factor for a light.
Return Value:
Returns the linear attenuation value.
See Also: setLinearAttenuation
public float getPenumbra();
Retrieves the penumbra angle of a spotlight.
Return Value:
Returns the penumbra angle.
See Also: setPenumbra
public float getQuadraticAttenuation();
Retrieves the quadratic attenuation factor for a light.
Return Value:
Returns the quadratic attenuation value.
See Also: setQuadraticAttenuation
public float getRange();
Retrieves the range of the current Direct3dRMLight object.
Return Value:
Returns a value describing the range.
See Also: setRange
public int getType();
Retrieves the type of a given light.
Return Value:
Returns one value of light type.
See Also: setType
public float getUmbra();
Retrieves the umbra angle of the Direct3dRMLight object.
Return Value:
Returns The umbra angle.
See Also: setUmbra
public void setColor(int c);
Sets the color of the given light.
Return Value:
No return value.
Parameter | Description |
c
| The new color of the light.
|
See Also: getColor
public void setColorRGB(float r, float g, float b);
Sets the color of the given light.
Return Value:
No return value.
Parameter | Description |
r
| The red element of the new color of the light.
|
g
| The green element of the new color of the light.
|
b
| The blue element of the new color of the light.
|
public void setConstantAttenuation(float atn);
Sets the constant attenuation factor for a light.
Return Value:
No return value.
Parameter | Description |
atn
| The new attenuation factor.
|
Remarks:
The constant attenuation value affects the light intensity inversely. For example, a constant attenuation value of 2 reduces the intensity of the light by half.
See Also: getConstantAttenuation
public void setEnableFrame(Direct3dRMFrame f);
Sets the enable frame for a light.
Return Value:
No return value.
Parameter | Description |
f
| The Direct3dRMFrame object to be the light's enable frame. Child frames of this frame are also enabled for this light source.
|
See Also: getEnableFrame
public void setLinearAttenuation(float atn);
Sets the linear attenuation factor for a light.
Return Value:
No return value.
Parameter | Description |
atn
| The new attenuation factor.
|
See Also: getLinearAttenuation
public void setPenumbra(float p);
Sets the angle of the penumbra cone.
Return Value:
No return value.
Parameter | Description |
p
| The new penumbra angle. This angle must be greater than or equal to the angle of the umbra. If you set the penumbra angle to less than the umbra angle, the umbra angle will be set equal to the penumbra angle.
|
Remarks:
By default, the initial penumbra angle is 0.5 radians.
See Also: getPenumbra
public void setQuadraticAttenuation(float atn);
Sets the quadratic attenuation factor for a light.
Return Value:
No return value.
Parameter | Description |
atn
| The new attenuation factor.
|
See Also: getQuadraticAttenuation
public void setRange(float rng);
Sets the range of a light. The light affects only those objects within the range.
Return Value:
No return value.
Parameter | Description |
rng
| The new range.
|
Remarks:
By default, the initial range of light is 256.
See Also: getRange
public void setType(int t);
Changes the light type.
Return Value:
No return value.
Parameter | Description |
t
| The new light type.
|
See Also: getType
public void setUmbra(float u);
Sets the angle of the umbra cone.
Return Value:
No return value.
Parameter | Description |
u
| The new umbra angle. This angle must be less than or equal to the angle of the penumbra. If you set the umbra angle to greater than the penumbra angle, the penumbra angle will be set equal to the umbra angle.
|
Remarks:
By default, the initial umbra angle is 0.4 radians.
See Also: getUmbra