MashPointLight

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

Synopsis

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

Object Hierarchy

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

Implemented Interfaces

MashPointLight implements ClutterScriptable, ClutterAnimatable and AtkImplementorIface.

Properties

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

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.

Details

MashPointLight

typedef struct _MashPointLight MashPointLight;

The MashLightClass structure contains only private data.


struct MashPointLightClass

struct MashPointLightClass {
};

The MashPointLightClass structure contains only private data.


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.

light :

The light to modify

attenuation :

The new value

mash_point_light_get_constant_attenuation ()

gfloat              mash_point_light_get_constant_attenuation
                                                        (MashPointLight *light);

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.

light :

The light to modify

attenuation :

The new value

mash_point_light_get_linear_attenuation ()

gfloat              mash_point_light_get_linear_attenuation
                                                        (MashPointLight *light);

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.

light :

The light to modify

attenuation :

The new value

mash_point_light_get_quadratic_attenuation ()

gfloat              mash_point_light_get_quadratic_attenuation
                                                        (MashPointLight *light);

light :

The light to query

Returns :

the quadratic light attenuation value.

Property Details

The "constant-attenuation" property

  "constant-attenuation"     gfloat                : Read / Write

A constant number to add to the attenuation value.

Allowed values: >= 0

Default value: 1


The "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


The "quadratic-attenuation" property

  "quadratic-attenuation"    gfloat                : Read / Write

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

Allowed values: >= 0

Default value: 0