Move vertices of loaded spatials

Hello,

is it possible to move around the vertices of a spatial I have loaded with the asset manager? I created some cube models in Blender and added textures to them. I load them in and now I want to move their vertices. I know that you can move all of them at once by moving the whole spatial, but I want to move a single one, while the others remain in place.

moving the spatial, doesn’t really move the vertices, it just modifies the ModelView matrix of the spatial; the mesh never moves (thats how you can share the same mesh for different spatials). If you want to move vertices of the mesh, then you need to get the vertex Position Buffer and modify that (don’t create a new one).

The custom mesh wiki should be able to help here

But this visually modifies all meshes of the same type?

yes (unless they are animated)

Or you could use a vertex shader. It really depends on just what you are trying to do.

My game world is made up of multiple pieces. I want the player to be able to modify the shape of some, by lowering or raising their vertices for example.

If your using the same mesh multiple times, you will need to deep clone it (which creates new buffers for it), and then modify them as needed. This approach is probably easier, and is persistent which is good, but it requires more memory than a vertex shader. If you need to use the vertices afterwards (to create physics collision shapes for instance), then you need to modify the buffer

Sounds like you should look at the custom mesh stuff. There is a section in the tutorials on it.