New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GridMap - Include transforms of tile object's children when generating .meshlib file #11722
Comments
What i did to move things off center is make sure the mesh itself has its
center point changed.
Ie, in blender move the mesh in edit mode instead of object mode. The
advantage here is also that if you make changes to your blender file and
export to dea, you don’t have to do all your changes again in godot, i
found this workflow incredibly effective
On Sat, 30 Sep 2017 at 11:44 pm, Scott ***@***.***> wrote:
When creating a meshlib for use with a GridMap, the engine currently
forces all components of each tile to be centred. This makes sense for
neatly rotatable tiles of uniform size. But in some use cases, you want
objects that are off-centre, and you still want them to have collision
details.
[image: image]
<https://user-images.githubusercontent.com/1318345/31046141-f064dd3e-a636-11e7-9453-9f3854774f0d.png>
- My bookshelf model is deliberately off-centre so that it can be
placed against a wall (it only takes up half a grid-space along one axis)
- If I want to add a StaticBody with a BoxCollisionShape, I can't
offset them to cover just the geometry (because they don't export their
transforms, they are locked to the centre of the tile, or grid space)
- I can centre its pivot in my modelling program, then I can apply the
StaticBody and BoxCollisionShape. This will give me correct collision
geometry, but my object is then forced to be in the centre of the
tile/grid-space (which is undesired).
[image: image]
<https://user-images.githubusercontent.com/1318345/31046153-20d1a8f8-a637-11e7-9efb-709edb698490.png>
- Ideally, the children of the MeshInstance nodes should retain their
transforms when a .meshlib is created from a scene.
This effect is exaggerated if you imagine the bookshelf is a painting, or
something thin that you would typically mount on a wall, not in the centre
of a grid space.
You can also Image a half-tile object in a grid space would be affected by
this issue.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#11722>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AB2vaRzMvGnMlF6X5HxGUQXbqAhgrR3Rks5snkW0gaJpZM4PpkCs>
.
--
Kindest regards,
Bastiaan Olij
https://www.facebook.com/bastiaan.olij
https://www.youtube.com/channel/UCrbLJYzJjDf2p-vJC011lYw
https://github.com/BastiaanOlij
|
That is actually one of the cases that I outlined above. Offsetting the meshes isn't a problem at all, because you can just offset them in your modelling software of choice. The issue is that you can't use collision information for meshes that are off centre, because the transforms of child nodes aren't stored when creating the .meshlib file. This means that CollisionShapes and StaticBodies are forced to be centred, even when the source model is not. Specifically in the screenshot above, the StaticBody would need to be offset to match the offset of the model - which is currently impossible. |
Having this functionality would also allow you to composite tiles from multiple meshes, although I'm not sure how useful that would be to have. |
kicking to 3.1, out of time |
This is more like a wishlist enhacement more than a bug, if someone wants to do it in MeshLibraryEditorPlugin, feel free. |
…rary Would have added mesh transform, but realized that will cause problems when moving the mesh around the scene for visualization purposes. Closes godotengine#11722
If the 2D tileset editor has this, then why wouldn't the 3D GridMap have this offset feature? |
(currently using Godot 3.0, build from the 27th of September)
When creating a meshlib for use with a GridMap, the engine currently forces all components of each tile to be centred. This makes sense for neatly rotatable tiles of uniform size. But in some use cases, you want objects that are off-centre, and you still want them to have collision details.
This effect is exaggerated if you imagine the bookshelf is a painting, or something thin that you would typically mount on a wall, not in the centre of a grid space.
You can also imagine a half-tile object in a grid space would be affected by this issue.
The text was updated successfully, but these errors were encountered: