Mash Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
MashPointLightMashPointLight — An actor for a light with a position that emits light in all directions. |
MashPointLight; struct MashPointLightClass; ClutterActor * mash_point_light_new (void
); void mash_point_light_set_constant_attenuation (MashPointLight *light
,gfloat attenuation
); gfloat mash_point_light_get_constant_attenuation (MashPointLight *light
); void mash_point_light_set_linear_attenuation (MashPointLight *light
,gfloat attenuation
); gfloat mash_point_light_get_linear_attenuation (MashPointLight *light
); void mash_point_light_set_quadratic_attenuation (MashPointLight *light
,gfloat attenuation
); gfloat mash_point_light_get_quadratic_attenuation (MashPointLight *light
);
GObject +----GInitiallyUnowned +----ClutterActor +----MashLight +----MashPointLight +----MashSpotLight
MashPointLight implements ClutterScriptable, ClutterAnimatable and AtkImplementorIface.
"constant-attenuation" gfloat : Read / Write "linear-attenuation" gfloat : Read / Write "quadratic-attenuation" gfloat : Read / Write
A MashPointLight models a light that has a position and emits light evenly in all directions. The position of the light is taken from the actor's position so it can be easily modified and even animated using the ClutterActor properties. The intensity of the light can be attenuated using the attenuation properties to make objects that are further from the light receive less intensity. The intensity of the light is divided by ad² + bd + c, where d is the distance between the light and the vertex and a, b and c are the following properties which can be modified on the light: quadratic-attenuation, linear-attenuation and constant-attenuation.
By default the attenuation values are all zero except for the constant attenuation. This causes the light to never be attenuated so that the light intensity is not affected by the distance from the light.
typedef struct _MashPointLight MashPointLight;
The MashLightClass structure contains only private data.
struct MashPointLightClass { };
The MashPointLightClass structure contains only private data.
ClutterActor * mash_point_light_new (void
);
Constructs a new MashPointLight.
Returns : |
the new light. |
void mash_point_light_set_constant_attenuation (MashPointLight *light
,gfloat attenuation
);
Sets the constant attenuation value on a light. The light intensity is divided by this value. Setting a higher value will cause the light to appear dimmer.
|
The light to modify |
|
The new value |
gfloat mash_point_light_get_constant_attenuation
(MashPointLight *light
);
|
The light to query |
Returns : |
the constant light attenuation value. |
void mash_point_light_set_linear_attenuation (MashPointLight *light
,gfloat attenuation
);
Sets the linear attenuation value on a light. The light intensity is divided by this value multiplied by the distance to the light. Setting a higher value will cause the intensity to dim faster as the vertex moves away from the light.
|
The light to modify |
|
The new value |
gfloat mash_point_light_get_linear_attenuation
(MashPointLight *light
);
|
The light to query |
Returns : |
the linear light attenuation value. |
void mash_point_light_set_quadratic_attenuation (MashPointLight *light
,gfloat attenuation
);
Sets the quadratic attenuation value on a light. The light intensity is divided by this value multiplied by the square of the distance to the light. Setting a higher value will cause the intensity to dim sharply as the vertex moves away from the light.
|
The light to modify |
|
The new value |
gfloat mash_point_light_get_quadratic_attenuation
(MashPointLight *light
);
|
The light to query |
Returns : |
the quadratic light attenuation value. |
"constant-attenuation"
property "constant-attenuation" gfloat : Read / Write
A constant number to add to the attenuation value.
Allowed values: >= 0
Default value: 1
"linear-attenuation"
property "linear-attenuation" gfloat : Read / Write
This number is multiplied by the distance from the vertex to the light source and added to the attenuation factor.
Allowed values: >= 0
Default value: 0