nifskope
nifskope copied to clipboard
"Create Convex Shape" enhancements
Multi-collision support
Create Convex Shape currently strips the root collision. Any collision generated should be put into its own NiNode as a sibling to the shape you are creating it for.
List of CVS
A user may want to create collision for the entire mesh, not just one NiTriShape
. This could technically be done by creating a bhkListShape
with a CVS for each NiTriShape
.
Radius
The spell assumes a radius of 0.1, which is actually pretty high. A large amount of bhkCVS have a radius of 0.00, but the vast majority use 0.05.
I did a review of the CVS radiuses in Skyrim.
Best alternative is to allow user choice in the matter. Default to a value, let them change it. Then generate the CVS.
@jonwd7
- In case of creating CVS from specific NiTriShape it would be good to take into account NiTriShape's "Translation, Rotation, Scale" parameters. In recent version of nifskope these are ignored. It would be very useful namely for Skyrim nifs - when I want to create a CVS, I have to make duplicate of given NiTriShape, then set its scale to 0.1 and then I have to apply this transform to NiTriShape before I use function for creating CVS.
- Maybe it would be good to let user to set also a scale ratio of collision vs mesh in NiTriShape (not only Maximum roundof error). Default value of this ratio could be included in Nifskope's settings - some kind of "Default collision mesh scale ratio".
Found this library today: https://code.google.com/p/v-hacd/
It can be useful for creating a list of convex shapes as long as the "concavity" parameter gets set to 0. I will look into integrating it into NifSkope sometime soon.
P.S. The ticket description is a bit out of date... will work on filling that out sometime too.
@jonwd7 It seems very interesting and useful.
Only 2 notes for Nifskope 2.0 Pre-Alpha2 function Create Convex Shape:
- It takes into account Translation only. The Rotation and Scale are ignored but it would be better to take them into account too. So user can be sure he get collision shape which really match the selected NiTriShape.
- Created
bhkConvexVerticesShape
is inserted into end of nif block tree (as last block). It seems that it works like "delete existing child blocks of bhkRigidBody and insert new bhkConvexVerticesShape block". For case that in bhkRigidBody is linkedbhkConvexVerticesShape
block it would be better if that function can replace contens of existingbhkConvexVerticesShape
, so it stays in same place in nif structure.