@Alanine I see the issue.
You have created 2 totally separate physics world. You even include ammo.js twice.
You have to create the physics environment using enable3d and then you can add you own native ammo.js created objects to that environment.
I will try to upload an example that shows how it works today or tomorrow.
Your library seems to be very interesting I would like to do make a slinghot games with your library. Have you a specific example ? I don’t see this in your webpage.
I don’t have an example. But it shouldn’t be a problem.
During the aim, the body could be kinematic and switches to dynamic once ready to shoot. You just need the proper math for the calculation of the force/direction for shooting.
enable3d just got a whole lot stabler.
Check out the template project on github!
Hey let me know if you ever make a js version instead of ts. I’m still stuck in old mode but sure would use it
I tried hard, but I really couldn’t make npm versions run in a simple react app. someone tried this?
@yannick Hey man headless ammo is the coolest thing. I have a quick question.
Can you apply physics to an object after using setVelocity or setAngularVelocity on them? When I use these functions and collide with anything the physics basically cancel out because I’m directly setting the speeds.
Basically I’m making a basic flight sim but if I use the torque and force commands the physics become way more complex.
This flight sim is made in In cannon.js:
It sets the velocities directly rather than applying force but there’s still physics applied because the velocities are all set in a prestep function.
Is something like that available in Ammo?