Jump to content
Sign in to follow this  
GalComT

hight of waterline

Recommended Posts

How exactly do i set the water level of an APC, i know it has sth to do with the Mass (geometry LOD) of the model, i have tried multiple things moving wait from one end to the other, from top to bottom, i have seen various results, but i was unable to find a some kind of ratinal system behind the changes i have done and the resluts i had.

so any help on how to solve this lil prob would be great.

Share this post


Link to post
Share on other sites

It seems to me that the waterline is determined by the center of gravity (cg) of the entire geometry lod.  Select all of the components in the geometry lod to see where the cg is.  You can tell where the cg is by seeing where the blue lines meet to form a dot.  Then adjust it by selecting different parts of the model and adjusting the weight of those parts.  When you think you have it right, select all of the components again to see exactly where the cg is.

I hope that is clear.

Share this post


Link to post
Share on other sites

yes i have tried that a cup of times (trial and error), but the result i was hopeing was not appearing.

Share this post


Link to post
Share on other sites

To adjust the nose up/down, you can shift the mass around the

c.o.g. To adjust the overall 'ride height' simply change the overall

mass - heavier means the unit sinks lower.

Share this post


Link to post
Share on other sites

well adjusting the mass arround the C.o.G works to adjust nose depth, but after a certain mass it just stops goin down farther, i had the steps from 1000 to 5000 to 10000 to 15000 had imidiate results but than from 15000 to 20000 to 40000 i had no result and i even had the feeling that from 30000 to 40000 it had no result at all.

Share this post


Link to post
Share on other sites

adjust the model to the red horizontal centre line in O2

pretend the line is the water mark you want.

Dont use land contact lod.

Thats if your APC is a boat, if vehicle then dunno.

Adding mass to geo lod wont do anything.

Adjusting the mass will adjust how the boat sits in the water

but not the depth just lean.

Share this post


Link to post
Share on other sites

It seems to me that >floating-enabled< wheeled land vehicles (edit: =car-class) can only sink (with their landcontact vertices) to a layer which is located 1.0 meter below the water surface. These vehicles stand on the vertices "levy/pravy xxxi tlumic" in the "LandContact"-LOD.

If you put an animation to these vertices, which raises them in order to let the vehicle sink deeper when in the water (define the animations in config.cpp and write a script which determines when the vehicle is going into the water), you unfortunately partly cut the hard coded animations (for better terrain following capabilities) off from the wheels.

The smooth contact and collision detection with the ground is then no longer determined by these "tlumic"-points, but directly from the wheel geometry (levy/pravy predni/dalsi/prostredni/zadni) in the visible LODs (0.00 etc.) which makes them a little bumpy. Most visible annoyance is that they sometimes lift themselves a little above the ground, as if there is an invisible bump on the ground which they are rolling over.

This can be overcome partly by very intense fine tuning of the config (damperSize [spring travel, in meters] and damperForce [higher=softer]), and different distances of the wheel geometries and landcontact points from the chassis (see below). It does not help to reposition the entire model relative to the origin in O2. Begin with creating the wheels in >maximum< elongated suspension position and place the (animated) LandContact points in LC-LOD a little below the expected position under load from the chassis, as you have to consider that the gear additionally sinks down in the springs. Apparently, the vehicle still stands and springs on the land-contact points, while the wheels (which are maximum elongated in the pbo) seem to be weightless or at least do not obey DamperForce anymore. You have to reposition them separately.

Adjust the behavior of chassis, landcontact and wheels via damperForce in the config and their relative positions in the pbo until you are satisfied.

For the relative positions of chassis, wheels and LC-points you might refer to this image: http://www.tacticalblunder.com/~beedee/BTR/BTRlandcontact.jpg

This one has 13600 mass (in pbo) and config settings of damperSize = 0.18; and damperForce = 24;

Edit:

Oh, and it works:

http://www.tacticalblunder.com/~beedee/BTR/BTRwater.jpg

Share this post


Link to post
Share on other sites

BD - Interesting stuff. Overall mass (as well as distribution)

definitely has an effect on addons defined as:

class APC{[...] canFloat =1; [...]};

I've just been working on the LVTP for Falklands, but I didn't test

to the extent Galcom has. Interesting that there's not a strict

Archimedes relationship going on, but that would involve

calculating the volume displaced, which would be hard for a

generic model, obviously.

But it may (probably will) be different for class Car.

Share this post


Link to post
Share on other sites

FM, from my lousy memory I think you're right; I believe I've tested my BTR with a >tracked< APC-vehicle class once, and I think it didn't show the mysterious (-1)m barrier if my memory is right. For my wheeled APC I didn't follow this approach any further though, because IMO it looked and behaved too strange for a wheeled vehicle.

Just from the >wheeled< vehicle in GalComT's avatar and his banner I assumed his problem was with a >wheeled<, car-class APC?!

Share this post


Link to post
Share on other sites

yep it is a car class APC, im currently aplying the changes as Beedee has posted. hopefully it will work.

Share this post


Link to post
Share on other sites

ok i got that all done and it seems to be working, the only problem i have is, the detection command for when the actual swimming begins to activate the animation of the LC Lod

Share this post


Link to post
Share on other sites

I did it this way:

init-eventhandler script:

Quote[/b] ]_btr = _this select 0

~0.5

;     lift by 0.2 meters to let it bump onto ground and activate dampers

;     necessary as an >empty< vehicle spawns in maximum elongated suspension position until someone enters vehicle, looks strange

_btr setpos [(GetPos _btr select 0),(GetPos _btr select 1),((GetPos _btr select 2) + 0.2)]

;     execute permanently running "eventgenerator"-script which monitors height above ground

_btr exec "\BDE_btr80\BDE_btr80_swimming.sqs"

exit

BDE_btr80_swimming.sqs-script:

Quote[/b] ];     lag avoiding techniques for uncritical eyecandy stuff:

;     basic loop runtime depends on player's computer performance

_timeruncrit = (2000/benchmark)

;     adding slight desynchronization of loop runtime to avoid lag when several BTRs are on the map and each one is executing this script simultaneously

_timerdesync = random 0.2

#loop

?(!alive _this): exit

~(_timeruncrit + _timerdesync)

;     always "normal" suspension position...

_anim = 0

;     ... except vehicle is in deep water so height decreases below -0.7 meters.

;     when getting back onto the shore this condition is no longer fulfilled, so suspension elongates again

?(getPos _this select 2 < -0.7): _anim = 1

;     anims for "xxx tlumic"-sections are named "L1Anim-R4Anim" in my config.cpp

_this animate ["L1Anim", _anim]

_this animate ["L2Anim", _anim]

_this animate ["L3Anim", _anim]

_this animate ["L4Anim", _anim]

_this animate ["R1Anim", _anim]

_this animate ["R2Anim", _anim]

_this animate ["R3Anim", _anim]

_this animate ["R4Anim", _anim]

goto "loop"

exit

btw, for my BTR I've set animation time to 1.2 seconds in the config. Too short animation times make the vehicle jump up when entering the shore, and with too long times it looks like the vehicle is partly dug in the sand for a moment. Adjust if necessery.

Share this post


Link to post
Share on other sites

ok that worked well, havent done any fine tunning for the used vehicle yet though. thx a lot ;)

greeting GalComT

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×