14 const float acx = ac.
getX();
15 const float acy = ac.
getY();
16 const float acz = ac.
getZ();
17 const float arx = ar.
getX();
18 const float ary = ar.
getY();
19 const float arz = ar.
getZ();
33 float lengthSq = mx0 * mx0 + mx1 * mx1 + mx2 * mx2;
35 const float invLength = 1.0f / std::sqrt(lengthSq);
41 lengthSq = my0 * my0 + my1 * my1 + my2 * my2;
43 const float invLength = 1.0f / std::sqrt(lengthSq);
49 lengthSq = mz0 * mz0 + mz1 * mz1 + mz2 * mz2;
51 const float invLength = 1.0f / std::sqrt(lengthSq);
59 m.
getElement(3, 0) + mx0 * acx + mx1 * acy + mx2 * acz,
60 m.
getElement(3, 1) + my0 * acx + my1 * acy + my2 * acz,
61 m.
getElement(3, 2) + mz0 * acx + mz1 * acy + mz2 * acz
64 std::abs(mx0) * arx + std::abs(mx1) * ary + std::abs(mx2) * arz,
65 std::abs(my0) * arx + std::abs(my1) * ary + std::abs(my2) * arz,
66 std::abs(mz0) * arx + std::abs(mz1) * ary + std::abs(mz2) * arz
77 const float tcx = _center.getX();
78 const float tcy = _center.getY();
79 const float tcz = _center.getZ();
80 const float thx = _halfExtents.getX();
81 const float thy = _halfExtents.getY();
82 const float thz = _halfExtents.getZ();
83 float tminx = tcx - thx;
84 float tmaxx = tcx + thx;
85 float tminy = tcy - thy;
86 float tmaxy = tcy + thy;
87 float tminz = tcz - thz;
88 float tmaxz = tcz + thz;
96 const float ominx = ocx - ohx;
97 const float omaxx = ocx + ohx;
98 const float ominy = ocy - ohy;
99 const float omaxy = ocy + ohy;
100 const float ominz = ocz - ohz;
101 const float omaxz = ocz + ohz;
103 if (ominx < tminx) tminx = ominx;
104 if (omaxx > tmaxx) tmaxx = omaxx;
105 if (ominy < tminy) tminy = ominy;
106 if (omaxy > tmaxy) tmaxy = omaxy;
107 if (ominz < tminz) tminz = ominz;
108 if (omaxz > tmaxz) tmaxz = omaxz;
110 _center =
Vector3((tminx + tmaxx) * 0.5f, (tminy + tmaxy) * 0.5f, (tminz + tmaxz) * 0.5f);
111 _halfExtents =
Vector3((tmaxx - tminx) * 0.5f, (tmaxy - tminy) * 0.5f, (tmaxz - tminz) * 0.5f);