Dojo.jl
Dojo.jl copied to clipboard
Bouncing Ball
Hi, I want to simulate a bouncing ball using the sphere mechanism, but I can not get it bouncing. Is this due to the unspport of elastic collision? I have tried all three contact types. Thanks so much!
using Dojo using DojoEnvironments using StaticArrays using Plots
timestep = 0.01
mechanism = get_mechanism(:sphere;contact_type = :nonlinear, timestep=timestep, springs = 20000.0,dampers = 10.0,mass = 10)
initialize!(mechanism, :sphere;position = [0;0;5.0],velocity = [3;2;-5.0],angular_velocity=[1.0;1.0;1.0])
storage = simulate!(mechanism, 5, record=true)
vis = visualize(mechanism, storage) render(vis)