Catapult

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Rademanc
Posts: 16
Joined: Sat Apr 25, 2009 4:21 pm

Catapult

Post by Rademanc »

Hi.
I would appreciate some ideas on how to construct a catapult.
I want it to fire a rock, but based on how long the user has pressed the fire key.
Any Ideas?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Catapult

Post by Norbo »

A very direct approach would be to get the strength of the shot from the input (some scalar value), and then apply an impulse proportional to that strength on the catapult's arm at some point on the arm or apply a torque directly. You can use the Entity.applyImpulse method for this. When applying an impulse, keep in mind that the position you specify is in world space, not local space.

The catapult's arm could be held in place by a couple of ball socket joints at the base, coming from each side.
Post Reply