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

Method onTouchesMoved

tests/cpp-tests/Source/Particle3DTest/Particle3DTest.cpp:95–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93void Particle3DTestDemo::onTouchesBegan(const std::vector<Touch*>& touches, ax::Event* event) {}
94
95void Particle3DTestDemo::onTouchesMoved(const std::vector<Touch*>& touches, ax::Event* event)
96{
97 if (touches.size())
98 {
99 auto touch = touches[0];
100 auto delta = touch->getDelta();
101
102 _angle -= AX_DEGREES_TO_RADIANS(delta.x);
103 _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 0.0f, 100.0f * cosf(_angle)));
104 _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f));
105 }
106}
107
108void Particle3DTestDemo::onTouchesEnded(const std::vector<Touch*>& touches, ax::Event* event) {}
109

Callers

nothing calls this directly

Calls 5

lookAtMethod · 0.80
Vec3Function · 0.50
sizeMethod · 0.45
getDeltaMethod · 0.45
setPosition3DMethod · 0.45

Tested by

no test coverage detected