All pastes #2057895 Raw Edit

Mine

public text v1 · immutable
#2057895 ·published 2011-05-13 08:47 UTC
rendered paste body
    setlistener("sim/ai/aircraft/impact/bomb", func(n) {
        var node = props.globals.getNode(n.getValue(), 1);
        var solid = node.getNode("material/solid").getValue();
        print ("solid", solid);

        if (solid){

            var impact = geo.Coord.new().set_latlon(
                node.getNode("impact/latitude-deg").getValue(),
                node.getNode("impact/longitude-deg").getValue(),
                node.getNode("impact/elevation-m").getValue());

            geo.put_model("Models/Geometry/Bomb-500lbs-MC/crater.xml", impact,
                node.getNode("impact/heading-deg").getValue(),
                0,
                0);

        } # endif 
        screen.log.write(sprintf("%.3f km bomb",
            geo.aircraft_position().distance_to(impact) / 1000), 1, 0.9, 0.9);

#        fgcommand("play-audio-sample", props.Node.new({
#path : getprop("/sim/fg-root") ~ "/Aircraft/bo105/Sounds",
#file : "HOT.wav",
#volume : 0.2,
#        }));

    });