sideeffects / HoudiniEngineForUnreal

Houdini Engine Plugin for Unreal Engine.
http://www.sidefx.com/unreal
Other
1.36k stars 373 forks source link

Add support for collision shape generation. #59

Closed ttvd closed 7 years ago

ttvd commented 8 years ago

We would like to be able to generate additional collision shapes based on attribute value, e.g. _HAPI_UNREAL_ATTRIB_COLLISIONSHAPE .

Filed as RFE: #74260 : Unreal: Add support for collision shape generation.

xDiavalx commented 8 years ago

This should probably also allow the use of the automatic convex hull generation: https://docs.unrealengine.com/latest/INT/Engine/Physics/Collision/HowTo/AddConvexHulls/index.html They can be surprisingly accurate.

Also this is probably related to #61716 (https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=38283) And this is thematically related to native UBX/UCX support (also https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&t=38283). If I am not mistaken, currently you can declare collision meshes in Houdini Engine by grouping them, but instead of using the native system, the mesh is set invisible and used as a per face collision.

ttvd commented 8 years ago

Hello!

Thanks for the summary. Yes; right now we will look for membership of _collisiongeo or _rendered_collisiongeo groups.

Geometry found within _collisiongeo group will be used to create a separate invisible static mesh, with exact triangle collision(set to complex as simple). Similarly, _rendered_collisiongeo will do the same, but will be marked as visible.

Yes; good suggestion, we'll add an option for auto convex hulls too.

robeastham commented 8 years ago

+1 for this

dpernuit commented 7 years ago

Hello!

The generation of all these collision shapes has been added to the latest build of the plug-in ...

Convex Hulls can be generated using the "collision_geo_ucx" and "rendered_collision_geo_ucx" group prefix, and simple collision shapes can be generated using the "collision_geo_simple" and "rendered_collision_geo_simple" prefix.

The type of the simple collider can then be specified by adding it to the group name: box, sphere, capsule, kdop10X, kdop10Y, kdop10Z, kdop18, kdop26

ie: "collision_geo_simple_kdop18" , or "rendered_collision_geo_simple_capsule"