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
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 #[unsafe(method(light))]
181 #[unsafe(method_family = none)]
182 pub unsafe fn light() -> Retained<Self>;
183
184 #[unsafe(method(type))]
188 #[unsafe(method_family = none)]
189 pub unsafe fn r#type(&self) -> Retained<SCNLightType>;
190
191 #[unsafe(method(setType:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn setType(&self, r#type: &SCNLightType);
197
198 #[unsafe(method(color))]
202 #[unsafe(method_family = none)]
203 pub unsafe fn color(&self) -> Retained<AnyObject>;
204
205 #[unsafe(method(setColor:))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn setColor(&self, color: &AnyObject);
213
214 #[cfg(feature = "objc2-core-foundation")]
215 #[unsafe(method(temperature))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn temperature(&self) -> CGFloat;
221
222 #[cfg(feature = "objc2-core-foundation")]
223 #[unsafe(method(setTemperature:))]
225 #[unsafe(method_family = none)]
226 pub unsafe fn setTemperature(&self, temperature: CGFloat);
227
228 #[cfg(feature = "objc2-core-foundation")]
229 #[unsafe(method(intensity))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn intensity(&self) -> CGFloat;
235
236 #[cfg(feature = "objc2-core-foundation")]
237 #[unsafe(method(setIntensity:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setIntensity(&self, intensity: CGFloat);
241
242 #[unsafe(method(name))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
246
247 #[unsafe(method(setName:))]
251 #[unsafe(method_family = none)]
252 pub unsafe fn setName(&self, name: Option<&NSString>);
253
254 #[unsafe(method(castsShadow))]
258 #[unsafe(method_family = none)]
259 pub unsafe fn castsShadow(&self) -> bool;
260
261 #[unsafe(method(setCastsShadow:))]
263 #[unsafe(method_family = none)]
264 pub unsafe fn setCastsShadow(&self, casts_shadow: bool);
265
266 #[unsafe(method(shadowColor))]
270 #[unsafe(method_family = none)]
271 pub unsafe fn shadowColor(&self) -> Retained<AnyObject>;
272
273 #[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 #[unsafe(method(shadowRadius))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn shadowRadius(&self) -> CGFloat;
287
288 #[cfg(feature = "objc2-core-foundation")]
289 #[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 #[unsafe(method(shadowMapSize))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn shadowMapSize(&self) -> CGSize;
301
302 #[cfg(feature = "objc2-core-foundation")]
303 #[unsafe(method(setShadowMapSize:))]
305 #[unsafe(method_family = none)]
306 pub unsafe fn setShadowMapSize(&self, shadow_map_size: CGSize);
307
308 #[unsafe(method(shadowSampleCount))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn shadowSampleCount(&self) -> NSUInteger;
315
316 #[unsafe(method(setShadowSampleCount:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn setShadowSampleCount(&self, shadow_sample_count: NSUInteger);
320
321 #[unsafe(method(shadowMode))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn shadowMode(&self) -> SCNShadowMode;
325
326 #[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 #[unsafe(method(shadowBias))]
334 #[unsafe(method_family = none)]
335 pub unsafe fn shadowBias(&self) -> CGFloat;
336
337 #[cfg(feature = "objc2-core-foundation")]
338 #[unsafe(method(setShadowBias:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setShadowBias(&self, shadow_bias: CGFloat);
342
343 #[unsafe(method(automaticallyAdjustsShadowProjection))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn automaticallyAdjustsShadowProjection(&self) -> bool;
347
348 #[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 #[unsafe(method(maximumShadowDistance))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn maximumShadowDistance(&self) -> CGFloat;
361
362 #[cfg(feature = "objc2-core-foundation")]
363 #[unsafe(method(setMaximumShadowDistance:))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn setMaximumShadowDistance(&self, maximum_shadow_distance: CGFloat);
367
368 #[unsafe(method(forcesBackFaceCasters))]
371 #[unsafe(method_family = none)]
372 pub unsafe fn forcesBackFaceCasters(&self) -> bool;
373
374 #[unsafe(method(setForcesBackFaceCasters:))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn setForcesBackFaceCasters(&self, forces_back_face_casters: bool);
378
379 #[unsafe(method(sampleDistributedShadowMaps))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn sampleDistributedShadowMaps(&self) -> bool;
383
384 #[unsafe(method(setSampleDistributedShadowMaps:))]
386 #[unsafe(method_family = none)]
387 pub unsafe fn setSampleDistributedShadowMaps(&self, sample_distributed_shadow_maps: bool);
388
389 #[unsafe(method(shadowCascadeCount))]
391 #[unsafe(method_family = none)]
392 pub unsafe fn shadowCascadeCount(&self) -> NSUInteger;
393
394 #[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 #[unsafe(method(shadowCascadeSplittingFactor))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn shadowCascadeSplittingFactor(&self) -> CGFloat;
404
405 #[cfg(feature = "objc2-core-foundation")]
406 #[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 #[unsafe(method(orthographicScale))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn orthographicScale(&self) -> CGFloat;
421
422 #[cfg(feature = "objc2-core-foundation")]
423 #[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 #[unsafe(method(zNear))]
431 #[unsafe(method_family = none)]
432 pub unsafe fn zNear(&self) -> CGFloat;
433
434 #[cfg(feature = "objc2-core-foundation")]
435 #[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 #[unsafe(method(zFar))]
443 #[unsafe(method_family = none)]
444 pub unsafe fn zFar(&self) -> CGFloat;
445
446 #[cfg(feature = "objc2-core-foundation")]
447 #[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 #[unsafe(method(attenuationStartDistance))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn attenuationStartDistance(&self) -> CGFloat;
457
458 #[cfg(feature = "objc2-core-foundation")]
459 #[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 #[unsafe(method(attenuationEndDistance))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn attenuationEndDistance(&self) -> CGFloat;
469
470 #[cfg(feature = "objc2-core-foundation")]
471 #[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 #[unsafe(method(attenuationFalloffExponent))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn attenuationFalloffExponent(&self) -> CGFloat;
481
482 #[cfg(feature = "objc2-core-foundation")]
483 #[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 #[unsafe(method(spotInnerAngle))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn spotInnerAngle(&self) -> CGFloat;
493
494 #[cfg(feature = "objc2-core-foundation")]
495 #[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 #[unsafe(method(spotOuterAngle))]
503 #[unsafe(method_family = none)]
504 pub unsafe fn spotOuterAngle(&self) -> CGFloat;
505
506 #[cfg(feature = "objc2-core-foundation")]
507 #[unsafe(method(setSpotOuterAngle:))]
509 #[unsafe(method_family = none)]
510 pub unsafe fn setSpotOuterAngle(&self, spot_outer_angle: CGFloat);
511
512 #[unsafe(method(IESProfileURL))]
514 #[unsafe(method_family = none)]
515 pub unsafe fn IESProfileURL(&self) -> Option<Retained<NSURL>>;
516
517 #[unsafe(method(setIESProfileURL:))]
519 #[unsafe(method_family = none)]
520 pub unsafe fn setIESProfileURL(&self, ies_profile_url: Option<&NSURL>);
521
522 #[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 #[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 #[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 #[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 #[unsafe(method(areaType))]
563 #[unsafe(method_family = none)]
564 pub unsafe fn areaType(&self) -> SCNLightAreaType;
565
566 #[unsafe(method(setAreaType:))]
568 #[unsafe(method_family = none)]
569 pub unsafe fn setAreaType(&self, area_type: SCNLightAreaType);
570
571 #[unsafe(method(areaPolygonVertices))]
575 #[unsafe(method_family = none)]
576 pub unsafe fn areaPolygonVertices(&self) -> Option<Retained<NSArray<NSValue>>>;
577
578 #[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 #[unsafe(method(drawsArea))]
590 #[unsafe(method_family = none)]
591 pub unsafe fn drawsArea(&self) -> bool;
592
593 #[unsafe(method(setDrawsArea:))]
595 #[unsafe(method_family = none)]
596 pub unsafe fn setDrawsArea(&self, draws_area: bool);
597
598 #[unsafe(method(doubleSided))]
602 #[unsafe(method_family = none)]
603 pub unsafe fn doubleSided(&self) -> bool;
604
605 #[unsafe(method(setDoubleSided:))]
607 #[unsafe(method_family = none)]
608 pub unsafe fn setDoubleSided(&self, double_sided: bool);
609
610 #[cfg(feature = "SCNMaterialProperty")]
611 #[unsafe(method(gobo))]
615 #[unsafe(method_family = none)]
616 pub unsafe fn gobo(&self) -> Option<Retained<SCNMaterialProperty>>;
617
618 #[unsafe(method(categoryBitMask))]
620 #[unsafe(method_family = none)]
621 pub unsafe fn categoryBitMask(&self) -> NSUInteger;
622
623 #[unsafe(method(setCategoryBitMask:))]
625 #[unsafe(method_family = none)]
626 pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
627 );
628}
629
630impl 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}