Packages
 In this topic

*Methods

 

Packages   PreviousThis PackageNext
Package com.ms.directX   Previous This
Package
Next

 


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.

Methods

getColor

public int getColor();

Retrieves the color of the current Direct3dRMLight object.

Return Value:

Returns the color.

See Also: setColor

getConstantAttenuation

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

getEnableFrame

public Direct3dRMFrame getEnableFrame();

Retrieves the enable frame for a light.

Return Value:

Returns the Direct3dRMFrame object if successful; otherwise, null.

See Also: setEnableFrame

getLinearAttenuation

public float getLinearAttenuation();

Retrieves the linear attenuation factor for a light.

Return Value:

Returns the linear attenuation value.

See Also: setLinearAttenuation

getPenumbra

public float getPenumbra();

Retrieves the penumbra angle of a spotlight.

Return Value:

Returns the penumbra angle.

See Also: setPenumbra

getQuadraticAttenuation

public float getQuadraticAttenuation();

Retrieves the quadratic attenuation factor for a light.

Return Value:

Returns the quadratic attenuation value.

See Also: setQuadraticAttenuation

getRange

public float getRange();

Retrieves the range of the current Direct3dRMLight object.

Return Value:

Returns a value describing the range.

See Also: setRange

getType

public int getType();

Retrieves the type of a given light.

Return Value:

Returns one value of light type.

See Also: setType

getUmbra

public float getUmbra();

Retrieves the umbra angle of the Direct3dRMLight object.

Return Value:

Returns The umbra angle.

See Also: setUmbra

setColor

public void setColor(int c);

Sets the color of the given light.

Return Value:

No return value.

ParameterDescription
c The new color of the light.

See Also: getColor

setColorRGB

public void setColorRGB(float r, float g, float b);

Sets the color of the given light.

Return Value:

No return value.

ParameterDescription
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.

setConstantAttenuation

public void setConstantAttenuation(float atn);

Sets the constant attenuation factor for a light.

Return Value:

No return value.

ParameterDescription
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

setEnableFrame

public void setEnableFrame(Direct3dRMFrame f);

Sets the enable frame for a light.

Return Value:

No return value.

ParameterDescription
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

setLinearAttenuation

public void setLinearAttenuation(float atn);

Sets the linear attenuation factor for a light.

Return Value:

No return value.

ParameterDescription
atn The new attenuation factor.

See Also: getLinearAttenuation

setPenumbra

public void setPenumbra(float p);

Sets the angle of the penumbra cone.

Return Value:

No return value.

ParameterDescription
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

setQuadraticAttenuation

public void setQuadraticAttenuation(float atn);

Sets the quadratic attenuation factor for a light.

Return Value:

No return value.

ParameterDescription
atn The new attenuation factor.

See Also: getQuadraticAttenuation

setRange

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.

ParameterDescription
rng The new range.

Remarks:

By default, the initial range of light is 256.

See Also: getRange

setType

public void setType(int t);

Changes the light type.

Return Value:

No return value.

ParameterDescription
t The new light type.

See Also: getType

setUmbra

public void setUmbra(float u);

Sets the angle of the umbra cone.

Return Value:

No return value.

ParameterDescription
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

upnrm.gif © 1998 Microsoft Corporation. All rights reserved. Terms of use.