objc2_scene_kit/generated/
SCNLight.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8use objc2_foundation::*;
9
10use crate::*;
11
12/// Light Types
13///
14/// Describes the various light types available.
15///
16/// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttype?language=objc)
17// NS_TYPED_ENUM
18pub type SCNLightType = NSString;
19
20extern "C" {
21    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypeambient?language=objc)
22    pub static SCNLightTypeAmbient: &'static SCNLightType;
23}
24
25extern "C" {
26    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypeomni?language=objc)
27    pub static SCNLightTypeOmni: &'static SCNLightType;
28}
29
30extern "C" {
31    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypedirectional?language=objc)
32    pub static SCNLightTypeDirectional: &'static SCNLightType;
33}
34
35extern "C" {
36    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypespot?language=objc)
37    pub static SCNLightTypeSpot: &'static SCNLightType;
38}
39
40extern "C" {
41    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypeies?language=objc)
42    pub static SCNLightTypeIES: &'static SCNLightType;
43}
44
45extern "C" {
46    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypeprobe?language=objc)
47    pub static SCNLightTypeProbe: &'static SCNLightType;
48}
49
50extern "C" {
51    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlighttypearea?language=objc)
52    pub static SCNLightTypeArea: &'static SCNLightType;
53}
54
55/// The different modes available to compute shadows.
56///
57/// When the shadow mode is set to SCNShadowModeForward, shadows are computed while computing the lighting. In this mode only the alpha component of the shadow color is used to alter the lighting contribution.
58/// When the shadow mode is set to SCNShadowModeDeferred shadows are applied as a post process. Shadows are blend over the final image and can therefor be of any arbitrary color. However it is most of the time less efficient than SCNShadowModeForward, except when a scene has a lot of overdraw.
59/// When the shadow mode is set to SCNShadowModeModulated the light doesn't illuminate the scene anymore, it only casts shadows. Therefore setting the light color has no effect. In this mode gobos act as a shadow projector: the gobo image is modulated with the shadow receiver's fragments. The typical usage is to use an image of a radial gradient (black to white) that is projected under a character (and use the categoryBitMask of the light and nodes to exclude the character from the shadow receiver).
60///
61/// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnshadowmode?language=objc)
62// NS_ENUM
63#[repr(transparent)]
64#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
65pub struct SCNShadowMode(pub NSInteger);
66impl SCNShadowMode {
67    #[doc(alias = "SCNShadowModeForward")]
68    pub const Forward: Self = Self(0);
69    #[doc(alias = "SCNShadowModeDeferred")]
70    pub const Deferred: Self = Self(1);
71    #[doc(alias = "SCNShadowModeModulated")]
72    pub const Modulated: Self = Self(2);
73}
74
75unsafe impl Encode for SCNShadowMode {
76    const ENCODING: Encoding = NSInteger::ENCODING;
77}
78
79unsafe impl RefEncode for SCNShadowMode {
80    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
81}
82
83/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlightprobetype?language=objc)
84// NS_ENUM
85#[repr(transparent)]
86#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
87pub struct SCNLightProbeType(pub NSInteger);
88impl SCNLightProbeType {
89    #[doc(alias = "SCNLightProbeTypeIrradiance")]
90    pub const Irradiance: Self = Self(0);
91    #[doc(alias = "SCNLightProbeTypeRadiance")]
92    pub const Radiance: Self = Self(1);
93}
94
95unsafe impl Encode for SCNLightProbeType {
96    const ENCODING: Encoding = NSInteger::ENCODING;
97}
98
99unsafe impl RefEncode for SCNLightProbeType {
100    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
101}
102
103/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlightprobeupdatetype?language=objc)
104// NS_ENUM
105#[repr(transparent)]
106#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
107pub struct SCNLightProbeUpdateType(pub NSInteger);
108impl SCNLightProbeUpdateType {
109    #[doc(alias = "SCNLightProbeUpdateTypeNever")]
110    pub const Never: Self = Self(0);
111    #[doc(alias = "SCNLightProbeUpdateTypeRealtime")]
112    pub const Realtime: Self = Self(1);
113}
114
115unsafe impl Encode for SCNLightProbeUpdateType {
116    const ENCODING: Encoding = NSInteger::ENCODING;
117}
118
119unsafe impl RefEncode for SCNLightProbeUpdateType {
120    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
121}
122
123/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlightareatype?language=objc)
124// NS_ENUM
125#[repr(transparent)]
126#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
127pub struct SCNLightAreaType(pub NSInteger);
128impl SCNLightAreaType {
129    #[doc(alias = "SCNLightAreaTypeRectangle")]
130    pub const Rectangle: Self = Self(1);
131    #[doc(alias = "SCNLightAreaTypePolygon")]
132    pub const Polygon: Self = Self(4);
133}
134
135unsafe impl Encode for SCNLightAreaType {
136    const ENCODING: Encoding = NSInteger::ENCODING;
137}
138
139unsafe impl RefEncode for SCNLightAreaType {
140    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
141}
142
143extern_class!(
144    /// SCNLight represents a light that can be attached to a SCNNode.
145    ///
146    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlight?language=objc)
147    #[unsafe(super(NSObject))]
148    #[derive(Debug, PartialEq, Eq, Hash)]
149    pub struct SCNLight;
150);
151
152unsafe impl NSCoding for SCNLight {}
153
154unsafe impl NSCopying for SCNLight {}
155
156unsafe impl CopyingHelper for SCNLight {
157    type Result = Self;
158}
159
160unsafe impl NSObjectProtocol for SCNLight {}
161
162unsafe impl NSSecureCoding for SCNLight {}
163
164#[cfg(feature = "SCNAnimation")]
165unsafe impl SCNAnimatable for SCNLight {}
166
167impl SCNLight {
168    extern_methods!(
169        /// Creates and returns a light instance.
170        #[unsafe(method(light))]
171        #[unsafe(method_family = none)]
172        pub unsafe fn light() -> Retained<Self>;
173
174        /// Specifies the receiver's type.
175        ///
176        /// Defaults to SCNLightTypeOmni on iOS 8 and later, and on macOS 10.10 and later (otherwise defaults to SCNLightTypeAmbient).
177        #[unsafe(method(type))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn r#type(&self) -> Retained<SCNLightType>;
180
181        /// Setter for [`type`][Self::type].
182        #[unsafe(method(setType:))]
183        #[unsafe(method_family = none)]
184        pub unsafe fn setType(&self, r#type: &SCNLightType);
185
186        /// Specifies the receiver's color (NSColor or CGColorRef). Animatable. Defaults to white.
187        ///
188        /// The initial value is a NSColor. The renderer multiplies the light's color is by the color derived from the light's temperature.
189        #[unsafe(method(color))]
190        #[unsafe(method_family = none)]
191        pub unsafe fn color(&self) -> Retained<AnyObject>;
192
193        /// Setter for [`color`][Self::color].
194        #[unsafe(method(setColor:))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn setColor(&self, color: &AnyObject);
197
198        #[cfg(feature = "objc2-core-foundation")]
199        /// Specifies the receiver's temperature.
200        ///
201        /// This specifies the temperature of the light in Kelvin. The renderer multiplies the light's color by the color derived from the light's temperature. Defaults to 6500 (pure white). Animatable.
202        #[unsafe(method(temperature))]
203        #[unsafe(method_family = none)]
204        pub unsafe fn temperature(&self) -> CGFloat;
205
206        #[cfg(feature = "objc2-core-foundation")]
207        /// Setter for [`temperature`][Self::temperature].
208        #[unsafe(method(setTemperature:))]
209        #[unsafe(method_family = none)]
210        pub unsafe fn setTemperature(&self, temperature: CGFloat);
211
212        #[cfg(feature = "objc2-core-foundation")]
213        /// Specifies the receiver's intensity.
214        ///
215        /// This intensity is used to modulate the light color. When used with a physically-based material, this corresponds to the luminous flux of the light, expressed in lumens (lm). Defaults to 1000. Animatable.
216        #[unsafe(method(intensity))]
217        #[unsafe(method_family = none)]
218        pub unsafe fn intensity(&self) -> CGFloat;
219
220        #[cfg(feature = "objc2-core-foundation")]
221        /// Setter for [`intensity`][Self::intensity].
222        #[unsafe(method(setIntensity:))]
223        #[unsafe(method_family = none)]
224        pub unsafe fn setIntensity(&self, intensity: CGFloat);
225
226        /// Determines the name of the receiver.
227        #[unsafe(method(name))]
228        #[unsafe(method_family = none)]
229        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
230
231        /// Setter for [`name`][Self::name].
232        #[unsafe(method(setName:))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn setName(&self, name: Option<&NSString>);
235
236        /// Determines whether the receiver casts a shadow. Defaults to NO.
237        ///
238        /// Shadows are only supported by spot and directional lights.
239        #[unsafe(method(castsShadow))]
240        #[unsafe(method_family = none)]
241        pub unsafe fn castsShadow(&self) -> bool;
242
243        /// Setter for [`castsShadow`][Self::castsShadow].
244        #[unsafe(method(setCastsShadow:))]
245        #[unsafe(method_family = none)]
246        pub unsafe fn setCastsShadow(&self, casts_shadow: bool);
247
248        /// Specifies the color (CGColorRef or NSColor) of the shadow casted by the receiver. Defaults to black. Animatable.
249        ///
250        /// On iOS 9 or earlier and macOS 10.11 or earlier, this defaults to black 50% transparent.
251        #[unsafe(method(shadowColor))]
252        #[unsafe(method_family = none)]
253        pub unsafe fn shadowColor(&self) -> Retained<AnyObject>;
254
255        /// Setter for [`shadowColor`][Self::shadowColor].
256        #[unsafe(method(setShadowColor:))]
257        #[unsafe(method_family = none)]
258        pub unsafe fn setShadowColor(&self, shadow_color: &AnyObject);
259
260        #[cfg(feature = "objc2-core-foundation")]
261        /// Specifies the sample radius used to render the receiver’s shadow. Default value is 3.0. Animatable.
262        #[unsafe(method(shadowRadius))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn shadowRadius(&self) -> CGFloat;
265
266        #[cfg(feature = "objc2-core-foundation")]
267        /// Setter for [`shadowRadius`][Self::shadowRadius].
268        #[unsafe(method(setShadowRadius:))]
269        #[unsafe(method_family = none)]
270        pub unsafe fn setShadowRadius(&self, shadow_radius: CGFloat);
271
272        #[cfg(feature = "objc2-core-foundation")]
273        /// Specifies the size of the shadow map.
274        ///
275        /// The larger the shadow map is the more precise the shadows are but the slower the computation is. If set to {0,0} the size of the shadow map is automatically chosen. Defaults to {0,0}.
276        #[unsafe(method(shadowMapSize))]
277        #[unsafe(method_family = none)]
278        pub unsafe fn shadowMapSize(&self) -> CGSize;
279
280        #[cfg(feature = "objc2-core-foundation")]
281        /// Setter for [`shadowMapSize`][Self::shadowMapSize].
282        #[unsafe(method(setShadowMapSize:))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn setShadowMapSize(&self, shadow_map_size: CGSize);
285
286        /// Specifies the number of sample per fragment to compute the shadow map. Defaults to 0.
287        ///
288        /// On macOS 10.11 or earlier, the shadowSampleCount defaults to 16. On iOS 9 or earlier it defaults to 1.0.
289        /// On macOS 10.12, iOS 10 and greater, when the shadowSampleCount is set to 0, a default sample count is chosen depending on the platform.
290        #[unsafe(method(shadowSampleCount))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn shadowSampleCount(&self) -> NSUInteger;
293
294        /// Setter for [`shadowSampleCount`][Self::shadowSampleCount].
295        #[unsafe(method(setShadowSampleCount:))]
296        #[unsafe(method_family = none)]
297        pub unsafe fn setShadowSampleCount(&self, shadow_sample_count: NSUInteger);
298
299        /// Specified the mode to use to cast shadows. See above for the available modes and their description. Defaults to SCNShadowModeDefered on 10.9 and before, defaults to SCNShadowModeForward otherwise.
300        #[unsafe(method(shadowMode))]
301        #[unsafe(method_family = none)]
302        pub unsafe fn shadowMode(&self) -> SCNShadowMode;
303
304        /// Setter for [`shadowMode`][Self::shadowMode].
305        #[unsafe(method(setShadowMode:))]
306        #[unsafe(method_family = none)]
307        pub unsafe fn setShadowMode(&self, shadow_mode: SCNShadowMode);
308
309        #[cfg(feature = "objc2-core-foundation")]
310        /// Specifies the correction to apply to the shadow map to correct acne artefacts. It is multiplied by an implementation-specific value to create a constant depth offset. Defaults to 1.0
311        #[unsafe(method(shadowBias))]
312        #[unsafe(method_family = none)]
313        pub unsafe fn shadowBias(&self) -> CGFloat;
314
315        #[cfg(feature = "objc2-core-foundation")]
316        /// Setter for [`shadowBias`][Self::shadowBias].
317        #[unsafe(method(setShadowBias:))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn setShadowBias(&self, shadow_bias: CGFloat);
320
321        /// Specifies if the shadow map projection should be done automatically or manually by the user. Defaults to YES.
322        #[unsafe(method(automaticallyAdjustsShadowProjection))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn automaticallyAdjustsShadowProjection(&self) -> bool;
325
326        /// Setter for [`automaticallyAdjustsShadowProjection`][Self::automaticallyAdjustsShadowProjection].
327        #[unsafe(method(setAutomaticallyAdjustsShadowProjection:))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn setAutomaticallyAdjustsShadowProjection(
330            &self,
331            automatically_adjusts_shadow_projection: bool,
332        );
333
334        #[cfg(feature = "objc2-core-foundation")]
335        /// Specifies the maximum distance from the viewpoint from which the shadows for the receiver light won't be computed. Defaults to 100.0.
336        #[unsafe(method(maximumShadowDistance))]
337        #[unsafe(method_family = none)]
338        pub unsafe fn maximumShadowDistance(&self) -> CGFloat;
339
340        #[cfg(feature = "objc2-core-foundation")]
341        /// Setter for [`maximumShadowDistance`][Self::maximumShadowDistance].
342        #[unsafe(method(setMaximumShadowDistance:))]
343        #[unsafe(method_family = none)]
344        pub unsafe fn setMaximumShadowDistance(&self, maximum_shadow_distance: CGFloat);
345
346        /// Render only back faces of the shadow caster when enabled. Defaults to NO.
347        /// This is a behavior change from previous releases.
348        #[unsafe(method(forcesBackFaceCasters))]
349        #[unsafe(method_family = none)]
350        pub unsafe fn forcesBackFaceCasters(&self) -> bool;
351
352        /// Setter for [`forcesBackFaceCasters`][Self::forcesBackFaceCasters].
353        #[unsafe(method(setForcesBackFaceCasters:))]
354        #[unsafe(method_family = none)]
355        pub unsafe fn setForcesBackFaceCasters(&self, forces_back_face_casters: bool);
356
357        /// Use the sample distribution of the main rendering to better fit the shadow frusta. Defaults to NO.
358        #[unsafe(method(sampleDistributedShadowMaps))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn sampleDistributedShadowMaps(&self) -> bool;
361
362        /// Setter for [`sampleDistributedShadowMaps`][Self::sampleDistributedShadowMaps].
363        #[unsafe(method(setSampleDistributedShadowMaps:))]
364        #[unsafe(method_family = none)]
365        pub unsafe fn setSampleDistributedShadowMaps(&self, sample_distributed_shadow_maps: bool);
366
367        /// Specifies the number of distinct shadow maps that will be computed for the receiver light. Defaults to 1. Maximum is 4.
368        #[unsafe(method(shadowCascadeCount))]
369        #[unsafe(method_family = none)]
370        pub unsafe fn shadowCascadeCount(&self) -> NSUInteger;
371
372        /// Setter for [`shadowCascadeCount`][Self::shadowCascadeCount].
373        #[unsafe(method(setShadowCascadeCount:))]
374        #[unsafe(method_family = none)]
375        pub unsafe fn setShadowCascadeCount(&self, shadow_cascade_count: NSUInteger);
376
377        #[cfg(feature = "objc2-core-foundation")]
378        /// Specifies a factor to interpolate between linear splitting (0) and logarithmic splitting (1). Defaults to 0.15.
379        #[unsafe(method(shadowCascadeSplittingFactor))]
380        #[unsafe(method_family = none)]
381        pub unsafe fn shadowCascadeSplittingFactor(&self) -> CGFloat;
382
383        #[cfg(feature = "objc2-core-foundation")]
384        /// Setter for [`shadowCascadeSplittingFactor`][Self::shadowCascadeSplittingFactor].
385        #[unsafe(method(setShadowCascadeSplittingFactor:))]
386        #[unsafe(method_family = none)]
387        pub unsafe fn setShadowCascadeSplittingFactor(
388            &self,
389            shadow_cascade_splitting_factor: CGFloat,
390        );
391
392        #[cfg(feature = "objc2-core-foundation")]
393        /// Specifies the orthographic scale used to render from the directional light into the shadow map. Defaults to 1.
394        ///
395        /// This is only applicable for directional lights.
396        #[unsafe(method(orthographicScale))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn orthographicScale(&self) -> CGFloat;
399
400        #[cfg(feature = "objc2-core-foundation")]
401        /// Setter for [`orthographicScale`][Self::orthographicScale].
402        #[unsafe(method(setOrthographicScale:))]
403        #[unsafe(method_family = none)]
404        pub unsafe fn setOrthographicScale(&self, orthographic_scale: CGFloat);
405
406        #[cfg(feature = "objc2-core-foundation")]
407        /// Specifies the minimal distance between the light and the surface to cast shadow on. If a surface is closer to the light than this minimal distance, then the surface won't be shadowed. The near value must be different than zero. Animatable. Defaults to 1.
408        #[unsafe(method(zNear))]
409        #[unsafe(method_family = none)]
410        pub unsafe fn zNear(&self) -> CGFloat;
411
412        #[cfg(feature = "objc2-core-foundation")]
413        /// Setter for [`zNear`][Self::zNear].
414        #[unsafe(method(setZNear:))]
415        #[unsafe(method_family = none)]
416        pub unsafe fn setZNear(&self, z_near: CGFloat);
417
418        #[cfg(feature = "objc2-core-foundation")]
419        /// Specifies the maximal distance between the light and a visible surface to cast shadow on. If a surface is further from the light than this maximal distance, then the surface won't be shadowed. Animatable. Defaults to 100.
420        #[unsafe(method(zFar))]
421        #[unsafe(method_family = none)]
422        pub unsafe fn zFar(&self) -> CGFloat;
423
424        #[cfg(feature = "objc2-core-foundation")]
425        /// Setter for [`zFar`][Self::zFar].
426        #[unsafe(method(setZFar:))]
427        #[unsafe(method_family = none)]
428        pub unsafe fn setZFar(&self, z_far: CGFloat);
429
430        #[cfg(feature = "objc2-core-foundation")]
431        /// The distance at which the attenuation starts (Omni or Spot light types only). Animatable. Defaults to 0.
432        #[unsafe(method(attenuationStartDistance))]
433        #[unsafe(method_family = none)]
434        pub unsafe fn attenuationStartDistance(&self) -> CGFloat;
435
436        #[cfg(feature = "objc2-core-foundation")]
437        /// Setter for [`attenuationStartDistance`][Self::attenuationStartDistance].
438        #[unsafe(method(setAttenuationStartDistance:))]
439        #[unsafe(method_family = none)]
440        pub unsafe fn setAttenuationStartDistance(&self, attenuation_start_distance: CGFloat);
441
442        #[cfg(feature = "objc2-core-foundation")]
443        /// The distance at which the attenuation ends (Omni or Spot light types only). Animatable. Defaults to 0.
444        #[unsafe(method(attenuationEndDistance))]
445        #[unsafe(method_family = none)]
446        pub unsafe fn attenuationEndDistance(&self) -> CGFloat;
447
448        #[cfg(feature = "objc2-core-foundation")]
449        /// Setter for [`attenuationEndDistance`][Self::attenuationEndDistance].
450        #[unsafe(method(setAttenuationEndDistance:))]
451        #[unsafe(method_family = none)]
452        pub unsafe fn setAttenuationEndDistance(&self, attenuation_end_distance: CGFloat);
453
454        #[cfg(feature = "objc2-core-foundation")]
455        /// Specifies the attenuation between the start and end attenuation distances. 0 means a constant attenuation, 1 a linear attenuation and 2 a quadratic attenuation, but any positive value will work (Omni or Spot light types only). Animatable. Defaults to 2.
456        #[unsafe(method(attenuationFalloffExponent))]
457        #[unsafe(method_family = none)]
458        pub unsafe fn attenuationFalloffExponent(&self) -> CGFloat;
459
460        #[cfg(feature = "objc2-core-foundation")]
461        /// Setter for [`attenuationFalloffExponent`][Self::attenuationFalloffExponent].
462        #[unsafe(method(setAttenuationFalloffExponent:))]
463        #[unsafe(method_family = none)]
464        pub unsafe fn setAttenuationFalloffExponent(&self, attenuation_falloff_exponent: CGFloat);
465
466        #[cfg(feature = "objc2-core-foundation")]
467        /// The angle in degrees between the spot direction and the lit element below which the lighting is at full strength. Animatable. Defaults to 0.
468        #[unsafe(method(spotInnerAngle))]
469        #[unsafe(method_family = none)]
470        pub unsafe fn spotInnerAngle(&self) -> CGFloat;
471
472        #[cfg(feature = "objc2-core-foundation")]
473        /// Setter for [`spotInnerAngle`][Self::spotInnerAngle].
474        #[unsafe(method(setSpotInnerAngle:))]
475        #[unsafe(method_family = none)]
476        pub unsafe fn setSpotInnerAngle(&self, spot_inner_angle: CGFloat);
477
478        #[cfg(feature = "objc2-core-foundation")]
479        /// The angle in degrees between the spot direction and the lit element after which the lighting is at zero strength. Animatable. Defaults to 45 degrees.
480        #[unsafe(method(spotOuterAngle))]
481        #[unsafe(method_family = none)]
482        pub unsafe fn spotOuterAngle(&self) -> CGFloat;
483
484        #[cfg(feature = "objc2-core-foundation")]
485        /// Setter for [`spotOuterAngle`][Self::spotOuterAngle].
486        #[unsafe(method(setSpotOuterAngle:))]
487        #[unsafe(method_family = none)]
488        pub unsafe fn setSpotOuterAngle(&self, spot_outer_angle: CGFloat);
489
490        /// Specifies the IES file from which the shape, direction, and intensity of illumination is determined. Defaults to nil.
491        #[unsafe(method(IESProfileURL))]
492        #[unsafe(method_family = none)]
493        pub unsafe fn IESProfileURL(&self) -> Option<Retained<NSURL>>;
494
495        /// Setter for [`IESProfileURL`][Self::IESProfileURL].
496        #[unsafe(method(setIESProfileURL:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn setIESProfileURL(&self, ies_profile_url: Option<&NSURL>);
499
500        /// The receiver's spherical harmonics coefficients.
501        ///
502        /// Currently spherical harmonics are only supported by light probes (SCNLightTypeProbe). The data is an array of 27 32-bit floating-point values, containing three non-interleaved data sets corresponding to the red, green, and blue sets of coefficients.
503        #[unsafe(method(sphericalHarmonicsCoefficients))]
504        #[unsafe(method_family = none)]
505        pub unsafe fn sphericalHarmonicsCoefficients(&self) -> Retained<NSData>;
506
507        #[unsafe(method(probeType))]
508        #[unsafe(method_family = none)]
509        pub unsafe fn probeType(&self) -> SCNLightProbeType;
510
511        /// Setter for [`probeType`][Self::probeType].
512        #[unsafe(method(setProbeType:))]
513        #[unsafe(method_family = none)]
514        pub unsafe fn setProbeType(&self, probe_type: SCNLightProbeType);
515
516        #[unsafe(method(probeUpdateType))]
517        #[unsafe(method_family = none)]
518        pub unsafe fn probeUpdateType(&self) -> SCNLightProbeUpdateType;
519
520        /// Setter for [`probeUpdateType`][Self::probeUpdateType].
521        #[unsafe(method(setProbeUpdateType:))]
522        #[unsafe(method_family = none)]
523        pub unsafe fn setProbeUpdateType(&self, probe_update_type: SCNLightProbeUpdateType);
524
525        #[unsafe(method(parallaxCorrectionEnabled))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn parallaxCorrectionEnabled(&self) -> bool;
528
529        /// Setter for [`parallaxCorrectionEnabled`][Self::parallaxCorrectionEnabled].
530        #[unsafe(method(setParallaxCorrectionEnabled:))]
531        #[unsafe(method_family = none)]
532        pub unsafe fn setParallaxCorrectionEnabled(&self, parallax_correction_enabled: bool);
533
534        #[cfg(feature = "SCNMaterialProperty")]
535        #[unsafe(method(probeEnvironment))]
536        #[unsafe(method_family = none)]
537        pub unsafe fn probeEnvironment(&self) -> Option<Retained<SCNMaterialProperty>>;
538
539        /// Determines the shape of a light of type SCNLightTypeArea. Defaults to SCNLightAreaTypeRectangle.
540        #[unsafe(method(areaType))]
541        #[unsafe(method_family = none)]
542        pub unsafe fn areaType(&self) -> SCNLightAreaType;
543
544        /// Setter for [`areaType`][Self::areaType].
545        #[unsafe(method(setAreaType:))]
546        #[unsafe(method_family = none)]
547        pub unsafe fn setAreaType(&self, area_type: SCNLightAreaType);
548
549        /// Determines the shape of light of an area light of type SCNLightAreaTypePolygon. Defaults nil.
550        ///
551        /// An array of CGPoint values corresponding to the coordinates of the polygon's vertices in the XY plane.
552        #[unsafe(method(areaPolygonVertices))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn areaPolygonVertices(&self) -> Option<Retained<NSArray<NSValue>>>;
555
556        /// Setter for [`areaPolygonVertices`][Self::areaPolygonVertices].
557        #[unsafe(method(setAreaPolygonVertices:))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn setAreaPolygonVertices(
560            &self,
561            area_polygon_vertices: Option<&NSArray<NSValue>>,
562        );
563
564        /// Determines whether the shape of a light of type SCNLightTypeArea is drawn in the scene. Defaults to YES.
565        #[unsafe(method(drawsArea))]
566        #[unsafe(method_family = none)]
567        pub unsafe fn drawsArea(&self) -> bool;
568
569        /// Setter for [`drawsArea`][Self::drawsArea].
570        #[unsafe(method(setDrawsArea:))]
571        #[unsafe(method_family = none)]
572        pub unsafe fn setDrawsArea(&self, draws_area: bool);
573
574        /// Determines whether a light of type SCNLightTypeArea is double-sided. Defaults NO.
575        ///
576        /// Area lights of type SCNLightAreaTypeRectangle or SCNLightAreaTypePolygon emit light along the -Z axis. When set to YES, they also emit light along the +Z axis.
577        #[unsafe(method(doubleSided))]
578        #[unsafe(method_family = none)]
579        pub unsafe fn doubleSided(&self) -> bool;
580
581        /// Setter for [`doubleSided`][Self::doubleSided].
582        #[unsafe(method(setDoubleSided:))]
583        #[unsafe(method_family = none)]
584        pub unsafe fn setDoubleSided(&self, double_sided: bool);
585
586        #[cfg(feature = "SCNMaterialProperty")]
587        /// Specifies the gobo (or "cookie") of the light, used to control the shape of emitted light.
588        ///
589        /// Gobos are only supported by spot lights.
590        #[unsafe(method(gobo))]
591        #[unsafe(method_family = none)]
592        pub unsafe fn gobo(&self) -> Option<Retained<SCNMaterialProperty>>;
593
594        /// Determines the node categories that will be lit by the receiver. Defaults to all bit set.
595        #[unsafe(method(categoryBitMask))]
596        #[unsafe(method_family = none)]
597        pub unsafe fn categoryBitMask(&self) -> NSUInteger;
598
599        /// Setter for [`categoryBitMask`][Self::categoryBitMask].
600        #[unsafe(method(setCategoryBitMask:))]
601        #[unsafe(method_family = none)]
602        pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
603    );
604}
605
606/// Methods declared on superclass `NSObject`.
607impl SCNLight {
608    extern_methods!(
609        #[unsafe(method(init))]
610        #[unsafe(method_family = init)]
611        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
612
613        #[unsafe(method(new))]
614        #[unsafe(method_family = new)]
615        pub unsafe fn new() -> Retained<Self>;
616    );
617}