Typedefs | Functions
Light Object

A light object represents a set of properties of a light source. More...

Typedefs

typedef Eo Evas_3D_Light
 Light object handle. More...
 

Functions

EOAPI void evas_3d_light_directional_set (Eina_Bool directional)
 Set the directional flag of the given light. More...
 
EOAPI Eina_Bool evas_3d_light_directional_get (void)
 Get the directional flag of the given light. More...
 
EOAPI void evas_3d_light_spot_exponent_set (Evas_Real exponent)
 Set the spot exponent of the given light. More...
 
EOAPI Evas_Real evas_3d_light_spot_exponent_get (void)
 Get the spot exponent of the given light. More...
 
EOAPI void evas_3d_light_spot_cutoff_set (Evas_Real cutoff)
 Set the spot cutoff angle of the given light. More...
 
EOAPI Evas_Real evas_3d_light_spot_cutoff_get (void)
 Get the spot cutoff angle of the given light. More...
 
EOAPI void evas_3d_light_attenuation_enable_set (Eina_Bool enable)
 Set the attenuation enable flag of the given light. More...
 
EOAPI Eina_Bool evas_3d_light_attenuation_enable_get (void)
 Get the attenuation enable flag of the given light. More...
 
EOAPI void evas_3d_light_ambient_set (Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the ambient color of the given light. More...
 
EOAPI void evas_3d_light_ambient_get (Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the ambient color of the given light. More...
 
EOAPI void evas_3d_light_diffuse_set (Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the diffuse color of the given light. More...
 
EOAPI void evas_3d_light_diffuse_get (Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the diffuse color of the given light. More...
 
EOAPI void evas_3d_light_specular_set (Evas_Real r, Evas_Real g, Evas_Real b, Evas_Real a)
 Set the specular color of the given light. More...
 
EOAPI void evas_3d_light_specular_get (Evas_Real *r, Evas_Real *g, Evas_Real *b, Evas_Real *a)
 Get the specular color of the given light. More...
 
EOAPI void evas_3d_light_attenuation_set (Evas_Real constant, Evas_Real linear, Evas_Real quadratic)
 Set the attenuation of the given light. More...
 
EOAPI void evas_3d_light_attenuation_get (Evas_Real *constant, Evas_Real *linear, Evas_Real *quadratic)
 Get the attenuation of the given light. More...
 
EOAPI void evas_3d_light_projection_matrix_set (const Evas_Real *matrix)
 Set the projection matrix of the given light source. More...
 
EOAPI void evas_3d_light_projection_matrix_get (Evas_Real *matrix)
 Get the projection matrix of the given light source. More...
 
EOAPI void evas_3d_light_projection_perspective_set (Evas_Real fovy, Evas_Real aspect, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with perspective projection. More...
 
EOAPI void evas_3d_light_projection_frustum_set (Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with frustum projection. More...
 
EOAPI void evas_3d_light_projection_ortho_set (Evas_Real left, Evas_Real right, Evas_Real bottom, Evas_Real top, Evas_Real dnear, Evas_Real dfar)
 Set the projection matrix of the given light source with orthogonal projection. More...
 
void evas_3d_light::ambient_set (Evas_Real r_, Evas_Real g_, Evas_Real b_, Evas_Real a_) const
 Set the ambient color of the given light. More...
 
void evas_3d_light::ambient_get (Evas_Real *r_, Evas_Real *g_, Evas_Real *b_, Evas_Real *a_) const
 Get the ambient color of the given light. More...
 
void evas_3d_light::diffuse_set (Evas_Real r_, Evas_Real g_, Evas_Real b_, Evas_Real a_) const
 Set the diffuse color of the given light. More...
 
void evas_3d_light::diffuse_get (Evas_Real *r_, Evas_Real *g_, Evas_Real *b_, Evas_Real *a_) const
 Get the diffuse color of the given light. More...
 
void evas_3d_light::specular_set (Evas_Real r_, Evas_Real g_, Evas_Real b_, Evas_Real a_) const
 Set the specular color of the given light. More...
 
void evas_3d_light::specular_get (Evas_Real *r_, Evas_Real *g_, Evas_Real *b_, Evas_Real *a_) const
 Get the specular color of the given light. More...
 
void evas_3d_light::attenuation_set (Evas_Real constant_, Evas_Real linear_, Evas_Real quadratic_) const
 Set the attenuation of the given light. More...
 
void evas_3d_light::attenuation_get (Evas_Real *constant_, Evas_Real *linear_, Evas_Real *quadratic_) const
 Get the attenuation of the given light. More...
 
void evas_3d_light::projection_matrix_set (const Evas_Real *matrix_) const
 Set the projection matrix of the given light source. More...
 
void evas_3d_light::projection_matrix_get (Evas_Real *matrix_) const
 Get the projection matrix of the given light source. More...
 
void evas_3d_light::projection_perspective_set (Evas_Real fovy_, Evas_Real aspect_, Evas_Real dnear_, Evas_Real dfar_) const
 Set the projection matrix of the given light source with perspective projection. More...
 
void evas_3d_light::projection_frustum_set (Evas_Real left_, Evas_Real right_, Evas_Real bottom_, Evas_Real top_, Evas_Real dnear_, Evas_Real dfar_) const
 Set the projection matrix of the given light source with frustum projection. More...
 
void evas_3d_light::projection_ortho_set (Evas_Real left_, Evas_Real right_, Evas_Real bottom_, Evas_Real top_, Evas_Real dnear_, Evas_Real dfar_) const
 Set the projection matrix of the given light source with orthogonal projection. More...
 
bool evas_3d_light::directional_get () const
 Get the directional flag of the given light. More...
 
void evas_3d_light::directional_set (bool directional_) const
 Set the directional flag of the given light. More...
 
Evas_Real evas_3d_light::spot_exponent_get () const
 Get the spot exponent of the given light. More...
 
void evas_3d_light::spot_exponent_set (Evas_Real exponent_) const
 Set the spot exponent of the given light. More...
 
Evas_Real evas_3d_light::spot_cutoff_get () const
 Get the spot cutoff angle of the given light. More...
 
void evas_3d_light::spot_cutoff_set (Evas_Real cutoff_) const
 Set the spot cutoff angle of the given light. More...
 
bool evas_3d_light::attenuation_enable_get () const
 Get the attenuation enable flag of the given light. More...
 
void evas_3d_light::attenuation_enable_set (bool enable_) const
 Set the attenuation enable flag of the given light. More...
 

Detailed Description

A light object represents a set of properties of a light source.

Evas 3D provides standard reflection model that of ambient, diffuse and specular reflection model. Also, Evas 3D support 3 types of light model, directional, point and spot light. Light position and direction is determined by the node containing the light.

Typedef Documentation

Light object handle.

Since
1.10

Function Documentation

EOAPI void evas_3d_light_directional_set ( Eina_Bool  directional)

Set the directional flag of the given light.

Directional light is a type of light which is infinitely far away with no attenuation. The light direction is determined by the containing node's forward vector (negative Z-axis).

By default, directional is not enabled.

See also
evas_3d_node_look_at_set()
Parameters
[in]directionalWhether the light is directional (EINA_TRUE), or not (EINA_FALSE).
EOAPI Eina_Bool evas_3d_light_directional_get ( void  )

Get the directional flag of the given light.

See also
evas_3d_light_directional_set()
EOAPI void evas_3d_light_spot_exponent_set ( Evas_Real  exponent)

Set the spot exponent of the given light.

Higher spot exponent means intensity at the center of the cone is relatively stronger. Zero exponent means the light intensity is evenly distibuted. The spot exponent has no effect when the light is not spot light (spot cutoff angle is less than 180 degree).

Default spot exponent is 0.

See also
evas_3d_light_spot_cutoff_set()
Parameters
[in]exponentSpot exponent value..
EOAPI Evas_Real evas_3d_light_spot_exponent_get ( void  )

Get the spot exponent of the given light.

See also
evas_3d_light_spot_exponent_set()
EOAPI void evas_3d_light_spot_cutoff_set ( Evas_Real  cutoff)

Set the spot cutoff angle of the given light.

Only angle less than 180 degree will make it spot light, so that other spot light attribute will take effect.

Default spot cutoff angle is 180.

Parameters
[in]cutoffCutoff angle in degree..
EOAPI Evas_Real evas_3d_light_spot_cutoff_get ( void  )

Get the spot cutoff angle of the given light.

See also
evas_3d_light_spot_cutoff_set()
EOAPI void evas_3d_light_attenuation_enable_set ( Eina_Bool  enable)

Set the attenuation enable flag of the given light.

By default, light attenuation is not enabled.

See also
evas_3d_light_attenuation_set()
Parameters
[in]enableWhether to enable attenuation (EINA_TRUE), or not (EINA_FALSE)..
EOAPI Eina_Bool evas_3d_light_attenuation_enable_get ( void  )

Get the attenuation enable flag of the given light.

See also
evas_3d_light_attenuation_enable_set()
EOAPI void evas_3d_light_ambient_set ( Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the ambient color of the given light.

Default ambient color is (0.0, 0.0, 0.0, 1.0).

Parameters
[in]rRed component of the ambient color between [0.0, 1.0].
[in]gGreen component of the ambient color between [0.0, 1.0].
[in]bBlue component of the ambient color between [0.0, 1.0].
[in]aAlpha component of the ambient color between [0.0, 1.0].
EOAPI void evas_3d_light_ambient_get ( Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the ambient color of the given light.

See also
evas_3d_light_ambient_set()
Parameters
[out]rRed component of the ambient color between [0.0, 1.0].
[out]gGreen component of the ambient color between [0.0, 1.0].
[out]bBlue component of the ambient color between [0.0, 1.0].
[out]aAlpha component of the ambient color between [0.0, 1.0].
EOAPI void evas_3d_light_diffuse_set ( Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the diffuse color of the given light.

Default diffuse color is (1.0, 1.0, 1.0, 1.0).

Parameters
[in]rRed component of the diffuse color between [0.0, 1.0].
[in]gGreen component of the diffuse color between [0.0, 1.0].
[in]bBlue component of the diffuse color between [0.0, 1.0].
[in]aAlpha component of the diffuse color between [0.0, 1.0].
EOAPI void evas_3d_light_diffuse_get ( Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the diffuse color of the given light.

See also
evas_3d_light_diffuse_set()
Parameters
[out]rRed component of the diffuse color between [0.0, 1.0].
[out]gGreen component of the diffuse color between [0.0, 1.0].
[out]bBlue component of the diffuse color between [0.0, 1.0].
[out]aAlpha component of the diffuse color between [0.0, 1.0].
EOAPI void evas_3d_light_specular_set ( Evas_Real  r,
Evas_Real  g,
Evas_Real  b,
Evas_Real  a 
)

Set the specular color of the given light.

Default specular color is (1.0, 1.0, 1.0, 1.0).

Parameters
[in]rRed component of the specular color between [0.0, 1.0].
[in]gGreen component of the specular color between [0.0, 1.0].
[in]bBlue component of the specular color between [0.0, 1.0].
[in]aAlpha component of the specular color between [0.0, 1.0].
EOAPI void evas_3d_light_specular_get ( Evas_Real r,
Evas_Real g,
Evas_Real b,
Evas_Real a 
)

Get the specular color of the given light.

See also
evas_3d_light_specular_set()
Parameters
[out]rRed component of the specular color between [0.0, 1.0].
[out]gGreen component of the specular color between [0.0, 1.0].
[out]bBlue component of the specular color between [0.0, 1.0].
[out]aAlpha component of the specular color between [0.0, 1.0].
EOAPI void evas_3d_light_attenuation_set ( Evas_Real  constant,
Evas_Real  linear,
Evas_Real  quadratic 
)

Set the attenuation of the given light.

Light attenuation has no effect with directional light. And the attenuation should be enabled first to take effect. The attenuation factor is calculated as follows.

atten = 1.0 / constant + linear * distance + quadratic * distance * distance

Default attenuation is constant = 1.0, linear = 0.0, quadratic = 0.0.

See also
evas_3d_light_attenuation_enable_set()
Parameters
[in]constantConstant attenuation term..
[in]linearLinear attenuation term..
[in]quadraticQuadratic attenuation term..
EOAPI void evas_3d_light_attenuation_get ( Evas_Real constant,
Evas_Real linear,
Evas_Real quadratic 
)

Get the attenuation of the given light.

See also
evas_3d_light_attenuation_set()
Parameters
[out]constantConstant attenuation term..
[out]linearLinear attenuation term..
[out]quadraticQuadratic attenuation term..
EOAPI void evas_3d_light_projection_matrix_set ( const Evas_Real matrix)

Set the projection matrix of the given light source.

Parameters
lightThe given light source.
matrixPointer to the array of 16 Evas_Real values in column major order.

Default projection matrix is identity matrix.

See also
evas_3d_light_projection_perspective_set()
evas_3d_light_projection_ortho_set()
evas_3d_light_projection_frustum_set()
Parameters
[in]matrixProjection Matrix
EOAPI void evas_3d_light_projection_matrix_get ( Evas_Real matrix)

Get the projection matrix of the given light source.

Parameters
lightThe given light source.
matrixPointer to receive the 16 Evas_Real values in column major order.
See also
evas_3d_light_projection_matrix_set()
Parameters
[out]matrixProjection Matrix
EOAPI void evas_3d_light_projection_perspective_set ( Evas_Real  fovy,
Evas_Real  aspect,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with perspective projection.

Parameters
lightThe given light source.
fovyField of view angle in Y direction.
aspectAspect ratio.
dnearDistance to near clipping plane.
dfarDistance to far clipping plane.
See also
evas_3d_light_projection_matrix_set()
Parameters
[in]fovyField of view angle in Y direction.
[in]aspectAspect ratio.
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.
EOAPI void evas_3d_light_projection_frustum_set ( Evas_Real  left,
Evas_Real  right,
Evas_Real  bottom,
Evas_Real  top,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with frustum projection.

See also
evas_3d_Light_projection_matrix_set()
Parameters
[in]leftLeft X coordinate of the near clipping plane.
[in]rightRight X coordinate of the near clipping plane..
[in]bottomBottom Y coordinate of the near clipping plane.
[in]topTop Y coordinate of the near clipping plane
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.
EOAPI void evas_3d_light_projection_ortho_set ( Evas_Real  left,
Evas_Real  right,
Evas_Real  bottom,
Evas_Real  top,
Evas_Real  dnear,
Evas_Real  dfar 
)

Set the projection matrix of the given light source with orthogonal projection.

See also
evas_3d_light_projection_matrix_set()
Parameters
[in]leftLeft X coordinate of the near clipping plane.
[in]rightRight X coordinate of the near clipping plane..
[in]bottomBottom Y coordinate of the near clipping plane.
[in]topTop Y coordinate of the near clipping plane
[in]dnearDistance to near clipping plane.
[in]dfarDistance to far clipping plane.
void evas_3d_light::ambient_set ( Evas_Real  r_,
Evas_Real  g_,
Evas_Real  b_,
Evas_Real  a_ 
) const

Set the ambient color of the given light.

Default ambient color is (0.0, 0.0, 0.0, 1.0).

Parameters
rRed component of the ambient color between [0.0, 1.0].
gGreen component of the ambient color between [0.0, 1.0].
bBlue component of the ambient color between [0.0, 1.0].
aAlpha component of the ambient color between [0.0, 1.0].
void evas_3d_light::ambient_get ( Evas_Real r_,
Evas_Real g_,
Evas_Real b_,
Evas_Real a_ 
) const

Get the ambient color of the given light.

See also
evas_3d_light_ambient_set()
Parameters
[out]rRed component of the ambient color between [0.0, 1.0].
[out]gGreen component of the ambient color between [0.0, 1.0].
[out]bBlue component of the ambient color between [0.0, 1.0].
[out]aAlpha component of the ambient color between [0.0, 1.0].
void evas_3d_light::diffuse_set ( Evas_Real  r_,
Evas_Real  g_,
Evas_Real  b_,
Evas_Real  a_ 
) const

Set the diffuse color of the given light.

Default diffuse color is (1.0, 1.0, 1.0, 1.0).

Parameters
rRed component of the diffuse color between [0.0, 1.0].
gGreen component of the diffuse color between [0.0, 1.0].
bBlue component of the diffuse color between [0.0, 1.0].
aAlpha component of the diffuse color between [0.0, 1.0].
void evas_3d_light::diffuse_get ( Evas_Real r_,
Evas_Real g_,
Evas_Real b_,
Evas_Real a_ 
) const

Get the diffuse color of the given light.

See also
evas_3d_light_diffuse_set()
Parameters
[out]rRed component of the diffuse color between [0.0, 1.0].
[out]gGreen component of the diffuse color between [0.0, 1.0].
[out]bBlue component of the diffuse color between [0.0, 1.0].
[out]aAlpha component of the diffuse color between [0.0, 1.0].
void evas_3d_light::specular_set ( Evas_Real  r_,
Evas_Real  g_,
Evas_Real  b_,
Evas_Real  a_ 
) const

Set the specular color of the given light.

Default specular color is (1.0, 1.0, 1.0, 1.0).

Parameters
rRed component of the specular color between [0.0, 1.0].
gGreen component of the specular color between [0.0, 1.0].
bBlue component of the specular color between [0.0, 1.0].
aAlpha component of the specular color between [0.0, 1.0].
void evas_3d_light::specular_get ( Evas_Real r_,
Evas_Real g_,
Evas_Real b_,
Evas_Real a_ 
) const

Get the specular color of the given light.

See also
evas_3d_light_specular_set()
Parameters
[out]rRed component of the specular color between [0.0, 1.0].
[out]gGreen component of the specular color between [0.0, 1.0].
[out]bBlue component of the specular color between [0.0, 1.0].
[out]aAlpha component of the specular color between [0.0, 1.0].
void evas_3d_light::attenuation_set ( Evas_Real  constant_,
Evas_Real  linear_,
Evas_Real  quadratic_ 
) const

Set the attenuation of the given light.

Light attenuation has no effect with directional light. And the attenuation should be enabled first to take effect. The attenuation factor is calculated as follows.

atten = 1.0 / constant + linear * distance + quadratic * distance * distance

Default attenuation is constant = 1.0, linear = 0.0, quadratic = 0.0.

See also
evas_3d_light_attenuation_enable_set()
Parameters
constantConstant attenuation term..
linearLinear attenuation term..
quadraticQuadratic attenuation term..
void evas_3d_light::attenuation_get ( Evas_Real constant_,
Evas_Real linear_,
Evas_Real quadratic_ 
) const

Get the attenuation of the given light.

See also
evas_3d_light_attenuation_set()
Parameters
[out]constantConstant attenuation term..
[out]linearLinear attenuation term..
[out]quadraticQuadratic attenuation term..
void evas_3d_light::projection_matrix_set ( const Evas_Real matrix_) const

Set the projection matrix of the given light source.

Parameters
lightThe given light source.
matrixPointer to the array of 16 Evas_Real values in column major order.

Default projection matrix is identity matrix.

See also
evas_3d_light_projection_perspective_set()
evas_3d_light_projection_ortho_set()
evas_3d_light_projection_frustum_set()
Parameters
matrixProjection Matrix
void evas_3d_light::projection_matrix_get ( Evas_Real matrix_) const

Get the projection matrix of the given light source.

Parameters
lightThe given light source.
matrixPointer to receive the 16 Evas_Real values in column major order.
See also
evas_3d_light_projection_matrix_set()
Parameters
[out]matrixProjection Matrix
void evas_3d_light::projection_perspective_set ( Evas_Real  fovy_,
Evas_Real  aspect_,
Evas_Real  dnear_,
Evas_Real  dfar_ 
) const

Set the projection matrix of the given light source with perspective projection.

Parameters
lightThe given light source.
fovyField of view angle in Y direction.
aspectAspect ratio.
dnearDistance to near clipping plane.
dfarDistance to far clipping plane.
See also
evas_3d_light_projection_matrix_set()
Parameters
fovyField of view angle in Y direction.
aspectAspect ratio.
dnearDistance to near clipping plane.
dfarDistance to far clipping plane.
void evas_3d_light::projection_frustum_set ( Evas_Real  left_,
Evas_Real  right_,
Evas_Real  bottom_,
Evas_Real  top_,
Evas_Real  dnear_,
Evas_Real  dfar_ 
) const

Set the projection matrix of the given light source with frustum projection.

See also
evas_3d_Light_projection_matrix_set()
Parameters
leftLeft X coordinate of the near clipping plane.
rightRight X coordinate of the near clipping plane..
bottomBottom Y coordinate of the near clipping plane.
topTop Y coordinate of the near clipping plane
dnearDistance to near clipping plane.
dfarDistance to far clipping plane.
void evas_3d_light::projection_ortho_set ( Evas_Real  left_,
Evas_Real  right_,
Evas_Real  bottom_,
Evas_Real  top_,
Evas_Real  dnear_,
Evas_Real  dfar_ 
) const

Set the projection matrix of the given light source with orthogonal projection.

See also
evas_3d_light_projection_matrix_set()
Parameters
leftLeft X coordinate of the near clipping plane.
rightRight X coordinate of the near clipping plane..
bottomBottom Y coordinate of the near clipping plane.
topTop Y coordinate of the near clipping plane
dnearDistance to near clipping plane.
dfarDistance to far clipping plane.
bool evas_3d_light::directional_get ( ) const

Get the directional flag of the given light.

See also
evas_3d_light_directional_set()
Parameters
directionalWhether the light is directional (EINA_TRUE), or not (EINA_FALSE).
void evas_3d_light::directional_set ( bool  directional_) const

Set the directional flag of the given light.

Directional light is a type of light which is infinitely far away with no attenuation. The light direction is determined by the containing node's forward vector (negative Z-axis).

By default, directional is not enabled.

See also
evas_3d_node_look_at_set()
Parameters
directionalWhether the light is directional (EINA_TRUE), or not (EINA_FALSE).
Evas_Real evas_3d_light::spot_exponent_get ( ) const

Get the spot exponent of the given light.

See also
evas_3d_light_spot_exponent_set()
Parameters
exponentSpot exponent value..
void evas_3d_light::spot_exponent_set ( Evas_Real  exponent_) const

Set the spot exponent of the given light.

Higher spot exponent means intensity at the center of the cone is relatively stronger. Zero exponent means the light intensity is evenly distibuted. The spot exponent has no effect when the light is not spot light (spot cutoff angle is less than 180 degree).

Default spot exponent is 0.

See also
evas_3d_light_spot_cutoff_set()
Parameters
exponentSpot exponent value..
Evas_Real evas_3d_light::spot_cutoff_get ( ) const

Get the spot cutoff angle of the given light.

See also
evas_3d_light_spot_cutoff_set()
Parameters
cutoffCutoff angle in degree..
void evas_3d_light::spot_cutoff_set ( Evas_Real  cutoff_) const

Set the spot cutoff angle of the given light.

Only angle less than 180 degree will make it spot light, so that other spot light attribute will take effect.

Default spot cutoff angle is 180.

Parameters
cutoffCutoff angle in degree..
bool evas_3d_light::attenuation_enable_get ( ) const

Get the attenuation enable flag of the given light.

See also
evas_3d_light_attenuation_enable_set()
Parameters
enableWhether to enable attenuation (EINA_TRUE), or not (EINA_FALSE)..
void evas_3d_light::attenuation_enable_set ( bool  enable_) const

Set the attenuation enable flag of the given light.

By default, light attenuation is not enabled.

See also
evas_3d_light_attenuation_set()
Parameters
enableWhether to enable attenuation (EINA_TRUE), or not (EINA_FALSE)..