How to create a physics aggregate from GPU vertex data?

First, I’d separate PhysicsAggregate into PhysicsBody and PhysicsShape (see this post). But that’s where you’d be stuck. The interface for creating a shape of type MESH only exposes methods that take meshes as input.

It’s only in the plugin that mesh vertices are captured by the MeshAccumulate() class to parse through the mesh vertices (and indices) with _addMesh(). This adds to the this._vertices array. You could extend that class with something like _addVertices(vertices,indices), but you’d also have to tie it into PhysicsShape.

A pretty daunting task, though it might be a worthwhile PR.

1 Like