`viewport()` + `replace_skybox()` for `Camera`
@@ -151,6 +151,11 @@ impl Camera {
self
}
+ /// Returns current viewport.
+ pub fn viewport(&self) -> Rect<f32> {
+ self.viewport
+ }
+
/// Calculates viewport rectangle in pixels based on internal resolution-independent
/// viewport. It is useful when you need to get real viewport rectangle in pixels.
///
@@ -264,6 +269,11 @@ impl Camera {
self.sky_box.as_deref()
}
+ /// Replaces the skybox.
+ pub fn replace_skybox(&mut self, new: Option<Box<SkyBox>>) -> Option<Box<SkyBox>> {
+ std::mem::replace(&mut self.sky_box, new)
+ }
+
/// Sets new environment.
pub fn set_environment(&mut self, environment: Option<Texture>) -> &mut Self {
self.environment = environment;
