~ubuntu-branches/ubuntu/trusty/blender/trusty

« back to all changes in this revision

Viewing changes to source/blender/render/intern/raytrace/rayobject.cpp

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2013-03-06 12:08:47 UTC
  • mfrom: (1.5.1) (14.1.8 experimental)
  • Revision ID: package-import@ubuntu.com-20130306120847-frjfaryb2zrotwcg
Tags: 2.66a-1ubuntu1
* Resynchronize with Debian (LP: #1076930, #1089256, #1052743, #999024,
  #1122888, #1147084)
* debian/control:
  - Lower build-depends on libavcodec-dev since we're not
    doing the libav9 transition in Ubuntu yet

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 * because function is too long. Since this is code that is called billions
51
51
 * of times we really do want to inline. */
52
52
 
53
 
MALWAYS_INLINE RayObject* rayface_from_coords(RayFace *rayface, void *ob, void *face,
 
53
MALWAYS_INLINE RayObject *rayface_from_coords(RayFace *rayface, void *ob, void *face,
54
54
                                              float *v1, float *v2, float *v3, float *v4)
55
55
{
56
56
        rayface->ob = ob;
60
60
        copy_v3_v3(rayface->v2, v2);
61
61
        copy_v3_v3(rayface->v3, v3);
62
62
 
63
 
        if (v4)
64
 
        {
 
63
        if (v4) {
65
64
                copy_v3_v3(rayface->v4, v4);
66
65
                rayface->quad = 1;
67
66
        }
68
 
        else
69
 
        {
 
67
        else {
70
68
                rayface->quad = 0;
71
69
        }
72
70
 
77
75
{
78
76
        rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : NULL);
79
77
 
80
 
        if (obi->transform_primitives)
81
 
        {
 
78
        if (obi->transform_primitives) {
82
79
                mul_m4_v3(obi->mat, rayface->v1);
83
80
                mul_m4_v3(obi->mat, rayface->v2);
84
81
                mul_m4_v3(obi->mat, rayface->v3);
88
85
        }
89
86
}
90
87
 
91
 
RayObject* RE_rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, VlakRen *vlr)
 
88
RayObject *RE_rayface_from_vlak(RayFace *rayface, ObjectInstanceRen *obi, VlakRen *vlr)
92
89
{
93
90
        return rayface_from_coords(rayface, obi, vlr, vlr->v1->co, vlr->v2->co, vlr->v3->co, vlr->v4 ? vlr->v4->co : 0);
94
91
}
95
92
 
 
93
RayObject *RE_rayface_from_coords(RayFace *rayface, void *ob, void *face, float *v1, float *v2, float *v3, float *v4)
 
94
{
 
95
        return rayface_from_coords(rayface, ob, face, v1, v2, v3, v4);
 
96
}
 
97
 
96
98
/* VlakPrimitive */
97
99
 
98
 
RayObject* RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr)
 
100
RayObject *RE_vlakprimitive_from_vlak(VlakPrimitive *face, struct ObjectInstanceRen *obi, struct VlakRen *vlr)
99
101
{
100
102
        face->ob = obi;
101
103
        face->face = vlr;
113
115
                return 0;
114
116
 
115
117
        /* I know... cpu cycle waste, might do smarter once */
116
 
        if (is->mode==RE_RAY_MIRROR)
 
118
        if (is->mode == RE_RAY_MIRROR)
117
119
                return !(vlr->mat->mode & MA_ONLYCAST);
118
120
        else
119
121
                return (is->lay & obi->lay);
120
122
}
121
123
 
122
 
MALWAYS_INLINE int vlr_check_intersect_solid(Isect *UNUSED(is), ObjectInstanceRen* UNUSED(obi), VlakRen *vlr)
 
124
MALWAYS_INLINE int vlr_check_intersect_solid(Isect *UNUSED(is), ObjectInstanceRen *UNUSED(obi), VlakRen *vlr)
123
125
{
124
126
        /* solid material types only */
125
127
        if (vlr->mat->material_type == MA_TYPE_SURFACE)
128
130
                return 0;
129
131
}
130
132
 
131
 
MALWAYS_INLINE int vlr_check_bake(Isect *is, ObjectInstanceRen* obi, VlakRen *UNUSED(vlr))
 
133
MALWAYS_INLINE int vlr_check_bake(Isect *is, ObjectInstanceRen *obi, VlakRen *UNUSED(vlr))
132
134
{
133
135
        return (obi->obr->ob != is->userdata) && (obi->obr->ob->flag & SELECT);
134
136
}
141
143
        float t0[3], t1[3], x[3], r[3], m[3], u, v, divdet, det1, l;
142
144
        int quad;
143
145
 
144
 
        quad= RE_rayface_isQuad(face);
 
146
        quad = RE_rayface_isQuad(face);
145
147
 
146
148
        copy_v3_v3(co1, face->v1);
147
149
        copy_v3_v3(co2, face->v2);
154
156
        sub_v3_v3v3(t1, co3, co1);
155
157
 
156
158
        cross_v3_v3v3(x, r, t1);
157
 
        divdet= dot_v3v3(t0, x);
 
159
        divdet = dot_v3v3(t0, x);
158
160
 
159
161
        sub_v3_v3v3(m, start, co3);
160
 
        det1= dot_v3v3(m, x);
 
162
        det1 = dot_v3v3(m, x);
161
163
        
162
164
        if (divdet != 0.0f) {
163
 
                divdet= 1.0f/divdet;
164
 
                v= det1*divdet;
 
165
                divdet = 1.0f / divdet;
 
166
                v = det1 * divdet;
165
167
 
166
 
                if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
 
168
                if (v < RE_RAYTRACE_EPSILON && v > -(1.0f + RE_RAYTRACE_EPSILON)) {
167
169
                        float cros[3];
168
170
 
169
171
                        cross_v3_v3v3(cros, m, t0);
170
 
                        u= divdet*dot_v3v3(cros, r);
 
172
                        u = divdet * dot_v3v3(cros, r);
171
173
 
172
 
                        if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
173
 
                                l= divdet*dot_v3v3(cros, t1);
 
174
                        if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f + RE_RAYTRACE_EPSILON)) {
 
175
                                l = divdet * dot_v3v3(cros, t1);
174
176
 
175
177
                                /* check if intersection is within ray length */
176
178
                                if (l > -RE_RAYTRACE_EPSILON && l < *lambda) {
177
 
                                        uv[0]= u;
178
 
                                        uv[1]= v;
179
 
                                        *lambda= l;
 
179
                                        uv[0] = u;
 
180
                                        uv[1] = v;
 
181
                                        *lambda = l;
180
182
                                        return 1;
181
183
                                }
182
184
                        }
187
189
        if (quad) {
188
190
                copy_v3_v3(co4, face->v4);
189
191
                sub_v3_v3v3(t0, co3, co4);
190
 
                divdet= dot_v3v3(t0, x);
 
192
                divdet = dot_v3v3(t0, x);
191
193
 
192
194
                if (divdet != 0.0f) {
193
 
                        divdet= 1.0f/divdet;
194
 
                        v = det1*divdet;
 
195
                        divdet = 1.0f / divdet;
 
196
                        v = det1 * divdet;
195
197
                        
196
 
                        if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
 
198
                        if (v < RE_RAYTRACE_EPSILON && v > -(1.0f + RE_RAYTRACE_EPSILON)) {
197
199
                                float cros[3];
198
200
 
199
201
                                cross_v3_v3v3(cros, m, t0);
200
 
                                u= divdet*dot_v3v3(cros, r);
 
202
                                u = divdet * dot_v3v3(cros, r);
201
203
        
202
 
                                if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON)) {
203
 
                                        l= divdet*dot_v3v3(cros, t1);
 
204
                                if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f + RE_RAYTRACE_EPSILON)) {
 
205
                                        l = divdet * dot_v3v3(cros, t1);
204
206
                                        
205
 
                                        if (l >- RE_RAYTRACE_EPSILON && l < *lambda) {
206
 
                                                uv[0]= u;
207
 
                                                uv[1]= -(1.0f + v + u);
208
 
                                                *lambda= l;
 
207
                                        if (l > -RE_RAYTRACE_EPSILON && l < *lambda) {
 
208
                                                uv[0] = u;
 
209
                                                uv[1] = -(1.0f + v + u);
 
210
                                                *lambda = l;
209
211
                                                return 2;
210
212
                                        }
211
213
                                }
224
226
        float t0[3], t1[3], x[3], r[3], m[3], u, v, divdet, det1;
225
227
        int quad;
226
228
 
227
 
        quad= RE_rayface_isQuad(face);
 
229
        quad = RE_rayface_isQuad(face);
228
230
 
229
231
        copy_v3_v3(co1, face->v1);
230
232
        copy_v3_v3(co2, face->v2);
237
239
        sub_v3_v3v3(t1, co3, co1);
238
240
 
239
241
        cross_v3_v3v3(x, r, t1);
240
 
        divdet= dot_v3v3(t0, x);
 
242
        divdet = dot_v3v3(t0, x);
241
243
 
242
244
        sub_v3_v3v3(m, start, co3);
243
 
        det1= dot_v3v3(m, x);
 
245
        det1 = dot_v3v3(m, x);
244
246
        
245
247
        if (divdet != 0.0f) {
246
 
                divdet= 1.0f/divdet;
247
 
                v= det1*divdet;
 
248
                divdet = 1.0f / divdet;
 
249
                v = det1 * divdet;
248
250
 
249
 
                if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
 
251
                if (v < RE_RAYTRACE_EPSILON && v > -(1.0f + RE_RAYTRACE_EPSILON)) {
250
252
                        float cros[3];
251
253
 
252
254
                        cross_v3_v3v3(cros, m, t0);
253
 
                        u= divdet*dot_v3v3(cros, r);
 
255
                        u = divdet * dot_v3v3(cros, r);
254
256
 
255
 
                        if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
 
257
                        if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f + RE_RAYTRACE_EPSILON))
256
258
                                return 1;
257
259
                }
258
260
        }
261
263
        if (quad) {
262
264
                copy_v3_v3(co4, face->v4);
263
265
                sub_v3_v3v3(t0, co3, co4);
264
 
                divdet= dot_v3v3(t0, x);
 
266
                divdet = dot_v3v3(t0, x);
265
267
 
266
268
                if (divdet != 0.0f) {
267
 
                        divdet= 1.0f/divdet;
268
 
                        v = det1*divdet;
 
269
                        divdet = 1.0f / divdet;
 
270
                        v = det1 * divdet;
269
271
                        
270
 
                        if (v < RE_RAYTRACE_EPSILON && v > -(1.0f+RE_RAYTRACE_EPSILON)) {
 
272
                        if (v < RE_RAYTRACE_EPSILON && v > -(1.0f + RE_RAYTRACE_EPSILON)) {
271
273
                                float cros[3];
272
274
 
273
275
                                cross_v3_v3v3(cros, m, t0);
274
 
                                u= divdet*dot_v3v3(cros, r);
 
276
                                u = divdet * dot_v3v3(cros, r);
275
277
        
276
 
                                if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f+RE_RAYTRACE_EPSILON))
 
278
                                if (u < RE_RAYTRACE_EPSILON && (v + u) > -(1.0f + RE_RAYTRACE_EPSILON))
277
279
                                        return 2;
278
280
                        }
279
281
                }
288
290
MALWAYS_INLINE int intersect_rayface(RayObject *hit_obj, RayFace *face, Isect *is)
289
291
{
290
292
        float dist, uv[2];
291
 
        int ok= 0;
 
293
        int ok = 0;
292
294
        
293
295
        /* avoid self-intersection */
294
296
        if (is->orig.ob == face->ob && is->orig.face == face->face)
295
297
                return 0;
296
298
                
297
299
        /* check if we should intersect this face */
298
 
        if (is->check == RE_CHECK_VLR_RENDER)
299
 
        {
300
 
                if (vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
 
300
        if (is->check == RE_CHECK_VLR_RENDER) {
 
301
                if (vlr_check_intersect(is, (ObjectInstanceRen *)face->ob, (VlakRen *)face->face) == 0)
301
302
                        return 0;
302
303
        }
303
 
        else if (is->check == RE_CHECK_VLR_NON_SOLID_MATERIAL)
304
 
        {
305
 
                if (vlr_check_intersect(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
 
304
        else if (is->check == RE_CHECK_VLR_NON_SOLID_MATERIAL) {
 
305
                if (vlr_check_intersect(is, (ObjectInstanceRen *)face->ob, (VlakRen *)face->face) == 0)
306
306
                        return 0;
307
 
                if (vlr_check_intersect_solid(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
 
307
                if (vlr_check_intersect_solid(is, (ObjectInstanceRen *)face->ob, (VlakRen *)face->face) == 0)
308
308
                        return 0;
309
309
        }
310
310
        else if (is->check == RE_CHECK_VLR_BAKE) {
311
 
                if (vlr_check_bake(is, (ObjectInstanceRen*)face->ob, (VlakRen*)face->face) == 0)
 
311
                if (vlr_check_bake(is, (ObjectInstanceRen *)face->ob, (VlakRen *)face->face) == 0)
312
312
                        return 0;
313
313
        }
314
314
 
315
315
        /* ray counter */
316
316
        RE_RC_COUNT(is->raycounter->faces.test);
317
317
 
318
 
        dist= is->dist;
319
 
        ok= isec_tri_quad(is->start, is->dir, face, uv, &dist);
 
318
        dist = is->dist;
 
319
        ok = isec_tri_quad(is->start, is->dir, face, uv, &dist);
320
320
 
321
321
        if (ok) {
322
322
        
323
323
                /* when a shadow ray leaves a face, it can be little outside the edges
324
324
                 * of it, causing intersection to be detected in its neighbor face */
325
 
                if (is->skip & RE_SKIP_VLR_NEIGHBOUR)
326
 
                {
327
 
                        if (dist < 0.1f && is->orig.ob == face->ob)
328
 
                        {
329
 
                                VlakRen * a = (VlakRen*)is->orig.face;
330
 
                                VlakRen * b = (VlakRen*)face->face;
 
325
                if (is->skip & RE_SKIP_VLR_NEIGHBOUR) {
 
326
                        if (dist < 0.1f && is->orig.ob == face->ob) {
 
327
                                VlakRen *a = (VlakRen *)is->orig.face;
 
328
                                VlakRen *b = (VlakRen *)face->face;
331
329
 
332
330
                                /* so there's a shared edge or vertex, let's intersect ray with
333
331
                                 * face itself, if that's true we can safely return 1, otherwise
334
332
                                 * we assume the intersection is invalid, 0 */
335
 
                                if (a->v1==b->v1 || a->v2==b->v1 || a->v3==b->v1 || a->v4==b->v1
336
 
                                || a->v1==b->v2 || a->v2==b->v2 || a->v3==b->v2 || a->v4==b->v2
337
 
                                || a->v1==b->v3 || a->v2==b->v3 || a->v3==b->v3 || a->v4==b->v3
338
 
                                || (b->v4 && (a->v1==b->v4 || a->v2==b->v4 || a->v3==b->v4 || a->v4==b->v4))) {
 
333
                                if (a->v1 == b->v1 || a->v2 == b->v1 || a->v3 == b->v1 || a->v4 == b->v1 ||
 
334
                                    a->v1 == b->v2 || a->v2 == b->v2 || a->v3 == b->v2 || a->v4 == b->v2 ||
 
335
                                    a->v1 == b->v3 || a->v2 == b->v3 || a->v3 == b->v3 || a->v4 == b->v3 ||
 
336
                                    (b->v4 && (a->v1 == b->v4 || a->v2 == b->v4 || a->v3 == b->v4 || a->v4 == b->v4)))
 
337
                                {
339
338
                                        /* create RayFace from original face, transformed if necessary */
340
339
                                        RayFace origface;
341
 
                                        ObjectInstanceRen *ob= (ObjectInstanceRen*)is->orig.ob;
342
 
                                        rayface_from_vlak(&origface, ob, (VlakRen*)is->orig.face);
 
340
                                        ObjectInstanceRen *ob = (ObjectInstanceRen *)is->orig.ob;
 
341
                                        rayface_from_vlak(&origface, ob, (VlakRen *)is->orig.face);
343
342
 
344
 
                                        if (!isec_tri_quad_neighbour(is->start, is->dir, &origface))
345
 
                                        {
 
343
                                        if (!isec_tri_quad_neighbour(is->start, is->dir, &origface)) {
346
344
                                                return 0;
347
345
                                        }
348
346
                                }
351
349
 
352
350
                RE_RC_COUNT(is->raycounter->faces.hit);
353
351
 
354
 
                is->isect= ok;  // which half of the quad
355
 
                is->dist= dist;
356
 
                is->u= uv[0]; is->v= uv[1];
 
352
                is->isect = ok;  // which half of the quad
 
353
                is->dist = dist;
 
354
                is->u = uv[0]; is->v = uv[1];
357
355
 
358
356
                is->hit.ob   = face->ob;
359
357
                is->hit.face = face->face;
375
373
        RE_RC_COUNT(isec->raycounter->raycast.test);
376
374
 
377
375
        /* setup vars used on raycast */
378
 
        for (i=0; i<3; i++)
379
 
        {
380
 
                isec->idot_axis[i]              = 1.0f / isec->dir[i];
381
 
                
382
 
                isec->bv_index[2*i]             = isec->idot_axis[i] < 0.0 ? 1 : 0;
383
 
                isec->bv_index[2*i+1]   = 1 - isec->bv_index[2*i];
384
 
                
385
 
                isec->bv_index[2*i]             = i+3*isec->bv_index[2*i];
386
 
                isec->bv_index[2*i+1]   = i+3*isec->bv_index[2*i+1];
 
376
        for (i = 0; i < 3; i++) {
 
377
                isec->idot_axis[i]          = 1.0f / isec->dir[i];
 
378
                
 
379
                isec->bv_index[2 * i]       = isec->idot_axis[i] < 0.0f ? 1 : 0;
 
380
                isec->bv_index[2 * i + 1]   = 1 - isec->bv_index[2 * i];
 
381
                
 
382
                isec->bv_index[2 * i]       = i + 3 * isec->bv_index[2 * i];
 
383
                isec->bv_index[2 * i + 1]   = i + 3 * isec->bv_index[2 * i + 1];
387
384
        }
388
385
 
389
386
#ifdef RT_USE_LAST_HIT  
390
387
        /* last hit heuristic */
391
 
        if (isec->mode==RE_RAY_SHADOW && isec->last_hit)
392
 
        {
 
388
        if (isec->mode == RE_RAY_SHADOW && isec->last_hit) {
393
389
                RE_RC_COUNT(isec->raycounter->rayshadow_last_hit.test);
394
390
                
395
 
                if (RE_rayobject_intersect(isec->last_hit, isec))
396
 
                {
 
391
                if (RE_rayobject_intersect(isec->last_hit, isec)) {
397
392
                        RE_RC_COUNT(isec->raycounter->raycast.hit);
398
393
                        RE_RC_COUNT(isec->raycounter->rayshadow_last_hit.hit);
399
394
                        return 1;
405
400
        isec->hit_hint = 0;
406
401
#endif
407
402
 
408
 
        if (RE_rayobject_intersect(r, isec))
409
 
        {
 
403
        if (RE_rayobject_intersect(r, isec)) {
410
404
                RE_RC_COUNT(isec->raycounter->raycast.hit);
411
405
 
412
406
#ifdef RT_USE_HINT
420
414
 
421
415
int RE_rayobject_intersect(RayObject *r, Isect *i)
422
416
{
423
 
        if (RE_rayobject_isRayFace(r))
424
 
        {
425
 
                return intersect_rayface(r, (RayFace*) RE_rayobject_align(r), i);
 
417
        if (RE_rayobject_isRayFace(r)) {
 
418
                return intersect_rayface(r, (RayFace *) RE_rayobject_align(r), i);
426
419
        }
427
 
        else if (RE_rayobject_isVlakPrimitive(r))
428
 
        {
 
420
        else if (RE_rayobject_isVlakPrimitive(r)) {
429
421
                //TODO optimize (useless copy to RayFace to avoid duplicate code)
430
 
                VlakPrimitive *face = (VlakPrimitive*) RE_rayobject_align(r);
 
422
                VlakPrimitive *face = (VlakPrimitive *) RE_rayobject_align(r);
431
423
                RayFace nface;
432
424
                rayface_from_vlak(&nface, face->ob, face->face);
433
425
 
434
426
                return intersect_rayface(r, &nface, i);
435
427
        }
436
 
        else if (RE_rayobject_isRayAPI(r))
437
 
        {
 
428
        else if (RE_rayobject_isRayAPI(r)) {
438
429
                r = RE_rayobject_align(r);
439
430
                return r->api->raycast(r, i);
440
431
        }
466
457
 
467
458
float RE_rayobject_cost(RayObject *r)
468
459
{
469
 
        if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
470
 
        {
 
460
        if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r)) {
471
461
                return 1.0f;
472
462
        }
473
 
        else if (RE_rayobject_isRayAPI(r))
474
 
        {
 
463
        else if (RE_rayobject_isRayAPI(r)) {
475
464
                r = RE_rayobject_align(r);
476
465
                return r->api->cost(r);
477
466
        }
483
472
 
484
473
/* Bounding Boxes */
485
474
 
486
 
void RE_rayobject_merge_bb(RayObject *r, float *min, float *max)
 
475
void RE_rayobject_merge_bb(RayObject *r, float min[3], float max[3])
487
476
{
488
 
        if (RE_rayobject_isRayFace(r))
489
 
        {
490
 
                RayFace *face = (RayFace*) RE_rayobject_align(r);
 
477
        if (RE_rayobject_isRayFace(r)) {
 
478
                RayFace *face = (RayFace *) RE_rayobject_align(r);
491
479
                
492
480
                DO_MINMAX(face->v1, min, max);
493
481
                DO_MINMAX(face->v2, min, max);
494
482
                DO_MINMAX(face->v3, min, max);
495
483
                if (RE_rayface_isQuad(face)) DO_MINMAX(face->v4, min, max);
496
484
        }
497
 
        else if (RE_rayobject_isVlakPrimitive(r))
498
 
        {
499
 
                VlakPrimitive *face = (VlakPrimitive*) RE_rayobject_align(r);
 
485
        else if (RE_rayobject_isVlakPrimitive(r)) {
 
486
                VlakPrimitive *face = (VlakPrimitive *) RE_rayobject_align(r);
500
487
                RayFace nface;
501
488
                rayface_from_vlak(&nface, face->ob, face->face);
502
489
 
505
492
                DO_MINMAX(nface.v3, min, max);
506
493
                if (RE_rayface_isQuad(&nface)) DO_MINMAX(nface.v4, min, max);
507
494
        }
508
 
        else if (RE_rayobject_isRayAPI(r))
509
 
        {
 
495
        else if (RE_rayobject_isRayAPI(r)) {
510
496
                r = RE_rayobject_align(r);
511
497
                r->api->bb(r, min, max);
512
498
        }
518
504
 
519
505
void RE_rayobject_hint_bb(RayObject *r, RayHint *hint, float *min, float *max)
520
506
{
521
 
        if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r))
522
 
        {
 
507
        if (RE_rayobject_isRayFace(r) || RE_rayobject_isVlakPrimitive(r)) {
523
508
                return;
524
509
        }
525
 
        else if (RE_rayobject_isRayAPI(r))
526
 
        {
 
510
        else if (RE_rayobject_isRayAPI(r)) {
527
511
                r = RE_rayobject_align(r);
528
512
                return r->api->hint_bb(r, hint, min, max);
529
513
        }
543
527
 
544
528
void RE_rayobject_set_control(RayObject *r, void *data, RE_rayobjectcontrol_test_break_callback test_break)
545
529
{
546
 
        if (RE_rayobject_isRayAPI(r))
547
 
        {
 
530
        if (RE_rayobject_isRayAPI(r)) {
548
531
                r = RE_rayobject_align(r);
549
532
                r->control.data = data;
550
533
                r->control.test_break = test_break;