| 166 | } |
| 167 | #endif |
| 168 | static void b3CreateLookAt(const b3Vector3& eye, const b3Vector3& center, const b3Vector3& up, float result[16]) |
| 169 | { |
| 170 | b3Vector3 f = (center - eye).normalized(); |
| 171 | b3Vector3 u = up.normalized(); |
| 172 | b3Vector3 s = (f.cross(u)).normalized(); |
| 173 | u = s.cross(f); |
| 174 | |
| 175 | result[0 * 4 + 0] = s.x; |
| 176 | result[1 * 4 + 0] = s.y; |
| 177 | result[2 * 4 + 0] = s.z; |
| 178 | |
| 179 | result[0 * 4 + 1] = u.x; |
| 180 | result[1 * 4 + 1] = u.y; |
| 181 | result[2 * 4 + 1] = u.z; |
| 182 | |
| 183 | result[0 * 4 + 2] = -f.x; |
| 184 | result[1 * 4 + 2] = -f.y; |
| 185 | result[2 * 4 + 2] = -f.z; |
| 186 | |
| 187 | result[0 * 4 + 3] = 0.f; |
| 188 | result[1 * 4 + 3] = 0.f; |
| 189 | result[2 * 4 + 3] = 0.f; |
| 190 | |
| 191 | result[3 * 4 + 0] = -s.dot(eye); |
| 192 | result[3 * 4 + 1] = -u.dot(eye); |
| 193 | result[3 * 4 + 2] = f.dot(eye); |
| 194 | result[3 * 4 + 3] = 1.f; |
| 195 | } |
| 196 | |
| 197 | void SimpleCamera::setCameraUpAxis(int upAxis) |
| 198 | { |
no test coverage detected