| author | Radek Brich <radek.brich@devl.cz> | 
| Mon, 05 May 2008 15:31:14 +0200 | |
| branch | pyrit | 
| changeset 92 | 9af5c039b678 | 
| parent 91 | 9d66d323c354 | 
| child 93 | 96d65f841791 | 
| permissions | -rw-r--r-- | 
| 0 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 1 | /* | 
| 44 | 2 | * scene.cc: classes for objects in scene | 
| 3 | * | |
| 4 | * This file is part of Pyrit Ray Tracer. | |
| 5 | * | |
| 47 
320d5d466864
move Sampler classes to sampler.cc
 Radek Brich <radek.brich@devl.cz> parents: 
46diff
changeset | 6 | * Copyright 2006, 2007, 2008 Radek Brich | 
| 0 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 7 | * | 
| 44 | 8 | * Permission is hereby granted, free of charge, to any person obtaining a copy | 
| 9 | * of this software and associated documentation files (the "Software"), to deal | |
| 10 | * in the Software without restriction, including without limitation the rights | |
| 11 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 12 | * copies of the Software, and to permit persons to whom the Software is | |
| 13 | * furnished to do so, subject to the following conditions: | |
| 14 | * | |
| 15 | * The above copyright notice and this permission notice shall be included in | |
| 16 | * all copies or substantial portions of the Software. | |
| 17 | * | |
| 18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 20 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 21 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 22 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 23 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | |
| 24 | * THE SOFTWARE. | |
| 0 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 25 | */ | 
| 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 26 | |
| 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 27 | #include "scene.h" | 
| 
3547b885df7e
initial commit, raytracer source as written year ago and unchanged since 2007-03-25
 Radek Brich <radek.brich@devl.cz> parents: diff
changeset | 28 | |
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 29 | void Camera::rotate(const Quaternion &q) | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 30 | {
 | 
| 21 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 31 | /* | 
| 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 32 | //non-optimized | 
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 33 | Quaternion res; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 34 | res = q * Quaternion(u) * conjugate(q); | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 35 | u = res.toVector(); | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 36 | res = q * Quaternion(v) * conjugate(q); | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 37 | v = res.toVector(); | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 38 | res = q * Quaternion(p) * conjugate(q); | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 39 | p = res.toVector(); | 
| 21 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 40 | */ | 
| 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 41 | |
| 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 42 | // optimized | 
| 22 | 43 | Float t2 = q.a*q.b; | 
| 44 | Float t3 = q.a*q.c; | |
| 45 | Float t4 = q.a*q.d; | |
| 46 | Float t5 = -q.b*q.b; | |
| 47 | Float t6 = q.b*q.c; | |
| 48 | Float t7 = q.b*q.d; | |
| 49 | Float t8 = -q.c*q.c; | |
| 50 | Float t9 = q.c*q.d; | |
| 51 | Float t10 = -q.d*q.d; | |
| 52 | Float x,y,z; | |
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 53 | x = 2*( (t8 + t10)*p.x + (t6 - t4)*p.y + (t3 + t7)*p.z ) + p.x; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 54 | y = 2*( (t4 + t6)*p.x + (t5 + t10)*p.y + (t9 - t2)*p.z ) + p.y; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 55 | z = 2*( (t7 - t3)*p.x + (t2 + t9)*p.y + (t5 + t8)*p.z ) + p.z; | 
| 91 | 56 | p = Vector(x,y,z); | 
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 57 | x = 2*( (t8 + t10)*u.x + (t6 - t4)*u.y + (t3 + t7)*u.z ) + u.x; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 58 | y = 2*( (t4 + t6)*u.x + (t5 + t10)*u.y + (t9 - t2)*u.z ) + u.y; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 59 | z = 2*( (t7 - t3)*u.x + (t2 + t9)*u.y + (t5 + t8)*u.z ) + u.z; | 
| 91 | 60 | u = Vector(x,y,z); | 
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 61 | x = 2*( (t8 + t10)*v.x + (t6 - t4)*v.y + (t3 + t7)*v.z ) + v.x; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 62 | y = 2*( (t4 + t6)*v.x + (t5 + t10)*v.y + (t9 - t2)*v.z ) + v.y; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 63 | z = 2*( (t7 - t3)*v.x + (t2 + t9)*v.y + (t5 + t8)*v.z ) + v.z; | 
| 91 | 64 | v = Vector(x,y,z); | 
| 21 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 65 | p.normalize(); | 
| 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 66 | u.normalize(); | 
| 
79b516a3803d
naive color driven sub-sampling
 Radek Brich <radek.brich@devl.cz> parents: 
20diff
changeset | 67 | v.normalize(); | 
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 68 | } | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 69 | |
| 22 | 70 | void Camera::move(const Float fw, const Float left, const Float up) | 
| 20 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 71 | {
 | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 72 | eye = eye + fw*p + left*u + up*v; | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 73 | } | 
| 
f22952603f29
new C++ demo: realtime.cc (real-time scene viewer using SDL)
 Radek Brich <radek.brich@devl.cz> parents: 
15diff
changeset | 74 | |
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 75 | /* http://www.siggraph.org/education/materials/HyperGraph/raytrace/rtinter3.htm */ | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 76 | bool BBox::intersect(const Ray &ray, Float &a, Float &b) const | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 77 | {
 | 
| 40 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 78 | register Float tnear = -Inf; | 
| 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 79 | register Float tfar = Inf; | 
| 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 80 | register Float t1, t2; | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 81 | |
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 82 | for (int i = 0; i < 3; i++) | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 83 | 	{
 | 
| 40 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 84 | 		if (ray.dir[i] == 0) {
 | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 85 | /* ray is parallel to these planes */ | 
| 40 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 86 | if (ray.o[i] < L[i] || ray.o[i] > H[i]) | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 87 | return false; | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 88 | } else | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 89 | 		{
 | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 90 | /* compute the intersection distance of the planes */ | 
| 40 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 91 | t1 = (L[i] - ray.o[i]) / ray.dir[i]; | 
| 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 92 | t2 = (H[i] - ray.o[i]) / ray.dir[i]; | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 93 | |
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 94 | if (t1 > t2) | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 95 | swap(t1, t2); | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 96 | |
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 97 | if (t1 > tnear) | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 98 | tnear = t1; /* want largest Tnear */ | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 99 | if (t2 < tfar) | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 100 | tfar = t2; /* want smallest Tfar */ | 
| 40 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 101 | if (tnear > tfar || tfar < 0) | 
| 
929aad02c5f2
Makefile: added help and distclean target, plus small fixes
 Radek Brich <radek.brich@devl.cz> parents: 
38diff
changeset | 102 | return false; /* box missed; box is behind ray */ | 
| 12 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 103 | } | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 104 | } | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 105 | |
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 106 | a = tnear; | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 107 | b = tfar; | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 108 | return true; | 
| 
f4fcabf05785
kd-tree: traversal algorithm (KdTree::nearest_intersection)
 Radek Brich <radek.brich@devl.cz> parents: 
8diff
changeset | 109 | } | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 110 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 111 | #ifndef NO_SIMD | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 112 | // rewrite of BBox::intersect for ray packets | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 113 | mfloat4 BBox::intersect_packet(const RayPacket &rays, mfloat4 &a, mfloat4 &b) const | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 114 | {
 | 
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 115 | mfloat4 origin = rays.o.ma[0]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 116 | mfloat4 invdir = rays.invdir.ma[0]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 117 | mfloat4 t1 = mmul(msub(mset1(L[0]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 118 | mfloat4 t2 = mmul(msub(mset1(H[0]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 119 | mfloat4 tmin = mmin(t1, t2); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 120 | mfloat4 tmax = mmax(t1, t2); | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 121 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 122 | origin = rays.o.ma[1]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 123 | invdir = rays.invdir.ma[1]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 124 | t1 = mmul(msub(mset1(L[1]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 125 | t2 = mmul(msub(mset1(H[1]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 126 | tmin = mmax(mmin(t1, t2), tmin); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 127 | tmax = mmin(mmax(t1, t2), tmax); | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 128 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 129 | origin = rays.o.ma[2]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 130 | invdir = rays.invdir.ma[2]; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 131 | t1 = mmul(msub(mset1(L[2]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 132 | t2 = mmul(msub(mset1(H[2]), origin), invdir); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 133 | tmin = mmax(mmin(t1, t2), tmin); | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 134 | tmax = mmin(mmax(t1, t2), tmax); | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 135 | |
| 92 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 136 | a = tmin; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 137 | b = tmax; | 
| 
9af5c039b678
add MSVC compiler support, make it default for Windows
 Radek Brich <radek.brich@devl.cz> parents: 
91diff
changeset | 138 | return mand(mcmplt(tmin, tmax), mcmpgt(tmax, mZero)); | 
| 86 
ce6abe0aeeae
BBox - RayPacket intersection
 Radek Brich <radek.brich@devl.cz> parents: 
78diff
changeset | 139 | } | 
| 91 | 140 | #endif |