MashSpotLight

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

Functions

Properties

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

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── ClutterActor
            ╰── MashLight
                ╰── MashPointLight
                    ╰── MashSpotLight

Implemented Interfaces

MashSpotLight implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

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.

Functions

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°

Parameters

light

The light to modify

 

cutoff

The new value

 

mash_spot_light_get_spot_cutoff ()

gfloat
mash_spot_light_get_spot_cutoff (MashSpotLight *light);

Parameters

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.

Parameters

light

The light to modify

 

exponent

The new value

 

mash_spot_light_get_spot_exponent ()

gfloat
mash_spot_light_get_spot_exponent (MashSpotLight *light);

Parameters

light

The light to query

 

Returns

the spot exponent value

Types and Values

struct MashSpotLight

struct MashSpotLight;

The MashSpotLight structure contains only private data.


struct MashSpotLightClass

struct MashSpotLightClass {
};

The MashSpotLightClass structure contains only private data.

Property Details

The “spot-cutoff” property

  “spot-cutoff”              gfloat

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

Flags: Read / Write

Allowed values: [0,90]

Default value: 45


The “spot-exponent” property

  “spot-exponent”            gfloat

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

Flags: Read / Write

Allowed values: [0,128]

Default value: 0