Expand description
§Fix glTF coordinate system
A tiny plugin to fix the fact that Bevy does not respect the GLTF coordinate system.
§Usage
Just add the plugin, that’s it:
use bevy::prelude::*;
use bevy_fix_gltf_coordinate_system::prelude::*;
App::new()
.add_plugins(DefaultPlugins)
.add_plugins(FixGltfCoordinateSystemPlugin);
Now, all SceneRoot
s you spawn are now correctly oriented. If you want to exclude a specific scene, add a DoNotFixGltfCoordinateSystem
to it.
§Background
glTF uses +Z as forward, while Bevy uses -Z. However, the glTF importer ignores this fact and pretends that glTF and Bevy use the same coordinate system. The result is that all glTFs imported into Bevy are rotated by 180 degrees. This plugin fixes that.
Modules§
- prelude
- Everything you need to fix the coordinate system of glTF files.
Structs§
- DoNot
FixGltf Coordinate System - Add this component to a scene to prevent it from being fixed. The resulting scene will use the glTF coordinate system unchanged, i.e. what used to be the +Z axis stays the +Z axis.
- FixGltf
Coordinate System Plugin - The plugin to fix the coordinate system of glTFs files. Simply add it to your app to fix all glTFs.