Ray test callback not excuted....
30 October 2017 13:01
I clone the code snipet by making project in demo page.
And I found something interesting.
I add a breakpoint in below codes.
Ray test instructions have been added in scene._physics.ray_tests.
But callbacks always been hang up…
Anyone can help?
And I found something interesting.
exports.append_ray_test = function(obj, from, to, collision_id, callback,
autoremove, calc_all_hits, calc_pos_norm, ign_src_rot) {
var id = get_unique_ray_test_id();
var test = {
id: id,
body_id: obj ? obj.physics.body_id : 0,
from: new Float32Array(from),
to: new Float32Array(to),
collision_id: collision_id,
collision_id_num: col_id_num(collision_id),
autoremove: autoremove,
calc_all_hits: calc_all_hits,
calc_pos_norm: calc_pos_norm,
ign_src_rot: ign_src_rot,
callback: callback
}
// NOTE: it's not possible to determine the worker in no obj specified
var worker = find_worker_by_body_id(test.body_id) || _workers[0];
var scene = find_scene_by_worker(worker);
var sphy = scene._physics;
sphy.ray_tests[id] = test;
sphy.ray_tests_arr.push(test);
m_ipc.post_msg(worker, m_ipc.OUT_APPEND_RAY_TEST, test.id, test.body_id, test.from,
test.to, test.collision_id_num, test.autoremove,
test.calc_all_hits, test.calc_pos_norm, test.ign_src_rot);
return id;
}
I add a breakpoint in below codes.
Ray test instructions have been added in scene._physics.ray_tests.
But callbacks always been hang up…
Anyone can help?
30 October 2017 15:19
31 October 2017 05:09
31 October 2017 06:07