[SOLVED] Can invert drag motion in mobile fps?
29 June 2017 12:52
29 June 2017 13:08
Solved with my little hack:
In the fps module:
In the fps module:
var move_sensor_cb = function(obj, id, pulse) {
if (pulse == 1) {
var payload = m_ctl.get_sensor_payload(obj, id, 0);
var coords = payload.coords;
if (m_main.detect_mobile()){
_move_delta[0] -= (coords[0] - move_x) * drag_mult;
_move_delta[1] -= (coords[1] - move_y) * drag_mult;
} else {
_move_delta[0] += (coords[0] - move_x) * drag_mult;
_move_delta[1] += (coords[1] - move_y) * drag_mult;
}
move_x = coords[0];
move_y = coords[1];
}
}
03 July 2017 16:35
if (m_main.detect_mobile()){
_move_delta[0] -= (coords[0] - move_x) * drag_mult;
_move_delta[1] -= (coords[1] - move_y) * drag_mult;
} else {
_move_delta[0] += (coords[0] - move_x) * drag_mult;
_move_delta[1] += (coords[1] - move_y) * drag_mult;
}
I think it is a good solution. Also you can freely copy/paste code from modules in the "addons" directory to your application code.
Blend4Web Team
kirill@blend4web.com
kirill@blend4web.com
05 July 2017 15:41
06 July 2017 17:09
06 October 2017 13:14