pub struct Camera {
pub projection_matrix: Mat4,
pub name: Option<String>,
pub window: WindowId,
pub depth_calculation: DepthCalculation,
pub near: f32,
pub far: f32,
}
Fields§
§projection_matrix: Mat4
§name: Option<String>
§window: WindowId
§depth_calculation: DepthCalculation
§near: f32
§far: f32
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn world_to_screen(
&self,
windows: &Windows,
camera_transform: &GlobalTransform,
world_position: Vec3,
) -> Option<Vec2>
pub fn world_to_screen( &self, windows: &Windows, camera_transform: &GlobalTransform, world_position: Vec3, ) -> Option<Vec2>
Given a position in world space, use the camera to compute the screen space coordinates.
Trait Implementations§
Source§impl GetTypeRegistration for Camera
impl GetTypeRegistration for Camera
Source§impl Reflect for Camera
impl Reflect for Camera
fn type_name(&self) -> &str
fn any(&self) -> &(dyn Any + 'static)
fn any_mut(&mut self) -> &mut (dyn Any + 'static)
fn clone_value(&self) -> Box<dyn Reflect>
fn set(&mut self, value: Box<dyn Reflect>) -> Result<(), Box<dyn Reflect>>
fn apply(&mut self, value: &(dyn Reflect + 'static))
fn reflect_ref(&self) -> ReflectRef<'_>
fn reflect_mut(&mut self) -> ReflectMut<'_>
Source§fn serializable(&self) -> Option<Serializable<'_>>
fn serializable(&self) -> Option<Serializable<'_>>
Returns a serializable value, if serialization is supported. Otherwise
None
will be
returned.Source§fn reflect_hash(&self) -> Option<u64>
fn reflect_hash(&self) -> Option<u64>
Returns a hash of the value (which includes the type) if hashing is supported. Otherwise
None
will be returned.Source§impl Struct for Camera
impl Struct for Camera
fn field(&self, name: &str) -> Option<&(dyn Reflect + 'static)>
fn field_mut(&mut self, name: &str) -> Option<&mut (dyn Reflect + 'static)>
fn field_at(&self, index: usize) -> Option<&(dyn Reflect + 'static)>
fn field_at_mut(&mut self, index: usize) -> Option<&mut (dyn Reflect + 'static)>
fn name_at(&self, index: usize) -> Option<&str>
fn field_len(&self) -> usize
fn iter_fields(&self) -> FieldIter<'_>
fn clone_dynamic(&self) -> DynamicStruct
Auto Trait Implementations§
impl Freeze for Camera
impl RefUnwindSafe for Camera
impl Send for Camera
impl Sync for Camera
impl Unpin for Camera
impl UnwindSafe for Camera
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates
Self
using data from the given World