While my tracer and missile shoot OK and produces an impact I can't get any info out form $explosions.landed_tracers(). I tried to figure out what is the reason as below. I get that $explosions.landed_tracers() is recognized always as an object but any of its properties remain permanently undefined. Any hint to where is my mistake ? Seems as if no tracer is ever landing.
function init_vehicle(){
...
$explosions = this.$query_interface("ot::js::explosions.get");
tracer = $explosions.launch_combo( ecef, {x:75*plasmaquat.x, y:75*plasmaquat.y, z:75*plasmaquat.z}, 10, {x:1,y:1, z:0}, {x:0.3,y:0.3, z:0.3}, 7, 0.1, 0.1, 20, true, true, true );
$explosions.destroy_tracer( tracer );
...
}
function update_frame(dt, engine, brake, steering)
{
...
if( typeof($explosions.landed_tracers())=== null){
info="null";
}
if( typeof($explosions.landed_tracers())=== "undefined"){
info="UNdefined";
}
if(typeof($explosions.landed_tracers()) === 'object'){
info = "object";
if( (typeof($explosions.landed_tracers().wpos) === "undefined")){
impact_pos = "UNdefined";
}else{
impact_pos = $explosions.landed_tracers().wpos.x;
}
if( (typeof($explosions.landed_tracers().hitid) === "undefined")){
hitid = "UNdefined";
}else{
hitid =$explosions.landed_tracers().hitid;
}
if( (typeof($explosions.landed_tracers().attid) === "undefined")){
attid = "UNdefined";
}else{
attid =$explosions.landed_tracers().attid;
}
if (fire_switch == 1){
info = 0;
hitid=0;
attid=0;
mesh=0;
impact_pos=0;
$throw = world.create_instance("outerra/missile/missile", ecef, plasmaquat, false);
entid = $throw.get_geomob(0).get_eid();
$explosions.launch_tracer( ecef, {x:75*plasmaquat.x, y:75*plasmaquat.y, z:75*plasmaquat.z}, 10, {x:1,y:1, z:0}, 0.5, 0.2, 0, 0, tracer , entid , 0 );
tracer = $explosions.launch_combo( ecef, {x:75*plasmaquat.x, y:75*plasmaquat.y, z:75*plasmaquat.z}, 10, {x:1,y:1, z:0}, {x:0.3,y:0.3, z:0.3}, 7, 0.1, 0.1, 20, true, true, true );
}
...
}