Game4all / bevy_vox_mesh

A bevy engine plugin for loading magica voxel files directly in bevy as usable meshes.
MIT License
32 stars 8 forks source link

.Vox Meshes are imported offset within large blank mesh #7

Open madamc opened 1 year ago

madamc commented 1 year ago

In the "basic" example, if you spawn a cube at the same location as a .vox model, it appears that the .vox model is imported within a larger shape, but is positioned at one of the corners of the invisible shape. If you rotate the transform of the .vox mesh, it rotates around the center point of the invisible shape.

Game4all commented 1 year ago

The origin of the loaded vox meshes is at the the origin of the shape containing them ((0, 0, 0)), so the one of the bottom corners as you mentionned. An option to add an offset to the meshes can probably be added to set their origin to the "mesh" gravity center, as per what bevy does by default.