Camera

Struct Camera 

Source
pub struct Camera {
Show 37 fields pub m_BackGroundColor: ColorRGBA, pub m_ClearFlags: u32, pub m_CullingMask: BitField, pub m_Depth: f32, pub m_Enabled: u8, pub m_GameObject: PPtr, pub m_NormalizedViewPortRect: Rectf, pub m_RenderingPath: i32, pub m_TargetTexture: PPtr, pub orthographic: bool, pub far_clip_plane: Option<f32>, pub field_of_view: Option<f32>, pub m_AllowDynamicResolution: Option<bool>, pub m_AllowMSAA: Option<bool>, pub m_Anamorphism: Option<f32>, pub m_Aperture: Option<f32>, pub m_BarrelClipping: Option<f32>, pub m_BladeCount: Option<i32>, pub m_Curvature: Option<Vector2f>, pub m_FocalLength: Option<f32>, pub m_FocusDistance: Option<f32>, pub m_ForceIntoRT: Option<bool>, pub m_GateFitMode: Option<i32>, pub m_HDR: Option<bool>, pub m_Iso: Option<i32>, pub m_LensShift: Option<Vector2f>, pub m_OcclusionCulling: Option<bool>, pub m_SensorSize: Option<Vector2f>, pub m_ShutterSpeed: Option<f32>, pub m_StereoConvergence: Option<f32>, pub m_StereoMirrorMode: Option<bool>, pub m_StereoSeparation: Option<f32>, pub m_TargetDisplay: Option<i64>, pub m_TargetEye: Option<i32>, pub m_projectionMatrixMode: Option<i32>, pub near_clip_plane: Option<f32>, pub orthographic_size: Option<f32>,
}
Expand description

Camera is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: A Camera is a device through which the player views the world. A screen space point is defined in pixels. The bottom-left of the screen is (0,0); the right-top

is (pixelWidth,pixelHeight). The z position is in world units from the Camera.A viewport space point is normalized and relative to the Camera. The bottom-left of the Camera is

(0,0); the top-right is (1,1). The z position is in world units from the Camera.A world space point is defined in global coordinates (for example, Transform.position).See Also: camera component.

Fields§

§m_BackGroundColor: ColorRGBA

The color with which the screen will be cleared.

§m_ClearFlags: u32

How the camera clears the background.

§m_CullingMask: BitField

This is used to render parts of the Scene selectively.

§m_Depth: f32

Camera’s depth in the camera rendering order.

§m_Enabled: u8

Enabled Behaviours are Updated, disabled Behaviours are not.

§m_GameObject: PPtr

The game object this component is attached to. A component is always attached to a game object. PPtr<GameObject>: (3.4.0 - 2022.3.2f1)

§m_NormalizedViewPortRect: Rectf§m_RenderingPath: i32

The rendering path that should be used, if possible.

§m_TargetTexture: PPtr

Destination render texture. PPtr<RenderTexture>: (3.4.0 - 2022.3.2f1)

§orthographic: bool

Is the camera orthographic (true) or perspective (false)?

§far_clip_plane: Option<f32>

The distance of the far clipping plane from the Camera, in world units. f32: (3.4.0 - 2022.3.2f1)

§field_of_view: Option<f32>

The vertical field of view of the Camera, in degrees. f32: (3.4.0 - 2022.3.2f1)

§m_AllowDynamicResolution: Option<bool>

Dynamic Resolution Scaling. bool: (2017.3.0b1 - 2022.3.2f1)

§m_AllowMSAA: Option<bool>

MSAA rendering. bool: (5.6.0b1 - 2022.3.2f1)

§m_Anamorphism: Option<f32>

The camera anamorphism. To use this property, enable UsePhysicalProperties. f32: (2022.2.0b1 - 2022.3.2f1)

§m_Aperture: Option<f32>

The camera aperture. To use this property, enable UsePhysicalProperties. f32: (2022.2.0b1 - 2022.3.2f1)

§m_BarrelClipping: Option<f32>

The camera barrel clipping. To use this property, enable UsePhysicalProperties. f32: (2022.2.0b1 - 2022.3.2f1)

§m_BladeCount: Option<i32>

The blade count in the lens of the camera. To use this property, enable UsePhysicalProperties. i32: (2022.2.0b1 - 2022.3.2f1)

§m_Curvature: Option<Vector2f>

The curvature of the blades. To use this property, enable UsePhysicalProperties. Vector2f: (2022.2.0b1 - 2022.3.2f1)

§m_FocalLength: Option<f32>

The camera focal length, expressed in millimeters. To use this property, enable UsePhysicalProperties. f32: (2018.2.0b1 - 2022.3.2f1)

§m_FocusDistance: Option<f32>

The focus distance of the lens. To use this property, enable UsePhysicalProperties. f32: (2022.2.0b1 - 2022.3.2f1)

§m_ForceIntoRT: Option<bool>

bool: (5.6.0b1 - 2022.3.2f1)

§m_GateFitMode: Option<i32>

i32: (2018.3.0f2 - 2022.3.2f1)

§m_HDR: Option<bool>

bool: (3.5.0 - 2022.3.2f1)

§m_Iso: Option<i32>

The sensor sensitivity of the camera. To use this property, enable UsePhysicalProperties. i32: (2022.2.0b1 - 2022.3.2f1)

§m_LensShift: Option<Vector2f>

The lens offset of the camera. The lens shift is relative to the sensor size. For example, a lens shift of 0.5 offsets the sensor by half its horizontal size. Vector2f: (2018.2.0b1 - 2022.3.2f1)

§m_OcclusionCulling: Option<bool>

bool: (4.3.0 - 2022.3.2f1)

§m_SensorSize: Option<Vector2f>

The size of the camera sensor, expressed in millimeters. Vector2f: (2018.2.0b1 - 2022.3.2f1)

§m_ShutterSpeed: Option<f32>

The exposure time of the camera, in seconts. To use this property, enable UsePhysicalProperties. f32: (2022.2.0b1 - 2022.3.2f1)

§m_StereoConvergence: Option<f32>

Distance to a point where virtual eyes converge. f32: (4.5.0 - 2022.3.2f1)

§m_StereoMirrorMode: Option<bool>

bool: (5.1.0f1 - 2017.2.0b10)

§m_StereoSeparation: Option<f32>

The distance between the virtual eyes. Use this to query or set the current eye separation. Note that most VR devices provide this value, in which case setting the value will have no effect. f32: (4.5.0 - 2022.3.2f1)

§m_TargetDisplay: Option<i64>

Set the target display for this Camera. u32: (4.5.0 - 5.2.5f1); i32: (5.3.0f1 - 2022.3.2f1)

§m_TargetEye: Option<i32>

i32: (5.1.3f1 - 2022.3.2f1)

§m_projectionMatrixMode: Option<i32>

i32: (2018.2.0b1 - 2022.3.2f1)

§near_clip_plane: Option<f32>

The distance of the near clipping plane from the the Camera, in world units. f32: (3.4.0 - 2022.3.2f1)

§orthographic_size: Option<f32>

Camera’s half-size when in orthographic mode. f32: (3.4.0 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Camera

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Camera

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Camera

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,