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:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn setType(&self, r#type: &SCNLightType);
195
196 #[unsafe(method(color))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn color(&self) -> Retained<AnyObject>;
202
203 #[unsafe(method(setColor:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn setColor(&self, color: &AnyObject);
207
208 #[cfg(feature = "objc2-core-foundation")]
209 #[unsafe(method(temperature))]
213 #[unsafe(method_family = none)]
214 pub unsafe fn temperature(&self) -> CGFloat;
215
216 #[cfg(feature = "objc2-core-foundation")]
217 #[unsafe(method(setTemperature:))]
219 #[unsafe(method_family = none)]
220 pub unsafe fn setTemperature(&self, temperature: CGFloat);
221
222 #[cfg(feature = "objc2-core-foundation")]
223 #[unsafe(method(intensity))]
227 #[unsafe(method_family = none)]
228 pub unsafe fn intensity(&self) -> CGFloat;
229
230 #[cfg(feature = "objc2-core-foundation")]
231 #[unsafe(method(setIntensity:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn setIntensity(&self, intensity: CGFloat);
235
236 #[unsafe(method(name))]
238 #[unsafe(method_family = none)]
239 pub unsafe fn name(&self) -> Option<Retained<NSString>>;
240
241 #[unsafe(method(setName:))]
243 #[unsafe(method_family = none)]
244 pub unsafe fn setName(&self, name: Option<&NSString>);
245
246 #[unsafe(method(castsShadow))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn castsShadow(&self) -> bool;
252
253 #[unsafe(method(setCastsShadow:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn setCastsShadow(&self, casts_shadow: bool);
257
258 #[unsafe(method(shadowColor))]
262 #[unsafe(method_family = none)]
263 pub unsafe fn shadowColor(&self) -> Retained<AnyObject>;
264
265 #[unsafe(method(setShadowColor:))]
267 #[unsafe(method_family = none)]
268 pub unsafe fn setShadowColor(&self, shadow_color: &AnyObject);
269
270 #[cfg(feature = "objc2-core-foundation")]
271 #[unsafe(method(shadowRadius))]
273 #[unsafe(method_family = none)]
274 pub unsafe fn shadowRadius(&self) -> CGFloat;
275
276 #[cfg(feature = "objc2-core-foundation")]
277 #[unsafe(method(setShadowRadius:))]
279 #[unsafe(method_family = none)]
280 pub unsafe fn setShadowRadius(&self, shadow_radius: CGFloat);
281
282 #[cfg(feature = "objc2-core-foundation")]
283 #[unsafe(method(shadowMapSize))]
287 #[unsafe(method_family = none)]
288 pub unsafe fn shadowMapSize(&self) -> CGSize;
289
290 #[cfg(feature = "objc2-core-foundation")]
291 #[unsafe(method(setShadowMapSize:))]
293 #[unsafe(method_family = none)]
294 pub unsafe fn setShadowMapSize(&self, shadow_map_size: CGSize);
295
296 #[unsafe(method(shadowSampleCount))]
301 #[unsafe(method_family = none)]
302 pub unsafe fn shadowSampleCount(&self) -> NSUInteger;
303
304 #[unsafe(method(setShadowSampleCount:))]
306 #[unsafe(method_family = none)]
307 pub unsafe fn setShadowSampleCount(&self, shadow_sample_count: NSUInteger);
308
309 #[unsafe(method(shadowMode))]
311 #[unsafe(method_family = none)]
312 pub unsafe fn shadowMode(&self) -> SCNShadowMode;
313
314 #[unsafe(method(setShadowMode:))]
316 #[unsafe(method_family = none)]
317 pub unsafe fn setShadowMode(&self, shadow_mode: SCNShadowMode);
318
319 #[cfg(feature = "objc2-core-foundation")]
320 #[unsafe(method(shadowBias))]
322 #[unsafe(method_family = none)]
323 pub unsafe fn shadowBias(&self) -> CGFloat;
324
325 #[cfg(feature = "objc2-core-foundation")]
326 #[unsafe(method(setShadowBias:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn setShadowBias(&self, shadow_bias: CGFloat);
330
331 #[unsafe(method(automaticallyAdjustsShadowProjection))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn automaticallyAdjustsShadowProjection(&self) -> bool;
335
336 #[unsafe(method(setAutomaticallyAdjustsShadowProjection:))]
338 #[unsafe(method_family = none)]
339 pub unsafe fn setAutomaticallyAdjustsShadowProjection(
340 &self,
341 automatically_adjusts_shadow_projection: bool,
342 );
343
344 #[cfg(feature = "objc2-core-foundation")]
345 #[unsafe(method(maximumShadowDistance))]
347 #[unsafe(method_family = none)]
348 pub unsafe fn maximumShadowDistance(&self) -> CGFloat;
349
350 #[cfg(feature = "objc2-core-foundation")]
351 #[unsafe(method(setMaximumShadowDistance:))]
353 #[unsafe(method_family = none)]
354 pub unsafe fn setMaximumShadowDistance(&self, maximum_shadow_distance: CGFloat);
355
356 #[unsafe(method(forcesBackFaceCasters))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn forcesBackFaceCasters(&self) -> bool;
361
362 #[unsafe(method(setForcesBackFaceCasters:))]
364 #[unsafe(method_family = none)]
365 pub unsafe fn setForcesBackFaceCasters(&self, forces_back_face_casters: bool);
366
367 #[unsafe(method(sampleDistributedShadowMaps))]
369 #[unsafe(method_family = none)]
370 pub unsafe fn sampleDistributedShadowMaps(&self) -> bool;
371
372 #[unsafe(method(setSampleDistributedShadowMaps:))]
374 #[unsafe(method_family = none)]
375 pub unsafe fn setSampleDistributedShadowMaps(&self, sample_distributed_shadow_maps: bool);
376
377 #[unsafe(method(shadowCascadeCount))]
379 #[unsafe(method_family = none)]
380 pub unsafe fn shadowCascadeCount(&self) -> NSUInteger;
381
382 #[unsafe(method(setShadowCascadeCount:))]
384 #[unsafe(method_family = none)]
385 pub unsafe fn setShadowCascadeCount(&self, shadow_cascade_count: NSUInteger);
386
387 #[cfg(feature = "objc2-core-foundation")]
388 #[unsafe(method(shadowCascadeSplittingFactor))]
390 #[unsafe(method_family = none)]
391 pub unsafe fn shadowCascadeSplittingFactor(&self) -> CGFloat;
392
393 #[cfg(feature = "objc2-core-foundation")]
394 #[unsafe(method(setShadowCascadeSplittingFactor:))]
396 #[unsafe(method_family = none)]
397 pub unsafe fn setShadowCascadeSplittingFactor(
398 &self,
399 shadow_cascade_splitting_factor: CGFloat,
400 );
401
402 #[cfg(feature = "objc2-core-foundation")]
403 #[unsafe(method(orthographicScale))]
407 #[unsafe(method_family = none)]
408 pub unsafe fn orthographicScale(&self) -> CGFloat;
409
410 #[cfg(feature = "objc2-core-foundation")]
411 #[unsafe(method(setOrthographicScale:))]
413 #[unsafe(method_family = none)]
414 pub unsafe fn setOrthographicScale(&self, orthographic_scale: CGFloat);
415
416 #[cfg(feature = "objc2-core-foundation")]
417 #[unsafe(method(zNear))]
419 #[unsafe(method_family = none)]
420 pub unsafe fn zNear(&self) -> CGFloat;
421
422 #[cfg(feature = "objc2-core-foundation")]
423 #[unsafe(method(setZNear:))]
425 #[unsafe(method_family = none)]
426 pub unsafe fn setZNear(&self, z_near: CGFloat);
427
428 #[cfg(feature = "objc2-core-foundation")]
429 #[unsafe(method(zFar))]
431 #[unsafe(method_family = none)]
432 pub unsafe fn zFar(&self) -> CGFloat;
433
434 #[cfg(feature = "objc2-core-foundation")]
435 #[unsafe(method(setZFar:))]
437 #[unsafe(method_family = none)]
438 pub unsafe fn setZFar(&self, z_far: CGFloat);
439
440 #[cfg(feature = "objc2-core-foundation")]
441 #[unsafe(method(attenuationStartDistance))]
443 #[unsafe(method_family = none)]
444 pub unsafe fn attenuationStartDistance(&self) -> CGFloat;
445
446 #[cfg(feature = "objc2-core-foundation")]
447 #[unsafe(method(setAttenuationStartDistance:))]
449 #[unsafe(method_family = none)]
450 pub unsafe fn setAttenuationStartDistance(&self, attenuation_start_distance: CGFloat);
451
452 #[cfg(feature = "objc2-core-foundation")]
453 #[unsafe(method(attenuationEndDistance))]
455 #[unsafe(method_family = none)]
456 pub unsafe fn attenuationEndDistance(&self) -> CGFloat;
457
458 #[cfg(feature = "objc2-core-foundation")]
459 #[unsafe(method(setAttenuationEndDistance:))]
461 #[unsafe(method_family = none)]
462 pub unsafe fn setAttenuationEndDistance(&self, attenuation_end_distance: CGFloat);
463
464 #[cfg(feature = "objc2-core-foundation")]
465 #[unsafe(method(attenuationFalloffExponent))]
467 #[unsafe(method_family = none)]
468 pub unsafe fn attenuationFalloffExponent(&self) -> CGFloat;
469
470 #[cfg(feature = "objc2-core-foundation")]
471 #[unsafe(method(setAttenuationFalloffExponent:))]
473 #[unsafe(method_family = none)]
474 pub unsafe fn setAttenuationFalloffExponent(&self, attenuation_falloff_exponent: CGFloat);
475
476 #[cfg(feature = "objc2-core-foundation")]
477 #[unsafe(method(spotInnerAngle))]
479 #[unsafe(method_family = none)]
480 pub unsafe fn spotInnerAngle(&self) -> CGFloat;
481
482 #[cfg(feature = "objc2-core-foundation")]
483 #[unsafe(method(setSpotInnerAngle:))]
485 #[unsafe(method_family = none)]
486 pub unsafe fn setSpotInnerAngle(&self, spot_inner_angle: CGFloat);
487
488 #[cfg(feature = "objc2-core-foundation")]
489 #[unsafe(method(spotOuterAngle))]
491 #[unsafe(method_family = none)]
492 pub unsafe fn spotOuterAngle(&self) -> CGFloat;
493
494 #[cfg(feature = "objc2-core-foundation")]
495 #[unsafe(method(setSpotOuterAngle:))]
497 #[unsafe(method_family = none)]
498 pub unsafe fn setSpotOuterAngle(&self, spot_outer_angle: CGFloat);
499
500 #[unsafe(method(IESProfileURL))]
502 #[unsafe(method_family = none)]
503 pub unsafe fn IESProfileURL(&self) -> Option<Retained<NSURL>>;
504
505 #[unsafe(method(setIESProfileURL:))]
507 #[unsafe(method_family = none)]
508 pub unsafe fn setIESProfileURL(&self, ies_profile_url: Option<&NSURL>);
509
510 #[unsafe(method(sphericalHarmonicsCoefficients))]
514 #[unsafe(method_family = none)]
515 pub unsafe fn sphericalHarmonicsCoefficients(&self) -> Retained<NSData>;
516
517 #[unsafe(method(probeType))]
518 #[unsafe(method_family = none)]
519 pub unsafe fn probeType(&self) -> SCNLightProbeType;
520
521 #[unsafe(method(setProbeType:))]
523 #[unsafe(method_family = none)]
524 pub unsafe fn setProbeType(&self, probe_type: SCNLightProbeType);
525
526 #[unsafe(method(probeUpdateType))]
527 #[unsafe(method_family = none)]
528 pub unsafe fn probeUpdateType(&self) -> SCNLightProbeUpdateType;
529
530 #[unsafe(method(setProbeUpdateType:))]
532 #[unsafe(method_family = none)]
533 pub unsafe fn setProbeUpdateType(&self, probe_update_type: SCNLightProbeUpdateType);
534
535 #[unsafe(method(parallaxCorrectionEnabled))]
536 #[unsafe(method_family = none)]
537 pub unsafe fn parallaxCorrectionEnabled(&self) -> bool;
538
539 #[unsafe(method(setParallaxCorrectionEnabled:))]
541 #[unsafe(method_family = none)]
542 pub unsafe fn setParallaxCorrectionEnabled(&self, parallax_correction_enabled: bool);
543
544 #[cfg(feature = "SCNMaterialProperty")]
545 #[unsafe(method(probeEnvironment))]
546 #[unsafe(method_family = none)]
547 pub unsafe fn probeEnvironment(&self) -> Option<Retained<SCNMaterialProperty>>;
548
549 #[unsafe(method(areaType))]
551 #[unsafe(method_family = none)]
552 pub unsafe fn areaType(&self) -> SCNLightAreaType;
553
554 #[unsafe(method(setAreaType:))]
556 #[unsafe(method_family = none)]
557 pub unsafe fn setAreaType(&self, area_type: SCNLightAreaType);
558
559 #[unsafe(method(areaPolygonVertices))]
563 #[unsafe(method_family = none)]
564 pub unsafe fn areaPolygonVertices(&self) -> Option<Retained<NSArray<NSValue>>>;
565
566 #[unsafe(method(setAreaPolygonVertices:))]
568 #[unsafe(method_family = none)]
569 pub unsafe fn setAreaPolygonVertices(
570 &self,
571 area_polygon_vertices: Option<&NSArray<NSValue>>,
572 );
573
574 #[unsafe(method(drawsArea))]
576 #[unsafe(method_family = none)]
577 pub unsafe fn drawsArea(&self) -> bool;
578
579 #[unsafe(method(setDrawsArea:))]
581 #[unsafe(method_family = none)]
582 pub unsafe fn setDrawsArea(&self, draws_area: bool);
583
584 #[unsafe(method(doubleSided))]
588 #[unsafe(method_family = none)]
589 pub unsafe fn doubleSided(&self) -> bool;
590
591 #[unsafe(method(setDoubleSided:))]
593 #[unsafe(method_family = none)]
594 pub unsafe fn setDoubleSided(&self, double_sided: bool);
595
596 #[cfg(feature = "SCNMaterialProperty")]
597 #[unsafe(method(gobo))]
601 #[unsafe(method_family = none)]
602 pub unsafe fn gobo(&self) -> Option<Retained<SCNMaterialProperty>>;
603
604 #[unsafe(method(categoryBitMask))]
606 #[unsafe(method_family = none)]
607 pub unsafe fn categoryBitMask(&self) -> NSUInteger;
608
609 #[unsafe(method(setCategoryBitMask:))]
611 #[unsafe(method_family = none)]
612 pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
613 );
614}
615
616impl SCNLight {
618 extern_methods!(
619 #[unsafe(method(init))]
620 #[unsafe(method_family = init)]
621 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
622
623 #[unsafe(method(new))]
624 #[unsafe(method_family = new)]
625 pub unsafe fn new() -> Retained<Self>;
626 );
627}