Foros - Stratos

Proyectos => Jad Engine => Mensaje iniciado por: en 06 de Febrero de 2006, 10:31:39 AM

Título: Non-convex Model Dynamic Physics
Publicado por: en 06 de Febrero de 2006, 10:31:39 AM
 Hi, i wanted to ask if the engine provides any facility for loading/making non-convex dynamic bodies (bodies with multiple convex meshes/hulls) or do i need to do it by hand and load all the convex meshes of the model, make a collision convexhull for each mesh, turn each pair into a rigid body and use joints to keep the body welded together (or isnt that possible or isnt that the way to do it? :) ).

To make the question less abstract, what i'm trying to do is equivalent of taking "Tut-05. Loading a...tank" and loading the tank as a dynamic physics object.
Título: Non-convex Model Dynamic Physics
Publicado por: Haddd en 06 de Febrero de 2006, 10:44:39 AM
 You can create a convex hull from any mesh. See the Tut 18, on the CreateHebe method:

  collision = new HCollision();

  float[] vertices = targetObject.Mesh.ArrayOfVertices();

  collision.CreateConvexHull(vertices);
Título: Non-convex Model Dynamic Physics
Publicado por: auron en 06 de Febrero de 2006, 12:54:42 PM
 At the moment, the exporter doesn't support hierarchies so when you load meshes, they are each loaded as a seperate mesh and aren't attached to each other.

I suppose you would build the convex hulls, like Haddd mentioned, and attach them together with joints, like you suggested. I guess the engine's limited in that sense for the time being.