Jump to content

Floatey mesh havok profiles and how to fix


MadCat221

Recommended Posts

Alright... So you managed to get your havok-enabled item to flop about properly in the game.  Woo!  Your NIFSkopery skills have increased a level!

 

But then you notice that it just doesn't rest on the surface, even a surface that everything else rests flat on.  Arg!  Despite re-exporting the havok profile repeatedly and splicing it in, making it smaller each time, it continually just floats there.  What to do?

 

I had that situation recently, when making the Varla Stone (check my image gallery).  While on the verge of saying "screw it, it's stuck that way"... I noticed that "Radius" in the bhkConvexVerticesShape block was not grayed out... it was a manipulable value.  The NIFSkope descriptor is "The radius of the sphere that encloses the shape"... but that's a bit confusing.  It'd be more accurate to say "the distance from the havok profile's surface where collision will occur".  This value is present in kinds of havok mesh data blocks other than bhkConvexVerticesShapes as well, and likely havs the same function with them.

 

Fiddle with this value in NIFSkope until you get it to rest properly on a verified flat surface like a tabletop, either in-game or activating havok mode in the CK.

 

Many USKP fixes pertaining to floating havok-ey objects at rest have already been done since this discovery was made, and will be in the big V2.0 patch coming up.

Link to comment
Share on other sites

Any idea on the relationship of that value with the object's dimensions and its collision mesh ? It would be great if there was a way to calculate it, or at least to estimate it. Parameters that have to be adjusted by trial and error leave me in a somewhat unhappy state ...

Link to comment
Share on other sites

Funny thing - if you drop the radius to 0 and then make a convex hull that fits the shape, the game uses the exact shape as its guide for collision interaction.

 

So I for one am beyond convinced that "radius" was a very bad term to pick for that setting since it isn't really what's going on. It really does seem to be more of an "interact at X distance from edge" setting.

Link to comment
Share on other sites

No. You have to have a perfectly form fitting collision hull before setting it to 0 will work. Otherwise you have to test values and check the havok sim in the CK to see how it works out.

Link to comment
Share on other sites

So I for one am beyond convinced that "radius" was a very bad term to pick for that setting since it isn't really what's going on.

 

Actually not. From what you say, it appears that the engine places a sphere of said radius on every vertex of the collision mesh and uses the inner surface of the resulting combined shape for its calculations.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...