MCPcopy Create free account
hub / github.com/axmolengine/axmol / onTouchesMoved

Method onTouchesMoved

tests/cpp-tests/Source/Physics3DTest/Physics3DTest.cpp:152–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void 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
171void Physics3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event)
172{

Callers

nothing calls this directly

Calls 12

getInstanceFunction · 0.85
lookAtMethod · 0.80
lengthSquaredMethod · 0.80
stopPropagationMethod · 0.80
setPivotPointInBMethod · 0.80
Vec3Function · 0.50
sizeMethod · 0.45
getDeltaMethod · 0.45
setPosition3DMethod · 0.45
getLocationInViewMethod · 0.45
unprojectMethod · 0.45
getNormalizedMethod · 0.45

Tested by

no test coverage detected