OpenBlocks

OpenBlocks

56M Downloads

The Cannon isn't accurate and I'm going to fix it!

nevercast opened this issue ยท 5 comments

commented

NeverCast,
Tonight, 7pm NZDT, 3/2/2014

Fixing the damn cannon code, because it bothers me, and I have a plan!

commented

I had some interesting progress, but then I decided to actually account for air resistance instead of nulling it, and it ended up in calculus and summations. I've just gone and made a small mod for myself on my server, but will come back to OpenBlocks shortly. Especially as I've 2 weeks off work.

commented

I figured I'd put these here because it relates.

Here are some (untested) equations for the launch velocity:
V0x=xe ln(D)/((D^te)-1)
V0z=ze ln(D)/((D^te)-1)
V0y D t=(gt/(1-D)) + (D((D^te)-1)/((1-D) ln(D))) + ye
Where:
V0x,y,z is the initial velocity of the item from the cannon.
te is the time at which the item reaches its end point in ticks after being launched.
xe,ye,ze is the end point of the travel of the item relative to the cannon.

Hope these work out!
EDIT 1: In order to clarify: to use the formulas, find a te that makes the V0* to be reasonable. Or just set it to 23 ticks and be ok with items moving faster than light.
To state again: THESE FORMULAS ARE COMPLETELY UNTESTED! USE AT YOUR OWN RISK!

commented

No chance

commented

What D: ?

commented

To be honest it's about time we fixed the issues with the cannon. We've
been putting it off for several months now. Good luck NC :)