Rename
This commit is contained in:
parent
5591166b3a
commit
b04db5b2f0
@ -169,7 +169,7 @@ pub struct GltfPlugin {
|
||||
/// - glTF models: global -Z.
|
||||
///
|
||||
/// The default is `false`.
|
||||
pub favor_model_coordinates: bool,
|
||||
pub use_model_forward_direction: bool,
|
||||
|
||||
/// Registry for custom vertex attributes.
|
||||
///
|
||||
@ -182,7 +182,7 @@ impl Default for GltfPlugin {
|
||||
GltfPlugin {
|
||||
default_sampler: ImageSamplerDescriptor::linear(),
|
||||
custom_vertex_attributes: HashMap::default(),
|
||||
favor_model_coordinates: false,
|
||||
use_model_forward_direction: false,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -238,7 +238,7 @@ impl Plugin for GltfPlugin {
|
||||
supported_compressed_formats,
|
||||
custom_vertex_attributes: self.custom_vertex_attributes.clone(),
|
||||
default_sampler,
|
||||
default_favor_model_coordinates: self.favor_model_coordinates,
|
||||
default_use_model_forward_direction: self.use_model_forward_direction,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -161,7 +161,7 @@ pub struct GltfLoader {
|
||||
/// - glTF models: global -Z.
|
||||
///
|
||||
/// The default is `false`.
|
||||
pub default_favor_model_coordinates: bool,
|
||||
pub default_use_model_forward_direction: bool,
|
||||
}
|
||||
|
||||
/// Specifies optional settings for processing gltfs at load time. By default, all recognized contents of
|
||||
@ -212,8 +212,8 @@ pub struct GltfLoaderSettings {
|
||||
/// - glTF cameras and glTF lights: global +Z,
|
||||
/// - glTF models: global -Z.
|
||||
///
|
||||
/// If `None`, uses the global default set by [`GltfPlugin::favor_model_coordinates`](crate::GltfPlugin::favor_model_coordinates).
|
||||
pub favor_model_coordinates: Option<bool>,
|
||||
/// If `None`, uses the global default set by [`GltfPlugin::use_model_forward_direction`](crate::GltfPlugin::use_model_forward_direction).
|
||||
pub use_model_forward_direction: Option<bool>,
|
||||
}
|
||||
|
||||
impl Default for GltfLoaderSettings {
|
||||
@ -226,7 +226,7 @@ impl Default for GltfLoaderSettings {
|
||||
include_source: false,
|
||||
default_sampler: None,
|
||||
override_sampler: false,
|
||||
favor_model_coordinates: None,
|
||||
use_model_forward_direction: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -286,9 +286,9 @@ async fn load_gltf<'a, 'b, 'c>(
|
||||
paths
|
||||
};
|
||||
|
||||
let convert_coordinates = match settings.favor_model_coordinates {
|
||||
let convert_coordinates = match settings.use_model_forward_direction {
|
||||
Some(convert_coordinates) => convert_coordinates,
|
||||
None => loader.default_favor_model_coordinates,
|
||||
None => loader.default_use_model_forward_direction,
|
||||
};
|
||||
|
||||
#[cfg(feature = "bevy_animation")]
|
||||
|
@ -33,12 +33,12 @@ To remedy this, users can now change the import behavior to instead favor correc
|
||||
The downside is that glTF cameras and lights that have a global identity transform in glTF will now look to +Z instead of -Z in Bevy.
|
||||
This should not be a problem in many cases, as the whole scene is rotated so that the end result on your screen will be rendered the exact same way.
|
||||
|
||||
To globally opt into the behavior that favors glTF models over glTF cameras, you can set `GltfPlugin::favor_model_coordinates`:
|
||||
To globally opt into the behavior that favors glTF models over glTF cameras, you can set `GltfPlugin::use_model_forward_direction`:
|
||||
|
||||
```rust
|
||||
App::new()
|
||||
.add_plugins(DefaultPlugins.set(GltfPlugin {
|
||||
favor_model_coordinates: true,
|
||||
use_model_forward_direction: true,
|
||||
..default()
|
||||
}))
|
||||
.run();
|
||||
@ -50,9 +50,9 @@ You can also control this on a per-asset-level:
|
||||
let handle = asset_server.load_with_settings(
|
||||
"fox.gltf#Scene0",
|
||||
|settings: &mut GltfLoaderSettings| {
|
||||
settings.favor_model_coordinates = Some(true);
|
||||
settings.use_model_forward_direction = Some(true);
|
||||
},
|
||||
);
|
||||
```
|
||||
|
||||
Setting the above to `None` will fall back to the global setting taken from `GltfPlugin::favor_model_coordinates`.
|
||||
Setting the above to `None` will fall back to the global setting taken from `GltfPlugin::use_model_forward_direction`.
|
||||
|
Loading…
Reference in New Issue
Block a user