| 376 | } |
| 377 | |
| 378 | bool DaylightingControl_Impl::aimAt(const Point3d& target) { |
| 379 | Point3d position = this->position(); |
| 380 | Vector3d vector = target - position; |
| 381 | |
| 382 | if (!vector.normalize()) { |
| 383 | return false; |
| 384 | } |
| 385 | |
| 386 | Vector3d yAxis(0, 1, 0); |
| 387 | Vector3d rotationAxis = yAxis.cross(vector); |
| 388 | |
| 389 | if (!rotationAxis.normalize()) { |
| 390 | return false; |
| 391 | } |
| 392 | |
| 393 | double angle = getAngle(yAxis, vector); |
| 394 | Transformation transformation = Transformation::rotation(rotationAxis, angle); |
| 395 | EulerAngles eulerAngles = transformation.eulerAngles(); |
| 396 | |
| 397 | this->setPsiRotationAroundXAxis(radToDeg(eulerAngles.psi())); |
| 398 | this->setThetaRotationAroundYAxis(radToDeg(eulerAngles.theta())); |
| 399 | this->setPhiRotationAroundZAxis(radToDeg(eulerAngles.phi())); |
| 400 | |
| 401 | return true; |
| 402 | } |
| 403 | |
| 404 | int DaylightingControl_Impl::spaceIndex() const { |
| 405 | return OS_Daylighting_ControlFields::SpaceName; |
nothing calls this directly
no test coverage detected