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
152extern_conformance!(
153    unsafe impl NSCoding for SCNLight {}
154);
155
156extern_conformance!(
157    unsafe impl NSCopying for SCNLight {}
158);
159
160unsafe impl CopyingHelper for SCNLight {
161    type Result = Self;
162}
163
164extern_conformance!(
165    unsafe impl NSObjectProtocol for SCNLight {}
166);
167
168extern_conformance!(
169    unsafe impl NSSecureCoding for SCNLight {}
170);
171
172#[cfg(feature = "SCNAnimation")]
173extern_conformance!(
174    unsafe impl SCNAnimatable for SCNLight {}
175);
176
177impl SCNLight {
178    extern_methods!(
179        /// Creates and returns a light instance.
180        #[unsafe(method(light))]
181        #[unsafe(method_family = none)]
182        pub unsafe fn light() -> Retained<Self>;
183
184        /// Specifies the receiver's type.
185        ///
186        /// Defaults to SCNLightTypeOmni on iOS 8 and later, and on macOS 10.10 and later (otherwise defaults to SCNLightTypeAmbient).
187        #[unsafe(method(type))]
188        #[unsafe(method_family = none)]
189        pub unsafe fn r#type(&self) -> Retained<SCNLightType>;
190
191        /// Setter for [`type`][Self::type].
192        ///
193        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
194        #[unsafe(method(setType:))]
195        #[unsafe(method_family = none)]
196        pub unsafe fn setType(&self, r#type: &SCNLightType);
197
198        /// Specifies the receiver's color (NSColor or CGColorRef). Animatable. Defaults to white.
199        ///
200        /// The initial value is a NSColor. The renderer multiplies the light's color is by the color derived from the light's temperature.
201        #[unsafe(method(color))]
202        #[unsafe(method_family = none)]
203        pub unsafe fn color(&self) -> Retained<AnyObject>;
204
205        /// Setter for [`color`][Self::color].
206        ///
207        /// # Safety
208        ///
209        /// `color` should be of the correct type.
210        #[unsafe(method(setColor:))]
211        #[unsafe(method_family = none)]
212        pub unsafe fn setColor(&self, color: &AnyObject);
213
214        #[cfg(feature = "objc2-core-foundation")]
215        /// Specifies the receiver's temperature.
216        ///
217        /// 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.
218        #[unsafe(method(temperature))]
219        #[unsafe(method_family = none)]
220        pub unsafe fn temperature(&self) -> CGFloat;
221
222        #[cfg(feature = "objc2-core-foundation")]
223        /// Setter for [`temperature`][Self::temperature].
224        #[unsafe(method(setTemperature:))]
225        #[unsafe(method_family = none)]
226        pub unsafe fn setTemperature(&self, temperature: CGFloat);
227
228        #[cfg(feature = "objc2-core-foundation")]
229        /// Specifies the receiver's intensity.
230        ///
231        /// 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.
232        #[unsafe(method(intensity))]
233        #[unsafe(method_family = none)]
234        pub unsafe fn intensity(&self) -> CGFloat;
235
236        #[cfg(feature = "objc2-core-foundation")]
237        /// Setter for [`intensity`][Self::intensity].
238        #[unsafe(method(setIntensity:))]
239        #[unsafe(method_family = none)]
240        pub unsafe fn setIntensity(&self, intensity: CGFloat);
241
242        /// Determines the name of the receiver.
243        #[unsafe(method(name))]
244        #[unsafe(method_family = none)]
245        pub unsafe fn name(&self) -> Option<Retained<NSString>>;
246
247        /// Setter for [`name`][Self::name].
248        ///
249        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
250        #[unsafe(method(setName:))]
251        #[unsafe(method_family = none)]
252        pub unsafe fn setName(&self, name: Option<&NSString>);
253
254        /// Determines whether the receiver casts a shadow. Defaults to NO.
255        ///
256        /// Shadows are only supported by spot and directional lights.
257        #[unsafe(method(castsShadow))]
258        #[unsafe(method_family = none)]
259        pub unsafe fn castsShadow(&self) -> bool;
260
261        /// Setter for [`castsShadow`][Self::castsShadow].
262        #[unsafe(method(setCastsShadow:))]
263        #[unsafe(method_family = none)]
264        pub unsafe fn setCastsShadow(&self, casts_shadow: bool);
265
266        /// Specifies the color (CGColorRef or NSColor) of the shadow casted by the receiver. Defaults to black. Animatable.
267        ///
268        /// On iOS 9 or earlier and macOS 10.11 or earlier, this defaults to black 50% transparent.
269        #[unsafe(method(shadowColor))]
270        #[unsafe(method_family = none)]
271        pub unsafe fn shadowColor(&self) -> Retained<AnyObject>;
272
273        /// Setter for [`shadowColor`][Self::shadowColor].
274        ///
275        /// # Safety
276        ///
277        /// `shadow_color` should be of the correct type.
278        #[unsafe(method(setShadowColor:))]
279        #[unsafe(method_family = none)]
280        pub unsafe fn setShadowColor(&self, shadow_color: &AnyObject);
281
282        #[cfg(feature = "objc2-core-foundation")]
283        /// Specifies the sample radius used to render the receiver’s shadow. Default value is 3.0. Animatable.
284        #[unsafe(method(shadowRadius))]
285        #[unsafe(method_family = none)]
286        pub unsafe fn shadowRadius(&self) -> CGFloat;
287
288        #[cfg(feature = "objc2-core-foundation")]
289        /// Setter for [`shadowRadius`][Self::shadowRadius].
290        #[unsafe(method(setShadowRadius:))]
291        #[unsafe(method_family = none)]
292        pub unsafe fn setShadowRadius(&self, shadow_radius: CGFloat);
293
294        #[cfg(feature = "objc2-core-foundation")]
295        /// Specifies the size of the shadow map.
296        ///
297        /// 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}.
298        #[unsafe(method(shadowMapSize))]
299        #[unsafe(method_family = none)]
300        pub unsafe fn shadowMapSize(&self) -> CGSize;
301
302        #[cfg(feature = "objc2-core-foundation")]
303        /// Setter for [`shadowMapSize`][Self::shadowMapSize].
304        #[unsafe(method(setShadowMapSize:))]
305        #[unsafe(method_family = none)]
306        pub unsafe fn setShadowMapSize(&self, shadow_map_size: CGSize);
307
308        /// Specifies the number of sample per fragment to compute the shadow map. Defaults to 0.
309        ///
310        /// On macOS 10.11 or earlier, the shadowSampleCount defaults to 16. On iOS 9 or earlier it defaults to 1.0.
311        /// 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.
312        #[unsafe(method(shadowSampleCount))]
313        #[unsafe(method_family = none)]
314        pub unsafe fn shadowSampleCount(&self) -> NSUInteger;
315
316        /// Setter for [`shadowSampleCount`][Self::shadowSampleCount].
317        #[unsafe(method(setShadowSampleCount:))]
318        #[unsafe(method_family = none)]
319        pub unsafe fn setShadowSampleCount(&self, shadow_sample_count: NSUInteger);
320
321        /// 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.
322        #[unsafe(method(shadowMode))]
323        #[unsafe(method_family = none)]
324        pub unsafe fn shadowMode(&self) -> SCNShadowMode;
325
326        /// Setter for [`shadowMode`][Self::shadowMode].
327        #[unsafe(method(setShadowMode:))]
328        #[unsafe(method_family = none)]
329        pub unsafe fn setShadowMode(&self, shadow_mode: SCNShadowMode);
330
331        #[cfg(feature = "objc2-core-foundation")]
332        /// 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
333        #[unsafe(method(shadowBias))]
334        #[unsafe(method_family = none)]
335        pub unsafe fn shadowBias(&self) -> CGFloat;
336
337        #[cfg(feature = "objc2-core-foundation")]
338        /// Setter for [`shadowBias`][Self::shadowBias].
339        #[unsafe(method(setShadowBias:))]
340        #[unsafe(method_family = none)]
341        pub unsafe fn setShadowBias(&self, shadow_bias: CGFloat);
342
343        /// Specifies if the shadow map projection should be done automatically or manually by the user. Defaults to YES.
344        #[unsafe(method(automaticallyAdjustsShadowProjection))]
345        #[unsafe(method_family = none)]
346        pub unsafe fn automaticallyAdjustsShadowProjection(&self) -> bool;
347
348        /// Setter for [`automaticallyAdjustsShadowProjection`][Self::automaticallyAdjustsShadowProjection].
349        #[unsafe(method(setAutomaticallyAdjustsShadowProjection:))]
350        #[unsafe(method_family = none)]
351        pub unsafe fn setAutomaticallyAdjustsShadowProjection(
352            &self,
353            automatically_adjusts_shadow_projection: bool,
354        );
355
356        #[cfg(feature = "objc2-core-foundation")]
357        /// Specifies the maximum distance from the viewpoint from which the shadows for the receiver light won't be computed. Defaults to 100.0.
358        #[unsafe(method(maximumShadowDistance))]
359        #[unsafe(method_family = none)]
360        pub unsafe fn maximumShadowDistance(&self) -> CGFloat;
361
362        #[cfg(feature = "objc2-core-foundation")]
363        /// Setter for [`maximumShadowDistance`][Self::maximumShadowDistance].
364        #[unsafe(method(setMaximumShadowDistance:))]
365        #[unsafe(method_family = none)]
366        pub unsafe fn setMaximumShadowDistance(&self, maximum_shadow_distance: CGFloat);
367
368        /// Render only back faces of the shadow caster when enabled. Defaults to NO.
369        /// This is a behavior change from previous releases.
370        #[unsafe(method(forcesBackFaceCasters))]
371        #[unsafe(method_family = none)]
372        pub unsafe fn forcesBackFaceCasters(&self) -> bool;
373
374        /// Setter for [`forcesBackFaceCasters`][Self::forcesBackFaceCasters].
375        #[unsafe(method(setForcesBackFaceCasters:))]
376        #[unsafe(method_family = none)]
377        pub unsafe fn setForcesBackFaceCasters(&self, forces_back_face_casters: bool);
378
379        /// Use the sample distribution of the main rendering to better fit the shadow frusta. Defaults to NO.
380        #[unsafe(method(sampleDistributedShadowMaps))]
381        #[unsafe(method_family = none)]
382        pub unsafe fn sampleDistributedShadowMaps(&self) -> bool;
383
384        /// Setter for [`sampleDistributedShadowMaps`][Self::sampleDistributedShadowMaps].
385        #[unsafe(method(setSampleDistributedShadowMaps:))]
386        #[unsafe(method_family = none)]
387        pub unsafe fn setSampleDistributedShadowMaps(&self, sample_distributed_shadow_maps: bool);
388
389        /// Specifies the number of distinct shadow maps that will be computed for the receiver light. Defaults to 1. Maximum is 4.
390        #[unsafe(method(shadowCascadeCount))]
391        #[unsafe(method_family = none)]
392        pub unsafe fn shadowCascadeCount(&self) -> NSUInteger;
393
394        /// Setter for [`shadowCascadeCount`][Self::shadowCascadeCount].
395        #[unsafe(method(setShadowCascadeCount:))]
396        #[unsafe(method_family = none)]
397        pub unsafe fn setShadowCascadeCount(&self, shadow_cascade_count: NSUInteger);
398
399        #[cfg(feature = "objc2-core-foundation")]
400        /// Specifies a factor to interpolate between linear splitting (0) and logarithmic splitting (1). Defaults to 0.15.
401        #[unsafe(method(shadowCascadeSplittingFactor))]
402        #[unsafe(method_family = none)]
403        pub unsafe fn shadowCascadeSplittingFactor(&self) -> CGFloat;
404
405        #[cfg(feature = "objc2-core-foundation")]
406        /// Setter for [`shadowCascadeSplittingFactor`][Self::shadowCascadeSplittingFactor].
407        #[unsafe(method(setShadowCascadeSplittingFactor:))]
408        #[unsafe(method_family = none)]
409        pub unsafe fn setShadowCascadeSplittingFactor(
410            &self,
411            shadow_cascade_splitting_factor: CGFloat,
412        );
413
414        #[cfg(feature = "objc2-core-foundation")]
415        /// Specifies the orthographic scale used to render from the directional light into the shadow map. Defaults to 1.
416        ///
417        /// This is only applicable for directional lights.
418        #[unsafe(method(orthographicScale))]
419        #[unsafe(method_family = none)]
420        pub unsafe fn orthographicScale(&self) -> CGFloat;
421
422        #[cfg(feature = "objc2-core-foundation")]
423        /// Setter for [`orthographicScale`][Self::orthographicScale].
424        #[unsafe(method(setOrthographicScale:))]
425        #[unsafe(method_family = none)]
426        pub unsafe fn setOrthographicScale(&self, orthographic_scale: CGFloat);
427
428        #[cfg(feature = "objc2-core-foundation")]
429        /// 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.
430        #[unsafe(method(zNear))]
431        #[unsafe(method_family = none)]
432        pub unsafe fn zNear(&self) -> CGFloat;
433
434        #[cfg(feature = "objc2-core-foundation")]
435        /// Setter for [`zNear`][Self::zNear].
436        #[unsafe(method(setZNear:))]
437        #[unsafe(method_family = none)]
438        pub unsafe fn setZNear(&self, z_near: CGFloat);
439
440        #[cfg(feature = "objc2-core-foundation")]
441        /// 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.
442        #[unsafe(method(zFar))]
443        #[unsafe(method_family = none)]
444        pub unsafe fn zFar(&self) -> CGFloat;
445
446        #[cfg(feature = "objc2-core-foundation")]
447        /// Setter for [`zFar`][Self::zFar].
448        #[unsafe(method(setZFar:))]
449        #[unsafe(method_family = none)]
450        pub unsafe fn setZFar(&self, z_far: CGFloat);
451
452        #[cfg(feature = "objc2-core-foundation")]
453        /// The distance at which the attenuation starts (Omni or Spot light types only). Animatable. Defaults to 0.
454        #[unsafe(method(attenuationStartDistance))]
455        #[unsafe(method_family = none)]
456        pub unsafe fn attenuationStartDistance(&self) -> CGFloat;
457
458        #[cfg(feature = "objc2-core-foundation")]
459        /// Setter for [`attenuationStartDistance`][Self::attenuationStartDistance].
460        #[unsafe(method(setAttenuationStartDistance:))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn setAttenuationStartDistance(&self, attenuation_start_distance: CGFloat);
463
464        #[cfg(feature = "objc2-core-foundation")]
465        /// The distance at which the attenuation ends (Omni or Spot light types only). Animatable. Defaults to 0.
466        #[unsafe(method(attenuationEndDistance))]
467        #[unsafe(method_family = none)]
468        pub unsafe fn attenuationEndDistance(&self) -> CGFloat;
469
470        #[cfg(feature = "objc2-core-foundation")]
471        /// Setter for [`attenuationEndDistance`][Self::attenuationEndDistance].
472        #[unsafe(method(setAttenuationEndDistance:))]
473        #[unsafe(method_family = none)]
474        pub unsafe fn setAttenuationEndDistance(&self, attenuation_end_distance: CGFloat);
475
476        #[cfg(feature = "objc2-core-foundation")]
477        /// 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.
478        #[unsafe(method(attenuationFalloffExponent))]
479        #[unsafe(method_family = none)]
480        pub unsafe fn attenuationFalloffExponent(&self) -> CGFloat;
481
482        #[cfg(feature = "objc2-core-foundation")]
483        /// Setter for [`attenuationFalloffExponent`][Self::attenuationFalloffExponent].
484        #[unsafe(method(setAttenuationFalloffExponent:))]
485        #[unsafe(method_family = none)]
486        pub unsafe fn setAttenuationFalloffExponent(&self, attenuation_falloff_exponent: CGFloat);
487
488        #[cfg(feature = "objc2-core-foundation")]
489        /// The angle in degrees between the spot direction and the lit element below which the lighting is at full strength. Animatable. Defaults to 0.
490        #[unsafe(method(spotInnerAngle))]
491        #[unsafe(method_family = none)]
492        pub unsafe fn spotInnerAngle(&self) -> CGFloat;
493
494        #[cfg(feature = "objc2-core-foundation")]
495        /// Setter for [`spotInnerAngle`][Self::spotInnerAngle].
496        #[unsafe(method(setSpotInnerAngle:))]
497        #[unsafe(method_family = none)]
498        pub unsafe fn setSpotInnerAngle(&self, spot_inner_angle: CGFloat);
499
500        #[cfg(feature = "objc2-core-foundation")]
501        /// 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.
502        #[unsafe(method(spotOuterAngle))]
503        #[unsafe(method_family = none)]
504        pub unsafe fn spotOuterAngle(&self) -> CGFloat;
505
506        #[cfg(feature = "objc2-core-foundation")]
507        /// Setter for [`spotOuterAngle`][Self::spotOuterAngle].
508        #[unsafe(method(setSpotOuterAngle:))]
509        #[unsafe(method_family = none)]
510        pub unsafe fn setSpotOuterAngle(&self, spot_outer_angle: CGFloat);
511
512        /// Specifies the IES file from which the shape, direction, and intensity of illumination is determined. Defaults to nil.
513        #[unsafe(method(IESProfileURL))]
514        #[unsafe(method_family = none)]
515        pub unsafe fn IESProfileURL(&self) -> Option<Retained<NSURL>>;
516
517        /// Setter for [`IESProfileURL`][Self::IESProfileURL].
518        #[unsafe(method(setIESProfileURL:))]
519        #[unsafe(method_family = none)]
520        pub unsafe fn setIESProfileURL(&self, ies_profile_url: Option<&NSURL>);
521
522        /// The receiver's spherical harmonics coefficients.
523        ///
524        /// 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.
525        #[unsafe(method(sphericalHarmonicsCoefficients))]
526        #[unsafe(method_family = none)]
527        pub unsafe fn sphericalHarmonicsCoefficients(&self) -> Retained<NSData>;
528
529        #[unsafe(method(probeType))]
530        #[unsafe(method_family = none)]
531        pub unsafe fn probeType(&self) -> SCNLightProbeType;
532
533        /// Setter for [`probeType`][Self::probeType].
534        #[unsafe(method(setProbeType:))]
535        #[unsafe(method_family = none)]
536        pub unsafe fn setProbeType(&self, probe_type: SCNLightProbeType);
537
538        #[unsafe(method(probeUpdateType))]
539        #[unsafe(method_family = none)]
540        pub unsafe fn probeUpdateType(&self) -> SCNLightProbeUpdateType;
541
542        /// Setter for [`probeUpdateType`][Self::probeUpdateType].
543        #[unsafe(method(setProbeUpdateType:))]
544        #[unsafe(method_family = none)]
545        pub unsafe fn setProbeUpdateType(&self, probe_update_type: SCNLightProbeUpdateType);
546
547        #[unsafe(method(parallaxCorrectionEnabled))]
548        #[unsafe(method_family = none)]
549        pub unsafe fn parallaxCorrectionEnabled(&self) -> bool;
550
551        /// Setter for [`parallaxCorrectionEnabled`][Self::parallaxCorrectionEnabled].
552        #[unsafe(method(setParallaxCorrectionEnabled:))]
553        #[unsafe(method_family = none)]
554        pub unsafe fn setParallaxCorrectionEnabled(&self, parallax_correction_enabled: bool);
555
556        #[cfg(feature = "SCNMaterialProperty")]
557        #[unsafe(method(probeEnvironment))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn probeEnvironment(&self) -> Option<Retained<SCNMaterialProperty>>;
560
561        /// Determines the shape of a light of type SCNLightTypeArea. Defaults to SCNLightAreaTypeRectangle.
562        #[unsafe(method(areaType))]
563        #[unsafe(method_family = none)]
564        pub unsafe fn areaType(&self) -> SCNLightAreaType;
565
566        /// Setter for [`areaType`][Self::areaType].
567        #[unsafe(method(setAreaType:))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn setAreaType(&self, area_type: SCNLightAreaType);
570
571        /// Determines the shape of light of an area light of type SCNLightAreaTypePolygon. Defaults nil.
572        ///
573        /// An array of CGPoint values corresponding to the coordinates of the polygon's vertices in the XY plane.
574        #[unsafe(method(areaPolygonVertices))]
575        #[unsafe(method_family = none)]
576        pub unsafe fn areaPolygonVertices(&self) -> Option<Retained<NSArray<NSValue>>>;
577
578        /// Setter for [`areaPolygonVertices`][Self::areaPolygonVertices].
579        ///
580        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
581        #[unsafe(method(setAreaPolygonVertices:))]
582        #[unsafe(method_family = none)]
583        pub unsafe fn setAreaPolygonVertices(
584            &self,
585            area_polygon_vertices: Option<&NSArray<NSValue>>,
586        );
587
588        /// Determines whether the shape of a light of type SCNLightTypeArea is drawn in the scene. Defaults to YES.
589        #[unsafe(method(drawsArea))]
590        #[unsafe(method_family = none)]
591        pub unsafe fn drawsArea(&self) -> bool;
592
593        /// Setter for [`drawsArea`][Self::drawsArea].
594        #[unsafe(method(setDrawsArea:))]
595        #[unsafe(method_family = none)]
596        pub unsafe fn setDrawsArea(&self, draws_area: bool);
597
598        /// Determines whether a light of type SCNLightTypeArea is double-sided. Defaults NO.
599        ///
600        /// 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.
601        #[unsafe(method(doubleSided))]
602        #[unsafe(method_family = none)]
603        pub unsafe fn doubleSided(&self) -> bool;
604
605        /// Setter for [`doubleSided`][Self::doubleSided].
606        #[unsafe(method(setDoubleSided:))]
607        #[unsafe(method_family = none)]
608        pub unsafe fn setDoubleSided(&self, double_sided: bool);
609
610        #[cfg(feature = "SCNMaterialProperty")]
611        /// Specifies the gobo (or "cookie") of the light, used to control the shape of emitted light.
612        ///
613        /// Gobos are only supported by spot lights.
614        #[unsafe(method(gobo))]
615        #[unsafe(method_family = none)]
616        pub unsafe fn gobo(&self) -> Option<Retained<SCNMaterialProperty>>;
617
618        /// Determines the node categories that will be lit by the receiver. Defaults to all bit set.
619        #[unsafe(method(categoryBitMask))]
620        #[unsafe(method_family = none)]
621        pub unsafe fn categoryBitMask(&self) -> NSUInteger;
622
623        /// Setter for [`categoryBitMask`][Self::categoryBitMask].
624        #[unsafe(method(setCategoryBitMask:))]
625        #[unsafe(method_family = none)]
626        pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
627    );
628}
629
630/// Methods declared on superclass `NSObject`.
631impl SCNLight {
632    extern_methods!(
633        #[unsafe(method(init))]
634        #[unsafe(method_family = init)]
635        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
636
637        #[unsafe(method(new))]
638        #[unsafe(method_family = new)]
639        pub unsafe fn new() -> Retained<Self>;
640    );
641}