aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/evas/canvas/evas_canvas3d_light.eo
blob: f15a088f171a7065815540a4ad0938a64c294ca0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
import evas_canvas3d_types;

class @beta Evas.Canvas3D.Light extends Evas.Canvas3D.Object
{
   [[Evas 3D canvas light class]]

   data: Evas_Canvas3D_Light_Data;

   methods {
      @property directional {
         [[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.

           \@ref evas_canvas3d_node_look_at_set]]
         set {
         }
         get {
         }
         values {
            directional: bool; [[Whether the light is directional ($true), or not ($false).]]
         }
      }

      @property spot_exponent {
         [[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 distributed. 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 @.spot_cutoff.set]]
         set {
         }
         get {
         }
         values {
            exponent: Evas.Real; [[Spot exponent value.]]
         }
      }

      @property spot_cutoff {
         [[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.]]
         set {
         }
         get {
         }
         values {
            cutoff: Evas.Real; [[Cutoff angle in degree..]]
         }
      }

      @property attenuation_enable {
         [[The attenuation enable flag of the given light.

           By default, light attenuation is not enabled.

           See also @.attenuation_set]]
         set {
         }
         get {
         }
         values {
            enable: bool; [[Whether to enable attenuation ($true), or not ($false)..]]
         }
      }

      ambient_set {
         [[Set the ambient color of the given light.

           Default ambient color is (0.0, 0.0, 0.0, 1.0).]]
         params {
           @in r: Evas.Real; [[Red component of the ambient color between [0.0, 1.0].]]
           @in g: Evas.Real; [[Green component of the ambient color between [0.0, 1.0].]]
           @in b: Evas.Real; [[Blue component of the ambient color between [0.0, 1.0].]]
           @in a: Evas.Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
         }
      }
      ambient_get @const {
         [[Get the ambient color of the given light.

           See also @.ambient_set]]
         params {
           @out r: Evas.Real; [[Red component of the ambient color between [0.0, 1.0].]]
           @out g: Evas.Real; [[Green component of the ambient color between [0.0, 1.0].]]
           @out b: Evas.Real; [[Blue component of the ambient color between [0.0, 1.0].]]
           @out a: Evas.Real; [[Alpha component of the ambient color between [0.0, 1.0].]]
         }
      }

      diffuse_set {
         [[Set the diffuse color of the given light.

           Default diffuse color is (1.0, 1.0, 1.0, 1.0).]]
         params {
           @in r: Evas.Real; [[Red component of the diffuse color between [0.0, 1.0].]]
           @in g: Evas.Real; [[Green component of the diffuse color between [0.0, 1.0].]]
           @in b: Evas.Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
           @in a: Evas.Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
         }
      }
      diffuse_get @const {
         [[Get the diffuse color of the given light.

           See also @.diffuse_set]]
         params {
           @out r: Evas.Real; [[Red component of the diffuse color between [0.0, 1.0].]]
           @out g: Evas.Real; [[Green component of the diffuse color between [0.0, 1.0].]]
           @out b: Evas.Real; [[Blue component of the diffuse color between [0.0, 1.0].]]
           @out a: Evas.Real; [[Alpha component of the diffuse color between [0.0, 1.0].]]
         }
      }

      specular_set {
         [[Set the specular color of the given light.

           Default specular color is (1.0, 1.0, 1.0, 1.0).]]
         params {
           @in r: Evas.Real; [[Red component of the specular color between [0.0, 1.0].]]
           @in g: Evas.Real; [[Green component of the specular color between [0.0, 1.0].]]
           @in b: Evas.Real; [[Blue component of the specular color between [0.0, 1.0].]]
           @in a: Evas.Real; [[Alpha component of the specular color between [0.0, 1.0].]]
         }
      }
      specular_get @const {
         [[Get the specular color of the given light.

           See also @.specular_set]]
         params {
           @out r: Evas.Real; [[Red component of the specular color between [0.0, 1.0].]]
           @out g: Evas.Real; [[Green component of the specular color between [0.0, 1.0].]]
           @out b: Evas.Real; [[Blue component of the specular color between [0.0, 1.0].]]
           @out a: Evas.Real; [[Alpha component of the specular color between [0.0, 1.0].]]
         }
      }

      attenuation_set {
         [[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 @.attenuation_enable.set]]
         params {
            @in constant: Evas.Real; [[Constant attenuation term..]]
            @in linear: Evas.Real; [[Linear attenuation term..]]
            @in quadratic: Evas.Real; [[Quadratic attenuation term..]]
         }
      }

      attenuation_get @const {
         [[Get the attenuation of the given light.

           See also @.attenuation_set]]
         params {
            @out constant: Evas.Real; [[Constant attenuation term..]]
            @out linear: Evas.Real; [[Linear attenuation term..]]
            @out quadratic: Evas.Real; [[Quadratic attenuation term..]]
         }
      }

      projection_matrix_set {
         [[Set the projection matrix of the given light source.

           Default projection matrix is identity matrix.

           See also @.projection_perspective_set, @.projection_ortho_set and @.projection_frustum_set]]
         params {
           @in matrix: ptr(const(Evas.Real)); [[Projection Matrix. Pointer to the array of 16 Evas.Real values in column major order.]]
         }
      }

      projection_matrix_get  @const {
         [[Get the projection matrix of the given light source.

           See also @.projection_matrix_set]]
         params {
           @out matrix: Evas.Real; [[Projection Matrix]]
         }
      }

      projection_perspective_set {
         [[Set the projection matrix of the given light source with perspective projection.

           See also @.projection_matrix_set]]

         params {
            fovy: Evas.Real; [[Field of view angle in Y direction.]]
            aspect: Evas.Real; [[Aspect ratio.]]
            dnear: Evas.Real; [[Distance to near clipping plane.]]
            dfar: Evas.Real; [[Distance to far clipping plane.]]
         }
      }

      projection_frustum_set {
         [[Set the projection matrix of the given light source with frustum projection.

           @Evas.Canvas3D.Light.projection_matrix_set]]
         params {
            left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
            right: Evas.Real; [[Right X coordinate of the near clipping plane.]]
            bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
            top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
            dnear: Evas.Real; [[Distance to near clipping plane.]]
            dfar: Evas.Real; [[Distance to far clipping plane.]]
         }
      }
      projection_ortho_set {
         [[Set the projection matrix of the given light source with orthogonal projection.

           See also @.projection_matrix_set]]
         params {
            left: Evas.Real; [[Left X coordinate of the near clipping plane.]]
            right: Evas.Real; [[Right X coordinate of the near clipping plane.]]
            bottom: Evas.Real; [[Bottom Y coordinate of the near clipping plane.]]
            top: Evas.Real; [[Top Y coordinate of the near clipping plane]]
            dnear: Evas.Real; [[Distance to near clipping plane.]]
            dfar: Evas.Real; [[Distance to far clipping plane.]]
         }
      }
   }

   implements {
      Efl.Object.constructor;
      Efl.Object.destructor;
      Evas.Canvas3D.Object.update_notify;
      Evas.Canvas3D.Object.change_notify;
      @empty Evas.Canvas3D.Object.callback_register;
      @empty Evas.Canvas3D.Object.callback_unregister;
   }

}