Package com.ms.com.directX Previous
Previous
Microsoft Packages
Microsoft Packages
Index
Index
Next
Next

Class d3drmLight

Applications use the methods of the d3drmLight class to interact with light objects.

public class d3drmLight implements Id3drmLight
{
  public void InternalSetObject(IUnknown lpdd);
  public IUnknown InternalGetObject();
  public void AddDestroyCallback(Id3drmCallback fn, IUnknown Arg);
  public void DeleteDestroyCallback(Id3drmCallback fn, IUnknown args);
  public d3drmLight Clone();
  public void SetAppData(int data);
  public int GetAppData();
  public void SetName(String name);
  public String GetName();
  public String GetClassName();
  public void SetType(int t);
  public void SetColor(int c);
  public void SetColorRGB(float r, float g, float b);
  public void SetRange(float rng);
  public void SetUmbra(float u);
  public void SetPenumbra(float p);
  public void SetConstantAttenuation(float atn);
  public void SetLinearAttenuation(float atn);
  public void SetQuadraticAttenuation(float atn);
  public float GetRange();
  public float GetUmbra();
  public float GetPenumbra();
  public float GetConstantAttenuation();
  public float GetLinearAttenuation();
  public float GetQuadraticAttenuation();
  public int GetColor();
  public int GetType();
  public void SetEnableFrame(d3drmFrame f);
  public d3drmFrame GetEnableFrame();
}

The methods can be organized into the following groups:
Attenuation GetConstantAttenuation
GetLinearAttenuation
GetQuadraticAttenuation
SetConstantAttenuation
SetLinearAttenuation
SetQuadraticAttenuation
Color GetColor
SetColor
SetColorRGB
Enable frames GetEnableFrame
SetEnableFrame
Light types GetType
SetType
Range GetRange
SetRange
Spotlight options GetPenumbra
GetUmbra
SetPenumbra
SetUmbra

In addition, the d3drmLight class inherits the following methods from the d3drmObject class:
AddDestroyCallback
Clone
DeleteDestroyCallback
GetAppData
GetClassName
GetName
SetAppData
SetName

The d3drmLight object is obtained by calling the CreateLight or CreateLightRGB method.

GetColor

public int GetColor();

Retrieves the color of the current d3drmLight object.

Return Value:

Returns the color.

See Also: SetColor


GetConstantAttenuation

public float GetConstantAttenuation();

Retrieves the constant attenuation factor for the d3drmLight 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 d3drmFrame GetEnableFrame();

Retrieves the enable frame for a light.

Return Value:

Returns the d3drmFrame object if successful; null otherwise.

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

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 d3drmLight 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 d3drmLight 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 New color for 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, g, and b New color for the light.


SetConstantAttenuation

public void SetConstantAttenuation(float atn);

Sets the constant attenuation factor for a light.

Return Value:

No return value.

ParameterDescription
atn 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(d3drmFrame f);

Sets the enable frame for a light.

Return Value:

No return value.

ParameterDescription
f The d3drmFrame 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 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 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 New attenuation factor.

See Also: GetQuadraticAttenuation


SetRange

public void SetRange(float rng);

Sets the range of a light. The light affects objects that are within the range only.

Return Value:

No return value.

ParameterDescription
rng New range.

Remarks:

By default, the initial range of light is 256.

See Also: GetRange


SetType

public void SetType(int t);

Changes the light's type.

Return Value:

No return value.

ParameterDescription
t New light type specified by one value of 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 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



Top© 1996 Microsoft Corporation. All rights reserved.