MashPointLight

MashPointLight — An actor for a light with a position that emits light in all directions.

Functions

Properties

gfloat constant-attenuation Read / Write
gfloat linear-attenuation Read / Write
gfloat quadratic-attenuation Read / Write

Types and Values

Object Hierarchy

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

Implemented Interfaces

MashPointLight implements ClutterContainer, ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Description

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.

Functions

mash_point_light_new ()

ClutterActor *
mash_point_light_new (void);

Constructs a new MashPointLight.

Returns

the new light.


mash_point_light_set_constant_attenuation ()

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.

Parameters

light

The light to modify

 

attenuation

The new value

 

mash_point_light_get_constant_attenuation ()

gfloat
mash_point_light_get_constant_attenuation
                               (MashPointLight *light);

Parameters

light

The light to query

 

Returns

the constant light attenuation value.


mash_point_light_set_linear_attenuation ()

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.

Parameters

light

The light to modify

 

attenuation

The new value

 

mash_point_light_get_linear_attenuation ()

gfloat
mash_point_light_get_linear_attenuation
                               (MashPointLight *light);

Parameters

light

The light to query

 

Returns

the linear light attenuation value.


mash_point_light_set_quadratic_attenuation ()

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.

Parameters

light

The light to modify

 

attenuation

The new value

 

mash_point_light_get_quadratic_attenuation ()

gfloat
mash_point_light_get_quadratic_attenuation
                               (MashPointLight *light);

Parameters

light

The light to query

 

Returns

the quadratic light attenuation value.

Types and Values

struct MashPointLight

struct MashPointLight;

The MashLightClass structure contains only private data.


struct MashPointLightClass

struct MashPointLightClass {
};

The MashPointLightClass structure contains only private data.

Property Details

The “constant-attenuation” property

  “constant-attenuation”     gfloat

A constant number to add to the attenuation value.

Flags: Read / Write

Allowed values: >= 0

Default value: 1


The “linear-attenuation” property

  “linear-attenuation”       gfloat

This number is multiplied by the distance from the vertex to the light source and added to the attenuation factor.

Flags: Read / Write

Allowed values: >= 0

Default value: 0


The “quadratic-attenuation” property

  “quadratic-attenuation”    gfloat

This number is multiplied by the square of the distance from the vertex to the light source and added to the attenuation factor.

Flags: Read / Write

Allowed values: >= 0

Default value: 0