How to apply physics force to speed ship vessel

344 Views Asked by At

i know buoyancy and apply ed it ; my ship is float on the water now. but i don't know how to apply force to control and navigate my speed boat ?

i'm using havok physics engine. my code's like this

body->applyForce( stepInfo.m_deltaTime,forwardWorld, pointx );

pointx = my apply force point (-75,0,0); this point is a 3d point in back side of my ship

forwardWorld = force value and direction of it (100,0,0); apply 100Nm to back side of my ship

my pointx value is always static.

my forwardWorld values change every time for exam :

when i want to my ship go to front set it to (100,0,0)

when i want to my ship go to right i set it to (0,0,100)

when i want to my ship go to left i set it to (0,0,-100)

but this is'n a good way because my ship will drag and shift to left or right in upper speed and this is mistake please help me.

1

There are 1 best solutions below

0
On

You didn't say what you need the model for. If it's a game then perhaps my advice will not satisfy you but if it's for some sort of engineering problem solving then I recommend building your own manoeuvring model. This may sound intimidating but in reality it boils down to solving three differential equations (roll, yaw and surge; you can also add sway depending on what you are interested in). You can easily solve them by integration using, say, Range-Kutta method.

Here is a paper giving a nice overview of what I'm talking about (there are lots on-line): https://scl.snu.ac.kr/SCL_Research/data/research/science.pdf

You will need to find coefficients for your equations of motion. There are some in the paper I listed above, many more can be found on the web. For a start, I recommend going for the KRISO data, they are widely available and well presented in the literature.

Edit: I don't like MatLab but if you have access to it then you can solve your equations really easily by building a Simulink model.