Simulation of sonar response using ray-casting