MashSpotLight

MashSpotLight — A light with a position which emits light within a cone shape.

Synopsis

                    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);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----ClutterActor
               +----MashLight
                     +----MashPointLight
                           +----MashSpotLight

Implemented Interfaces

MashSpotLight implements ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Properties

  "spot-cutoff"              gfloat                : Read / Write
  "spot-exponent"            gfloat                : Read / Write

Description

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.

Details

MashSpotLight

typedef struct _MashSpotLight MashSpotLight;

The MashSpotLight structure contains only private data.


struct MashSpotLightClass

struct MashSpotLightClass {
};

The MashSpotLightClass structure contains only private data.


mash_spot_light_new ()

ClutterActor *      mash_spot_light_new                 (void);

Constructs a new MashSpotLight.

Returns :

the new light.

mash_spot_light_set_spot_cutoff ()

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°

light :

The light to modify

cutoff :

The new value

mash_spot_light_get_spot_cutoff ()

gfloat              mash_spot_light_get_spot_cutoff     (MashSpotLight *light);

light :

The light to query

Returns :

the spot cut off value

mash_spot_light_set_spot_exponent ()

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.

light :

The light to modify

exponent :

The new value

mash_spot_light_get_spot_exponent ()

gfloat              mash_spot_light_get_spot_exponent   (MashSpotLight *light);

light :

The light to query

Returns :

the spot exponent value

Property Details

The "spot-cutoff" property

  "spot-cutoff"              gfloat                : Read / Write

The cut off angle where the spot light emits no light.

Allowed values: [0,90]

Default value: 45


The "spot-exponent" property

  "spot-exponent"            gfloat                : Read / Write

A value used to set the decay of the light as the angle increases from the light direction.

Allowed values: [0,128]

Default value: 0