Physics float in water

Get help using Construct 2

Post » Thu Apr 19, 2018 4:22 am

I’m on my phone but offhand:

The calculated area will be zero when there’s no overlap. So the forces will evaluate to zero too because they are multiples by the area.

I just kind of threw the three examples together, but the idea is to just tweak the numbers in the equations. I think I tried something different for the chipmunk damping maybe that’s no good?

The two behaviors have many differences. I made no effort to match them up.
B
101
S
39
G
134
Posts: 5,588
Reputation: 85,514

Post » Thu Apr 19, 2018 11:24 am

Wow @R0J0hound !

Great use of math (as always) and arrays !
I notice it is very cpu intensive with box 2d .
But your logic approach (specially with the use of arrays) is a gem !

Cheers!
B
42
S
18
G
1
Posts: 64
Reputation: 3,878

Post » Sat Apr 21, 2018 5:40 pm

I had a look around at some other implementations for buoyancy that can give some more ideas.
https://github.com/lawrencelomax/Chipmu ... Buoyancy.c
The damping force was calculated with the relative velocity of the part under water. I forgot to do that in the examples.
The angular damping is proportionate to the inertia of the shape under water. Could give improved results.

http://www.iforce2d.net/b2dtut/buoyancy
Again it uses relative velocity for damping.
It has a cool idea to do the damping per edge to give more realistic results.
Also it shows ideas how to take the whole thing further with lift. Very interesting.
B
101
S
39
G
134
Posts: 5,588
Reputation: 85,514

Previous

Return to How do I....?

Who is online

Users browsing this forum: visionarybeast and 6 guests