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

Method onTouchesMoved

tests/cpp-tests/Source/NavMeshTest/NavMeshTest.cpp:115–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115void NavMeshBaseTestDemo::onTouchesMoved(const std::vector<ax::Touch*>& touches, ax::Event* event)
116{
117 if (touches.size() && _camera)
118 {
119 auto touch = touches[0];
120 auto delta = touch->getDelta();
121
122 _angle -= AX_DEGREES_TO_RADIANS(delta.x);
123 _camera->setPosition3D(Vec3(100.0f * sinf(_angle), 50.0f, 100.0f * cosf(_angle)));
124 _camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f));
125
126 if (delta.lengthSquared() > 16)
127 {
128 _needMoveAgents = false;
129 }
130 }
131 touchesMoved(touches, event);
132}
133
134void NavMeshBaseTestDemo::onTouchesEnded(const std::vector<ax::Touch*>& touches, ax::Event* event)
135{

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected