Mash Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
MashSpotLight; struct MashSpotLightClass; ClutterActor * mash_spot_light_new (void
); void mash_spot_light_set_spot_cutoff (MashSpotLight *light
,gfloat cutoff
); gfloat mash_spot_light_get_spot_cutoff (MashSpotLight *light
); void mash_spot_light_set_spot_exponent (MashSpotLight *light
,gfloat exponent
); gfloat mash_spot_light_get_spot_exponent (MashSpotLight *light
);
GObject +----GInitiallyUnowned +----ClutterActor +----MashLight +----MashPointLight +----MashSpotLight
MashSpotLight implements ClutterScriptable, ClutterAnimatable and AtkImplementorIface.
A MashSpotLight is a subclass of MashPointLight which additionally restricts the light emitted to a cone shape eminating from the light's position. The same attenuation properties provided by MashPointLight can be used to modify the intensity based on the distance to the light. The angle of the cone can be modified with the spot-cutoff property and the spot-exponent property. The cutoff sets a hard restriction on the maximum angle which light will be emitted. The exponent sets the rate at which light dims as the angle expands out.
The direction of a spot light is always along the positive y axis which is towards the bottom of the stage in a default Clutter scene. The direction is affected by the actor's transformation so it can be modified or animated by rotating the actor.
typedef struct _MashSpotLight MashSpotLight;
The MashSpotLight structure contains only private data.
struct MashSpotLightClass { };
The MashSpotLightClass structure contains only private data.
ClutterActor * mash_spot_light_new (void
);
Constructs a new MashSpotLight.
Returns : |
the new light. |
void mash_spot_light_set_spot_cutoff (MashSpotLight *light
,gfloat cutoff
);
Sets the spot cut off value on a light. This is an angle in degrees which defines the shape of the cone of light emitted from the light. It should be within the range 0° to 90°
|
The light to modify |
|
The new value |
gfloat mash_spot_light_get_spot_cutoff (MashSpotLight *light
);
|
The light to query |
Returns : |
the spot cut off value |
void mash_spot_light_set_spot_exponent (MashSpotLight *light
,gfloat exponent
);
Sets the spot exponent value on a light. The light intensity is multiplied by the angle between the light direction and the vector to the vertex raised to the power of the exponent. A higher exponent value makes the cone of the light appear smaller.
|
The light to modify |
|
The new value |
gfloat mash_spot_light_get_spot_exponent (MashSpotLight *light
);
|
The light to query |
Returns : |
the spot exponent value |