#[repr(C)]pub struct SCNCamera { /* private fields */ }SCNCamera only.Expand description
SCNCamera represents a camera that can be attached to a SCNNode.
A node with a camera can be used as a point of view to visualize a 3D scene.
See also Apple’s documentation
Implementations§
Source§impl SCNCamera
SCNModelIO.
impl SCNCamera
SCNModelIO.
pub unsafe fn cameraWithMDLCamera(mdl_camera: &MDLCamera) -> Retained<Self>
ModelIO and crate feature objc2-model-io and non-watchOS only.Source§impl SCNCamera
impl SCNCamera
Sourcepub unsafe fn fieldOfView(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn fieldOfView(&self) -> CGFloat
objc2-core-foundation only.Determines the receiver’s field of view (in degree). Defaults to 60°. Animatable.
The fieldOfView is automatically updated when the sensorHeight or focalLength are set. Setting the fieldOfView will update the focalLength according to the new fieldOfView and the current sensorHeight.
Sourcepub unsafe fn setFieldOfView(&self, field_of_view: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setFieldOfView(&self, field_of_view: CGFloat)
objc2-core-foundation only.Setter for fieldOfView.
Sourcepub unsafe fn projectionDirection(&self) -> SCNCameraProjectionDirection
pub unsafe fn projectionDirection(&self) -> SCNCameraProjectionDirection
Determines whether the fieldOfView (or orthographicScale) is vertical or horizontal. Defaults to vertical.
Sourcepub unsafe fn setProjectionDirection(
&self,
projection_direction: SCNCameraProjectionDirection,
)
pub unsafe fn setProjectionDirection( &self, projection_direction: SCNCameraProjectionDirection, )
Setter for projectionDirection.
Sourcepub unsafe fn focalLength(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn focalLength(&self) -> CGFloat
objc2-core-foundation only.Determines the receiver’s focal length in millimeter. Defaults to 50mm. Animatable.
The focalLength is automatically updated when the sensorHeight or fieldOfView are set. Setting the focalLength will update the fieldOfView according to the new focalLength and the current sensorHeight.
Sourcepub unsafe fn setFocalLength(&self, focal_length: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setFocalLength(&self, focal_length: CGFloat)
objc2-core-foundation only.Setter for focalLength.
Sourcepub unsafe fn sensorHeight(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn sensorHeight(&self) -> CGFloat
objc2-core-foundation only.Determines the vertical size of the sensor in millimeter. Defaults to 24mm. Animatable.
Setting the sensorHeight will automatically update the fieldOfView according to the new sensorHeight and the current focalLength.
Sourcepub unsafe fn setSensorHeight(&self, sensor_height: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setSensorHeight(&self, sensor_height: CGFloat)
objc2-core-foundation only.Setter for sensorHeight.
Sourcepub unsafe fn zNear(&self) -> c_double
pub unsafe fn zNear(&self) -> c_double
Determines the receiver’s near value. Animatable.
The near value determines the minimal distance between the camera and a visible surface. If a surface is closer to the camera than this minimal distance, then the surface is clipped. The near value must be different than zero. Defaults to 1.
Sourcepub unsafe fn zFar(&self) -> c_double
pub unsafe fn zFar(&self) -> c_double
Determines the receiver’s far value. Animatable.
The far value determines the maximal distance between the camera and a visible surface. If a surface is further from the camera than this maximal distance, then the surface is clipped. Defaults to 100.
Sourcepub unsafe fn automaticallyAdjustsZRange(&self) -> bool
pub unsafe fn automaticallyAdjustsZRange(&self) -> bool
Determines whether the receiver automatically adjusts the zFar value. Defaults to NO.
When set to YES, the near and far planes are automatically set to fit the bounding box of the entire scene at render time.
Sourcepub unsafe fn setAutomaticallyAdjustsZRange(
&self,
automatically_adjusts_z_range: bool,
)
pub unsafe fn setAutomaticallyAdjustsZRange( &self, automatically_adjusts_z_range: bool, )
Setter for automaticallyAdjustsZRange.
Sourcepub unsafe fn usesOrthographicProjection(&self) -> bool
pub unsafe fn usesOrthographicProjection(&self) -> bool
Determines whether the receiver uses an orthographic projection or not. Defaults to NO.
Sourcepub unsafe fn setUsesOrthographicProjection(
&self,
uses_orthographic_projection: bool,
)
pub unsafe fn setUsesOrthographicProjection( &self, uses_orthographic_projection: bool, )
Setter for usesOrthographicProjection.
Sourcepub unsafe fn orthographicScale(&self) -> c_double
pub unsafe fn orthographicScale(&self) -> c_double
Determines the receiver’s orthographic scale value. Animatable. Defaults to 1.
This setting determines the size of the camera’s visible area. This is only enabled when usesOrthographicProjection is set to YES.
Sourcepub unsafe fn setOrthographicScale(&self, orthographic_scale: c_double)
pub unsafe fn setOrthographicScale(&self, orthographic_scale: c_double)
Setter for orthographicScale.
Sourcepub unsafe fn projectionTransform(&self) -> SCNMatrix4
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn projectionTransform(&self) -> SCNMatrix4
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Determines the projection transform used by the camera to project the world onscreen.
Sourcepub unsafe fn setProjectionTransform(&self, projection_transform: SCNMatrix4)
Available on crate feature SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.
pub unsafe fn setProjectionTransform(&self, projection_transform: SCNMatrix4)
SceneKitTypes and crate feature objc2-quartz-core and non-watchOS only.Setter for projectionTransform.
pub unsafe fn projectionTransformWithViewportSize( &self, viewport_size: CGSize, ) -> SCNMatrix4
SceneKitTypes and crate feature objc2-core-foundation and crate feature objc2-quartz-core and non-watchOS only.Sourcepub unsafe fn wantsDepthOfField(&self) -> bool
pub unsafe fn wantsDepthOfField(&self) -> bool
Determines if the receiver has depth of field. Defaults to NO.
Sourcepub unsafe fn setWantsDepthOfField(&self, wants_depth_of_field: bool)
pub unsafe fn setWantsDepthOfField(&self, wants_depth_of_field: bool)
Setter for wantsDepthOfField.
Sourcepub unsafe fn focusDistance(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn focusDistance(&self) -> CGFloat
objc2-core-foundation only.Determines the receiver’s focus distance. Animatable.
Defaults to 2.5
Sourcepub unsafe fn setFocusDistance(&self, focus_distance: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setFocusDistance(&self, focus_distance: CGFloat)
objc2-core-foundation only.Setter for focusDistance.
Sourcepub unsafe fn focalBlurSampleCount(&self) -> NSInteger
pub unsafe fn focalBlurSampleCount(&self) -> NSInteger
Determines the receiver’s sample count for depth of field effect.
Defaults to 25.
Sourcepub unsafe fn setFocalBlurSampleCount(&self, focal_blur_sample_count: NSInteger)
pub unsafe fn setFocalBlurSampleCount(&self, focal_blur_sample_count: NSInteger)
Setter for focalBlurSampleCount.
Sourcepub unsafe fn fStop(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn fStop(&self) -> CGFloat
objc2-core-foundation only.Determines the receiver’s fstop. Animatable.
Defaults to 5.6.
Sourcepub unsafe fn setFStop(&self, f_stop: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setFStop(&self, f_stop: CGFloat)
objc2-core-foundation only.Setter for fStop.
Sourcepub unsafe fn apertureBladeCount(&self) -> NSInteger
pub unsafe fn apertureBladeCount(&self) -> NSInteger
Determines the receiver’s blade count of the aperture.
Defaults to 6.
Sourcepub unsafe fn setApertureBladeCount(&self, aperture_blade_count: NSInteger)
pub unsafe fn setApertureBladeCount(&self, aperture_blade_count: NSInteger)
Setter for apertureBladeCount.
Sourcepub unsafe fn motionBlurIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn motionBlurIntensity(&self) -> CGFloat
objc2-core-foundation only.Determines the intensity of the motion blur. Animatable. Defaults to 0.
An intensity of zero means no motion blur. The intensity should not exceeed 1.
Sourcepub unsafe fn setMotionBlurIntensity(&self, motion_blur_intensity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setMotionBlurIntensity(&self, motion_blur_intensity: CGFloat)
objc2-core-foundation only.Setter for motionBlurIntensity.
Sourcepub unsafe fn screenSpaceAmbientOcclusionIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn screenSpaceAmbientOcclusionIntensity(&self) -> CGFloat
objc2-core-foundation only.Determines the intensity of the screen space ambient occlusion. Animatable.
defaults to 0.
Sourcepub unsafe fn setScreenSpaceAmbientOcclusionIntensity(
&self,
screen_space_ambient_occlusion_intensity: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setScreenSpaceAmbientOcclusionIntensity( &self, screen_space_ambient_occlusion_intensity: CGFloat, )
objc2-core-foundation only.Setter for screenSpaceAmbientOcclusionIntensity.
Sourcepub unsafe fn screenSpaceAmbientOcclusionRadius(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn screenSpaceAmbientOcclusionRadius(&self) -> CGFloat
objc2-core-foundation only.Determines the screen space ambient occlusion radius in scene unit. Animatable.
defaults to 5.
Sourcepub unsafe fn setScreenSpaceAmbientOcclusionRadius(
&self,
screen_space_ambient_occlusion_radius: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setScreenSpaceAmbientOcclusionRadius( &self, screen_space_ambient_occlusion_radius: CGFloat, )
objc2-core-foundation only.Setter for screenSpaceAmbientOcclusionRadius.
Sourcepub unsafe fn screenSpaceAmbientOcclusionBias(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn screenSpaceAmbientOcclusionBias(&self) -> CGFloat
objc2-core-foundation only.Determines self occlusion bias in scene unit.
defaults to 0.03.
Sourcepub unsafe fn setScreenSpaceAmbientOcclusionBias(
&self,
screen_space_ambient_occlusion_bias: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setScreenSpaceAmbientOcclusionBias( &self, screen_space_ambient_occlusion_bias: CGFloat, )
objc2-core-foundation only.Setter for screenSpaceAmbientOcclusionBias.
Sourcepub unsafe fn screenSpaceAmbientOcclusionDepthThreshold(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn screenSpaceAmbientOcclusionDepthThreshold(&self) -> CGFloat
objc2-core-foundation only.Determines the depth blur threshold in scene unit.
defaults to 0.2.
Sourcepub unsafe fn setScreenSpaceAmbientOcclusionDepthThreshold(
&self,
screen_space_ambient_occlusion_depth_threshold: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setScreenSpaceAmbientOcclusionDepthThreshold( &self, screen_space_ambient_occlusion_depth_threshold: CGFloat, )
objc2-core-foundation only.Setter for screenSpaceAmbientOcclusionDepthThreshold.
Sourcepub unsafe fn screenSpaceAmbientOcclusionNormalThreshold(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn screenSpaceAmbientOcclusionNormalThreshold(&self) -> CGFloat
objc2-core-foundation only.Determines the normal blur threshold.
defaults to 0.3.
Sourcepub unsafe fn setScreenSpaceAmbientOcclusionNormalThreshold(
&self,
screen_space_ambient_occlusion_normal_threshold: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setScreenSpaceAmbientOcclusionNormalThreshold( &self, screen_space_ambient_occlusion_normal_threshold: CGFloat, )
objc2-core-foundation only.Setter for screenSpaceAmbientOcclusionNormalThreshold.
Sourcepub unsafe fn wantsHDR(&self) -> bool
pub unsafe fn wantsHDR(&self) -> bool
Determines if the receiver has a high dynamic range. Defaults to NO.
Sourcepub unsafe fn setWantsHDR(&self, wants_hdr: bool)
pub unsafe fn setWantsHDR(&self, wants_hdr: bool)
Setter for wantsHDR.
Sourcepub unsafe fn exposureOffset(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn exposureOffset(&self) -> CGFloat
objc2-core-foundation only.Determines the logarithmic exposure biasing, in EV. Defaults to 0.
Sourcepub unsafe fn setExposureOffset(&self, exposure_offset: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setExposureOffset(&self, exposure_offset: CGFloat)
objc2-core-foundation only.Setter for exposureOffset.
Sourcepub unsafe fn averageGray(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn averageGray(&self) -> CGFloat
objc2-core-foundation only.Determines the average gray level desired in the final image. Defaults to 0.18.
Sourcepub unsafe fn setAverageGray(&self, average_gray: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setAverageGray(&self, average_gray: CGFloat)
objc2-core-foundation only.Setter for averageGray.
Sourcepub unsafe fn whitePoint(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn whitePoint(&self) -> CGFloat
objc2-core-foundation only.Determines the smallest luminance level that will be mapped to white in the final image. Defaults to 1.
Sourcepub unsafe fn setWhitePoint(&self, white_point: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setWhitePoint(&self, white_point: CGFloat)
objc2-core-foundation only.Setter for whitePoint.
Sourcepub unsafe fn wantsExposureAdaptation(&self) -> bool
pub unsafe fn wantsExposureAdaptation(&self) -> bool
Determines if the receiver should simulate an eye and continuously adjust to luminance. Defaults to YES.
Sourcepub unsafe fn setWantsExposureAdaptation(&self, wants_exposure_adaptation: bool)
pub unsafe fn setWantsExposureAdaptation(&self, wants_exposure_adaptation: bool)
Setter for wantsExposureAdaptation.
Sourcepub unsafe fn exposureAdaptationBrighteningSpeedFactor(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn exposureAdaptationBrighteningSpeedFactor(&self) -> CGFloat
objc2-core-foundation only.Determines the exposure adaptation speed when going from bright areas to dark areas. Defaults to 0.4.
Sourcepub unsafe fn setExposureAdaptationBrighteningSpeedFactor(
&self,
exposure_adaptation_brightening_speed_factor: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setExposureAdaptationBrighteningSpeedFactor( &self, exposure_adaptation_brightening_speed_factor: CGFloat, )
objc2-core-foundation only.Setter for exposureAdaptationBrighteningSpeedFactor.
Sourcepub unsafe fn exposureAdaptationDarkeningSpeedFactor(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn exposureAdaptationDarkeningSpeedFactor(&self) -> CGFloat
objc2-core-foundation only.Determines the exposure adaptation speed when going from dark areas to bright areas. Defaults to 0.6.
Sourcepub unsafe fn setExposureAdaptationDarkeningSpeedFactor(
&self,
exposure_adaptation_darkening_speed_factor: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setExposureAdaptationDarkeningSpeedFactor( &self, exposure_adaptation_darkening_speed_factor: CGFloat, )
objc2-core-foundation only.Setter for exposureAdaptationDarkeningSpeedFactor.
Sourcepub unsafe fn minimumExposure(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn minimumExposure(&self) -> CGFloat
objc2-core-foundation only.Determines the minimum exposure offset of the adaptation, in EV. Defaults to -15.
Sourcepub unsafe fn setMinimumExposure(&self, minimum_exposure: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setMinimumExposure(&self, minimum_exposure: CGFloat)
objc2-core-foundation only.Setter for minimumExposure.
Sourcepub unsafe fn maximumExposure(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn maximumExposure(&self) -> CGFloat
objc2-core-foundation only.Determines the maximum exposure offset of the adaptation, in EV. Defaults to -15.
Sourcepub unsafe fn setMaximumExposure(&self, maximum_exposure: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setMaximumExposure(&self, maximum_exposure: CGFloat)
objc2-core-foundation only.Setter for maximumExposure.
Sourcepub unsafe fn bloomThreshold(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn bloomThreshold(&self) -> CGFloat
objc2-core-foundation only.Determines the luminance threshold for the bloom effect. Animatable. Defaults to 1.
Sourcepub unsafe fn setBloomThreshold(&self, bloom_threshold: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setBloomThreshold(&self, bloom_threshold: CGFloat)
objc2-core-foundation only.Setter for bloomThreshold.
Sourcepub unsafe fn bloomIterationCount(&self) -> NSInteger
pub unsafe fn bloomIterationCount(&self) -> NSInteger
Determines the number of blur iterations. Defaults to 1.
Sourcepub unsafe fn setBloomIterationCount(&self, bloom_iteration_count: NSInteger)
pub unsafe fn setBloomIterationCount(&self, bloom_iteration_count: NSInteger)
Setter for bloomIterationCount.
Sourcepub unsafe fn bloomIterationSpread(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn bloomIterationSpread(&self) -> CGFloat
objc2-core-foundation only.Determines how the bloom iterations are spread. Defaults to 0.
Sourcepub unsafe fn setBloomIterationSpread(&self, bloom_iteration_spread: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setBloomIterationSpread(&self, bloom_iteration_spread: CGFloat)
objc2-core-foundation only.Setter for bloomIterationSpread.
Sourcepub unsafe fn bloomIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn bloomIntensity(&self) -> CGFloat
objc2-core-foundation only.Determines the intensity of the bloom effect. Animatable. Defaults to 0 (no effect).
Sourcepub unsafe fn setBloomIntensity(&self, bloom_intensity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setBloomIntensity(&self, bloom_intensity: CGFloat)
objc2-core-foundation only.Setter for bloomIntensity.
Sourcepub unsafe fn bloomBlurRadius(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn bloomBlurRadius(&self) -> CGFloat
objc2-core-foundation only.Determines the radius of the bloom effect in points. Animatable. Defaults to 4.
Sourcepub unsafe fn setBloomBlurRadius(&self, bloom_blur_radius: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setBloomBlurRadius(&self, bloom_blur_radius: CGFloat)
objc2-core-foundation only.Setter for bloomBlurRadius.
Sourcepub unsafe fn vignettingPower(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn vignettingPower(&self) -> CGFloat
objc2-core-foundation only.Controls the shape of the vignetting effect. Defaults to 0 (no effect).
Sourcepub unsafe fn setVignettingPower(&self, vignetting_power: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setVignettingPower(&self, vignetting_power: CGFloat)
objc2-core-foundation only.Setter for vignettingPower.
Sourcepub unsafe fn vignettingIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn vignettingIntensity(&self) -> CGFloat
objc2-core-foundation only.Controls the intensity of the vignetting effect. Defaults to 0 (no effect).
Sourcepub unsafe fn setVignettingIntensity(&self, vignetting_intensity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setVignettingIntensity(&self, vignetting_intensity: CGFloat)
objc2-core-foundation only.Setter for vignettingIntensity.
Sourcepub unsafe fn colorFringeStrength(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn colorFringeStrength(&self) -> CGFloat
objc2-core-foundation only.Controls the strength of the color shift effect. Defaults to 0 (no effect).
Sourcepub unsafe fn setColorFringeStrength(&self, color_fringe_strength: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setColorFringeStrength(&self, color_fringe_strength: CGFloat)
objc2-core-foundation only.Setter for colorFringeStrength.
Sourcepub unsafe fn colorFringeIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn colorFringeIntensity(&self) -> CGFloat
objc2-core-foundation only.Controls the intensity of the color shift effect. Defaults to 1.
Sourcepub unsafe fn setColorFringeIntensity(&self, color_fringe_intensity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setColorFringeIntensity(&self, color_fringe_intensity: CGFloat)
objc2-core-foundation only.Setter for colorFringeIntensity.
Sourcepub unsafe fn saturation(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn saturation(&self) -> CGFloat
objc2-core-foundation only.Controls the overall saturation of the scene. Defaults to 1 (no effect).
Sourcepub unsafe fn setSaturation(&self, saturation: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setSaturation(&self, saturation: CGFloat)
objc2-core-foundation only.Setter for saturation.
Sourcepub unsafe fn contrast(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn contrast(&self) -> CGFloat
objc2-core-foundation only.Controls the overall contrast of the scene. Defaults to 0 (no effect).
Sourcepub unsafe fn setContrast(&self, contrast: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setContrast(&self, contrast: CGFloat)
objc2-core-foundation only.Setter for contrast.
Sourcepub unsafe fn grainIntensity(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn grainIntensity(&self) -> CGFloat
objc2-core-foundation only.Controls the intensity of the grain. Defaults to 0 (no effect).
Sourcepub unsafe fn setGrainIntensity(&self, grain_intensity: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setGrainIntensity(&self, grain_intensity: CGFloat)
objc2-core-foundation only.Setter for grainIntensity.
Sourcepub unsafe fn grainScale(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn grainScale(&self) -> CGFloat
objc2-core-foundation only.Controls the scale of the grain. Defaults to 1.
Sourcepub unsafe fn setGrainScale(&self, grain_scale: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setGrainScale(&self, grain_scale: CGFloat)
objc2-core-foundation only.Setter for grainScale.
Sourcepub unsafe fn grainIsColored(&self) -> bool
pub unsafe fn grainIsColored(&self) -> bool
Determines if the grain is colored or not. Defaults to NO.
Sourcepub unsafe fn setGrainIsColored(&self, grain_is_colored: bool)
pub unsafe fn setGrainIsColored(&self, grain_is_colored: bool)
Setter for grainIsColored.
Sourcepub unsafe fn whiteBalanceTemperature(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn whiteBalanceTemperature(&self) -> CGFloat
objc2-core-foundation only.Controls the overall white balance temperature of the scene. Defaults to 0 (no effect).
Sourcepub unsafe fn setWhiteBalanceTemperature(
&self,
white_balance_temperature: CGFloat,
)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setWhiteBalanceTemperature( &self, white_balance_temperature: CGFloat, )
objc2-core-foundation only.Setter for whiteBalanceTemperature.
Sourcepub unsafe fn whiteBalanceTint(&self) -> CGFloat
Available on crate feature objc2-core-foundation only.
pub unsafe fn whiteBalanceTint(&self) -> CGFloat
objc2-core-foundation only.Controls the overall white balance tint of the scene. Defaults to 0 (no effect).
Sourcepub unsafe fn setWhiteBalanceTint(&self, white_balance_tint: CGFloat)
Available on crate feature objc2-core-foundation only.
pub unsafe fn setWhiteBalanceTint(&self, white_balance_tint: CGFloat)
objc2-core-foundation only.Setter for whiteBalanceTint.
Sourcepub unsafe fn colorGrading(&self) -> Retained<SCNMaterialProperty>
Available on crate feature SCNMaterialProperty only.
pub unsafe fn colorGrading(&self) -> Retained<SCNMaterialProperty>
SCNMaterialProperty only.Specifies a lookup texture to apply color grading. The contents must a 2D image representing n slices of a unit color cube texture, arranged in an horizontal row of n images. For instance, a color cube of dimension 16x16x16 should be provided as an image of size 256x16.
Sourcepub unsafe fn categoryBitMask(&self) -> NSUInteger
pub unsafe fn categoryBitMask(&self) -> NSUInteger
Determines the node categories that are visible from the receiver. Defaults to all bits set.
Sourcepub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger)
pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger)
Setter for categoryBitMask.
Source§impl SCNCamera
SCNDeprecated.
impl SCNCamera
SCNDeprecated.
Sourcepub unsafe fn focalBlurRadius(&self) -> CGFloat
👎Deprecated: Use fStop insteadAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn focalBlurRadius(&self) -> CGFloat
SceneKitDeprecated and objc2-core-foundation only.Determines the receiver’s focal radius. Animatable.
Determines the maximum amount of blur for objects out of focus. Defaults to 0.
Sourcepub unsafe fn setFocalBlurRadius(&self, focal_blur_radius: CGFloat)
👎Deprecated: Use fStop insteadAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn setFocalBlurRadius(&self, focal_blur_radius: CGFloat)
SceneKitDeprecated and objc2-core-foundation only.Setter for focalBlurRadius.
Sourcepub unsafe fn xFov(&self) -> c_double
👎Deprecated: Use -[SCNCamera fieldOfView] or -[SCNCamera focalLength] insteadAvailable on crate feature SceneKitDeprecated only.
pub unsafe fn xFov(&self) -> c_double
SceneKitDeprecated only.Determines the receiver’s field of view on the X axis (in degree). Animatable.
When both xFov and yFov are null an yFov of 60° is used. When both are set, the one that best fits the renderer’s aspect ratio is used. When only one is set, it is used. Defaults to 0.
Sourcepub unsafe fn setXFov(&self, x_fov: c_double)
👎Deprecated: Use -[SCNCamera fieldOfView] or -[SCNCamera focalLength] insteadAvailable on crate feature SceneKitDeprecated only.
pub unsafe fn setXFov(&self, x_fov: c_double)
SceneKitDeprecated only.Setter for xFov.
Sourcepub unsafe fn yFov(&self) -> c_double
👎Deprecated: Use -[SCNCamera fieldOfView] or -[SCNCamera focalLength] insteadAvailable on crate feature SceneKitDeprecated only.
pub unsafe fn yFov(&self) -> c_double
SceneKitDeprecated only.Determines the receiver’s field of view on the Y axis (in degree). Animatable.
When both xFov and yFov are null an yFov of 60° is used. When both are set, the one that best fits the renderer’s aspect ratio is used. When only one is set, it is used. Defaults to 0.
Sourcepub unsafe fn setYFov(&self, y_fov: c_double)
👎Deprecated: Use -[SCNCamera fieldOfView] or -[SCNCamera focalLength] insteadAvailable on crate feature SceneKitDeprecated only.
pub unsafe fn setYFov(&self, y_fov: c_double)
SceneKitDeprecated only.Setter for yFov.
Sourcepub unsafe fn aperture(&self) -> CGFloat
👎Deprecated: Use -[SCNCamera fStop] instead with fStop = sensorHeight / aperture.Available on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn aperture(&self) -> CGFloat
SceneKitDeprecated and objc2-core-foundation only.Determines the receiver’s aperture. Animatable.
Defaults to 1/8.0.
Sourcepub unsafe fn setAperture(&self, aperture: CGFloat)
👎Deprecated: Use -[SCNCamera fStop] instead with fStop = sensorHeight / aperture.Available on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn setAperture(&self, aperture: CGFloat)
SceneKitDeprecated and objc2-core-foundation only.Setter for aperture.
Sourcepub unsafe fn focalSize(&self) -> CGFloat
👎DeprecatedAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn focalSize(&self) -> CGFloat
SceneKitDeprecated and objc2-core-foundation only.Determines the receiver’s focal size. Animatable.
Determines the size of the area around focalDistance where the objects are in focus. Defaults to 0.
Sourcepub unsafe fn setFocalSize(&self, focal_size: CGFloat)
👎DeprecatedAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn setFocalSize(&self, focal_size: CGFloat)
SceneKitDeprecated and objc2-core-foundation only.Setter for focalSize.
Sourcepub unsafe fn focalDistance(&self) -> CGFloat
👎DeprecatedAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn focalDistance(&self) -> CGFloat
SceneKitDeprecated and objc2-core-foundation only.Determines the receiver’s focal distance. Animatable.
When non zero, the focal distance determines how the camera focuses the objects in the 3d scene. Defaults to 10.0 prior to macOS 10.13, iOS 11, tvOS 11 and watchOS 4. Defaults to 2.5 otherwise.
Sourcepub unsafe fn setFocalDistance(&self, focal_distance: CGFloat)
👎DeprecatedAvailable on crate features SceneKitDeprecated and objc2-core-foundation only.
pub unsafe fn setFocalDistance(&self, focal_distance: CGFloat)
SceneKitDeprecated and objc2-core-foundation only.Setter for focalDistance.
Methods from Deref<Target = NSObject>§
Sourcepub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
pub fn doesNotRecognizeSelector(&self, sel: Sel) -> !
Handle messages the object doesn’t recognize.
See Apple’s documentation for details.
Methods from Deref<Target = AnyObject>§
Sourcepub fn class(&self) -> &'static AnyClass
pub fn class(&self) -> &'static AnyClass
Dynamically find the class of this object.
§Example
Check that an instance of NSObject has the precise class NSObject.
use objc2::ClassType;
use objc2::runtime::NSObject;
let obj = NSObject::new();
assert_eq!(obj.class(), NSObject::class());Sourcepub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
👎Deprecated: this is difficult to use correctly, use Ivar::load instead.
pub unsafe fn get_ivar<T>(&self, name: &str) -> &Twhere
T: Encode,
Ivar::load instead.Use Ivar::load instead.
§Safety
The object must have an instance variable with the given name, and it
must be of type T.
See Ivar::load_ptr for details surrounding this.
Sourcepub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: DowncastTarget,
Attempt to downcast the object to a class of type T.
This is the reference-variant. Use Retained::downcast if you want
to convert a retained object to another type.
§Mutable classes
Some classes have immutable and mutable variants, such as NSString
and NSMutableString.
When some Objective-C API signature says it gives you an immutable class, it generally expects you to not mutate that, even though it may technically be mutable “under the hood”.
So using this method to convert a NSString to a NSMutableString,
while not unsound, is generally frowned upon unless you created the
string yourself, or the API explicitly documents the string to be
mutable.
See Apple’s documentation on mutability and on
isKindOfClass: for more details.
§Generic classes
Objective-C generics are called “lightweight generics”, and that’s because they aren’t exposed in the runtime. This makes it impossible to safely downcast to generic collections, so this is disallowed by this method.
You can, however, safely downcast to generic collections where all the
type-parameters are AnyObject.
§Panics
This works internally by calling isKindOfClass:. That means that the
object must have the instance method of that name, and an exception
will be thrown (if CoreFoundation is linked) or the process will abort
if that is not the case. In the vast majority of cases, you don’t need
to worry about this, since both root objects NSObject and
NSProxy implement this method.
§Examples
Cast an NSString back and forth from NSObject.
use objc2::rc::Retained;
use objc2_foundation::{NSObject, NSString};
let obj: Retained<NSObject> = NSString::new().into_super();
let string = obj.downcast_ref::<NSString>().unwrap();
// Or with `downcast`, if we do not need the object afterwards
let string = obj.downcast::<NSString>().unwrap();Try (and fail) to cast an NSObject to an NSString.
use objc2_foundation::{NSObject, NSString};
let obj = NSObject::new();
assert!(obj.downcast_ref::<NSString>().is_none());Try to cast to an array of strings.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
// This is invalid and doesn't type check.
let arr = arr.downcast_ref::<NSArray<NSString>>();This fails to compile, since it would require enumerating over the array to ensure that each element is of the desired type, which is a performance pitfall.
Downcast when processing each element instead.
use objc2_foundation::{NSArray, NSObject, NSString};
let arr = NSArray::from_retained_slice(&[NSObject::new()]);
for elem in arr {
if let Some(data) = elem.downcast_ref::<NSString>() {
// handle `data`
}
}Trait Implementations§
Source§impl ClassType for SCNCamera
impl ClassType for SCNCamera
Source§const NAME: &'static str = "SCNCamera"
const NAME: &'static str = "SCNCamera"
Source§type ThreadKind = <<SCNCamera as ClassType>::Super as ClassType>::ThreadKind
type ThreadKind = <<SCNCamera as ClassType>::Super as ClassType>::ThreadKind
Source§impl CopyingHelper for SCNCamera
impl CopyingHelper for SCNCamera
Source§impl NSCopying for SCNCamera
impl NSCopying for SCNCamera
Source§impl NSObjectProtocol for SCNCamera
impl NSObjectProtocol for SCNCamera
Source§fn isEqual(&self, other: Option<&AnyObject>) -> bool
fn isEqual(&self, other: Option<&AnyObject>) -> bool
Source§fn hash(&self) -> usize
fn hash(&self) -> usize
Source§fn isKindOfClass(&self, cls: &AnyClass) -> bool
fn isKindOfClass(&self, cls: &AnyClass) -> bool
Source§fn is_kind_of<T>(&self) -> bool
fn is_kind_of<T>(&self) -> bool
isKindOfClass directly, or cast your objects with AnyObject::downcast_refSource§fn isMemberOfClass(&self, cls: &AnyClass) -> bool
fn isMemberOfClass(&self, cls: &AnyClass) -> bool
Source§fn respondsToSelector(&self, aSelector: Sel) -> bool
fn respondsToSelector(&self, aSelector: Sel) -> bool
Source§fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
fn conformsToProtocol(&self, aProtocol: &AnyProtocol) -> bool
Source§fn debugDescription(&self) -> Retained<NSObject>
fn debugDescription(&self) -> Retained<NSObject>
Source§impl NSSecureCoding for SCNCamera
impl NSSecureCoding for SCNCamera
Source§impl RefEncode for SCNCamera
impl RefEncode for SCNCamera
Source§const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
const ENCODING_REF: Encoding = <NSObject as ::objc2::RefEncode>::ENCODING_REF
Source§impl SCNAnimatable for SCNCamera
Available on crate feature SCNAnimation only.
impl SCNAnimatable for SCNCamera
SCNAnimation only.Source§unsafe fn addAnimation_forKey(
&self,
animation: &ProtocolObject<dyn SCNAnimationProtocol>,
key: Option<&NSString>,
)
unsafe fn addAnimation_forKey( &self, animation: &ProtocolObject<dyn SCNAnimationProtocol>, key: Option<&NSString>, )
Source§unsafe fn addAnimationPlayer_forKey(
&self,
player: &SCNAnimationPlayer,
key: Option<&NSString>,
)
unsafe fn addAnimationPlayer_forKey( &self, player: &SCNAnimationPlayer, key: Option<&NSString>, )
Source§unsafe fn removeAllAnimations(&self)
unsafe fn removeAllAnimations(&self)
Source§unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
unsafe fn removeAllAnimationsWithBlendOutDuration(&self, duration: CGFloat)
objc2-core-foundation only.Source§unsafe fn removeAnimationForKey(&self, key: &NSString)
unsafe fn removeAnimationForKey(&self, key: &NSString)
Source§unsafe fn removeAnimationForKey_blendOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
unsafe fn removeAnimationForKey_blendOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Source§unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
unsafe fn animationKeys(&self) -> Retained<NSArray<NSString>>
Source§unsafe fn animationPlayerForKey(
&self,
key: &NSString,
) -> Option<Retained<SCNAnimationPlayer>>
unsafe fn animationPlayerForKey( &self, key: &NSString, ) -> Option<Retained<SCNAnimationPlayer>>
Source§unsafe fn removeAnimationForKey_fadeOutDuration(
&self,
key: &NSString,
duration: CGFloat,
)
unsafe fn removeAnimationForKey_fadeOutDuration( &self, key: &NSString, duration: CGFloat, )
objc2-core-foundation only.Source§unsafe fn animationForKey(
&self,
key: &NSString,
) -> Option<Retained<CAAnimation>>
unsafe fn animationForKey( &self, key: &NSString, ) -> Option<Retained<CAAnimation>>
objc2-quartz-core and non-watchOS only.Source§unsafe fn pauseAnimationForKey(&self, key: &NSString)
unsafe fn pauseAnimationForKey(&self, key: &NSString)
Source§unsafe fn resumeAnimationForKey(&self, key: &NSString)
unsafe fn resumeAnimationForKey(&self, key: &NSString)
Source§impl SCNTechniqueSupport for SCNCamera
Available on crate feature SCNTechnique only.
impl SCNTechniqueSupport for SCNCamera
SCNTechnique only.