| 150 | } |
| 151 | |
| 152 | void Physics3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event) |
| 153 | { |
| 154 | if (touches.size() && _camera) |
| 155 | { |
| 156 | auto touch = touches[0]; |
| 157 | auto delta = touch->getDelta(); |
| 158 | |
| 159 | _angle -= AX_DEGREES_TO_RADIANS(delta.x); |
| 160 | _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle))); |
| 161 | _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f)); |
| 162 | |
| 163 | if (delta.lengthSquared() > 16) |
| 164 | { |
| 165 | _needShootBox = false; |
| 166 | } |
| 167 | event->stopPropagation(); |
| 168 | } |
| 169 | } |
| 170 | |
| 171 | void Physics3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event) |
| 172 | { |
nothing calls this directly
no test coverage detected