objc2_scene_kit/generated/
SCNLight.rs1use 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
12pub type SCNLightType = NSString;
19
20extern "C" {
21 pub static SCNLightTypeAmbient: &'static SCNLightType;
23}
24
25extern "C" {
26 pub static SCNLightTypeOmni: &'static SCNLightType;
28}
29
30extern "C" {
31 pub static SCNLightTypeDirectional: &'static SCNLightType;
33}
34
35extern "C" {
36 pub static SCNLightTypeSpot: &'static SCNLightType;
38}
39
40extern "C" {
41 pub static SCNLightTypeIES: &'static SCNLightType;
43}
44
45extern "C" {
46 pub static SCNLightTypeProbe: &'static SCNLightType;
48}
49
50extern "C" {
51 pub static SCNLightTypeArea: &'static SCNLightType;
53}
54
55#[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#[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#[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#[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 #[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 #[unsafe(method(light))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn light() -> Retained<Self>;
173
174 #[unsafe(method(type))]
178 #[unsafe(method_family = none)]
179 pub unsafe fn r#type(&self) -> Retained<SCNLightType>;
180
181 #[unsafe(method(setType:))]
183 #[unsafe(method_family = none)]
184 pub unsafe fn setType(&self, r#type: &SCNLightType);
185
186 #[unsafe(method(color))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn color(&self) -> Retained<AnyObject>;
192
193 #[unsafe(method(setColor:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn setColor(&self, color: &AnyObject);
197
198 #[cfg(feature = "objc2-core-foundation")]
199 #[unsafe(method(temperature))]
203 #[unsafe(method_family = none)]
204 pub unsafe fn temperature(&self) -> CGFloat;
205
206 #[cfg(feature = "objc2-core-foundation")]
207 #[unsafe(method(setTemperature:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn setTemperature(&self, temperature: CGFloat);
211
212 #[cfg(feature = "objc2-core-foundation")]
213 #[unsafe(method(intensity))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn intensity(&self) -> CGFloat;
219
220 #[cfg(feature = "objc2-core-foundation")]
221 #[unsafe(method(setIntensity:))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn setIntensity(&self, intensity: CGFloat);
225
226 #[unsafe(method(name))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
230
231 #[unsafe(method(setName:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setName(&self, name: Option<&NSString>);
235
236 #[unsafe(method(castsShadow))]
240 #[unsafe(method_family = none)]
241 pub unsafe fn castsShadow(&self) -> bool;
242
243 #[unsafe(method(setCastsShadow:))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn setCastsShadow(&self, casts_shadow: bool);
247
248 #[unsafe(method(shadowColor))]
252 #[unsafe(method_family = none)]
253 pub unsafe fn shadowColor(&self) -> Retained<AnyObject>;
254
255 #[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 #[unsafe(method(shadowRadius))]
263 #[unsafe(method_family = none)]
264 pub unsafe fn shadowRadius(&self) -> CGFloat;
265
266 #[cfg(feature = "objc2-core-foundation")]
267 #[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 #[unsafe(method(shadowMapSize))]
277 #[unsafe(method_family = none)]
278 pub unsafe fn shadowMapSize(&self) -> CGSize;
279
280 #[cfg(feature = "objc2-core-foundation")]
281 #[unsafe(method(setShadowMapSize:))]
283 #[unsafe(method_family = none)]
284 pub unsafe fn setShadowMapSize(&self, shadow_map_size: CGSize);
285
286 #[unsafe(method(shadowSampleCount))]
291 #[unsafe(method_family = none)]
292 pub unsafe fn shadowSampleCount(&self) -> NSUInteger;
293
294 #[unsafe(method(setShadowSampleCount:))]
296 #[unsafe(method_family = none)]
297 pub unsafe fn setShadowSampleCount(&self, shadow_sample_count: NSUInteger);
298
299 #[unsafe(method(shadowMode))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn shadowMode(&self) -> SCNShadowMode;
303
304 #[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 #[unsafe(method(shadowBias))]
312 #[unsafe(method_family = none)]
313 pub unsafe fn shadowBias(&self) -> CGFloat;
314
315 #[cfg(feature = "objc2-core-foundation")]
316 #[unsafe(method(setShadowBias:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setShadowBias(&self, shadow_bias: CGFloat);
320
321 #[unsafe(method(automaticallyAdjustsShadowProjection))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn automaticallyAdjustsShadowProjection(&self) -> bool;
325
326 #[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 #[unsafe(method(maximumShadowDistance))]
337 #[unsafe(method_family = none)]
338 pub unsafe fn maximumShadowDistance(&self) -> CGFloat;
339
340 #[cfg(feature = "objc2-core-foundation")]
341 #[unsafe(method(setMaximumShadowDistance:))]
343 #[unsafe(method_family = none)]
344 pub unsafe fn setMaximumShadowDistance(&self, maximum_shadow_distance: CGFloat);
345
346 #[unsafe(method(forcesBackFaceCasters))]
349 #[unsafe(method_family = none)]
350 pub unsafe fn forcesBackFaceCasters(&self) -> bool;
351
352 #[unsafe(method(setForcesBackFaceCasters:))]
354 #[unsafe(method_family = none)]
355 pub unsafe fn setForcesBackFaceCasters(&self, forces_back_face_casters: bool);
356
357 #[unsafe(method(sampleDistributedShadowMaps))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn sampleDistributedShadowMaps(&self) -> bool;
361
362 #[unsafe(method(setSampleDistributedShadowMaps:))]
364 #[unsafe(method_family = none)]
365 pub unsafe fn setSampleDistributedShadowMaps(&self, sample_distributed_shadow_maps: bool);
366
367 #[unsafe(method(shadowCascadeCount))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn shadowCascadeCount(&self) -> NSUInteger;
371
372 #[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 #[unsafe(method(shadowCascadeSplittingFactor))]
380 #[unsafe(method_family = none)]
381 pub unsafe fn shadowCascadeSplittingFactor(&self) -> CGFloat;
382
383 #[cfg(feature = "objc2-core-foundation")]
384 #[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 #[unsafe(method(orthographicScale))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn orthographicScale(&self) -> CGFloat;
399
400 #[cfg(feature = "objc2-core-foundation")]
401 #[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 #[unsafe(method(zNear))]
409 #[unsafe(method_family = none)]
410 pub unsafe fn zNear(&self) -> CGFloat;
411
412 #[cfg(feature = "objc2-core-foundation")]
413 #[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 #[unsafe(method(zFar))]
421 #[unsafe(method_family = none)]
422 pub unsafe fn zFar(&self) -> CGFloat;
423
424 #[cfg(feature = "objc2-core-foundation")]
425 #[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 #[unsafe(method(attenuationStartDistance))]
433 #[unsafe(method_family = none)]
434 pub unsafe fn attenuationStartDistance(&self) -> CGFloat;
435
436 #[cfg(feature = "objc2-core-foundation")]
437 #[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 #[unsafe(method(attenuationEndDistance))]
445 #[unsafe(method_family = none)]
446 pub unsafe fn attenuationEndDistance(&self) -> CGFloat;
447
448 #[cfg(feature = "objc2-core-foundation")]
449 #[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 #[unsafe(method(attenuationFalloffExponent))]
457 #[unsafe(method_family = none)]
458 pub unsafe fn attenuationFalloffExponent(&self) -> CGFloat;
459
460 #[cfg(feature = "objc2-core-foundation")]
461 #[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 #[unsafe(method(spotInnerAngle))]
469 #[unsafe(method_family = none)]
470 pub unsafe fn spotInnerAngle(&self) -> CGFloat;
471
472 #[cfg(feature = "objc2-core-foundation")]
473 #[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 #[unsafe(method(spotOuterAngle))]
481 #[unsafe(method_family = none)]
482 pub unsafe fn spotOuterAngle(&self) -> CGFloat;
483
484 #[cfg(feature = "objc2-core-foundation")]
485 #[unsafe(method(setSpotOuterAngle:))]
487 #[unsafe(method_family = none)]
488 pub unsafe fn setSpotOuterAngle(&self, spot_outer_angle: CGFloat);
489
490 #[unsafe(method(IESProfileURL))]
492 #[unsafe(method_family = none)]
493 pub unsafe fn IESProfileURL(&self) -> Option<Retained<NSURL>>;
494
495 #[unsafe(method(setIESProfileURL:))]
497 #[unsafe(method_family = none)]
498 pub unsafe fn setIESProfileURL(&self, ies_profile_url: Option<&NSURL>);
499
500 #[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 #[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 #[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 #[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 #[unsafe(method(areaType))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn areaType(&self) -> SCNLightAreaType;
543
544 #[unsafe(method(setAreaType:))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn setAreaType(&self, area_type: SCNLightAreaType);
548
549 #[unsafe(method(areaPolygonVertices))]
553 #[unsafe(method_family = none)]
554 pub unsafe fn areaPolygonVertices(&self) -> Option<Retained<NSArray<NSValue>>>;
555
556 #[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 #[unsafe(method(drawsArea))]
566 #[unsafe(method_family = none)]
567 pub unsafe fn drawsArea(&self) -> bool;
568
569 #[unsafe(method(setDrawsArea:))]
571 #[unsafe(method_family = none)]
572 pub unsafe fn setDrawsArea(&self, draws_area: bool);
573
574 #[unsafe(method(doubleSided))]
578 #[unsafe(method_family = none)]
579 pub unsafe fn doubleSided(&self) -> bool;
580
581 #[unsafe(method(setDoubleSided:))]
583 #[unsafe(method_family = none)]
584 pub unsafe fn setDoubleSided(&self, double_sided: bool);
585
586 #[cfg(feature = "SCNMaterialProperty")]
587 #[unsafe(method(gobo))]
591 #[unsafe(method_family = none)]
592 pub unsafe fn gobo(&self) -> Option<Retained<SCNMaterialProperty>>;
593
594 #[unsafe(method(categoryBitMask))]
596 #[unsafe(method_family = none)]
597 pub unsafe fn categoryBitMask(&self) -> NSUInteger;
598
599 #[unsafe(method(setCategoryBitMask:))]
601 #[unsafe(method_family = none)]
602 pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
603 );
604}
605
606impl 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}