objc2_scene_kit/generated/
SCNConstraint.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
12extern_class!(
13    /// A SCNConstraint is an abstract class that represents a single constraint that can be applied to a node.
14    ///
15    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnconstraint?language=objc)
16    #[unsafe(super(NSObject))]
17    #[derive(Debug, PartialEq, Eq, Hash)]
18    pub struct SCNConstraint;
19);
20
21extern_conformance!(
22    unsafe impl NSCoding for SCNConstraint {}
23);
24
25extern_conformance!(
26    unsafe impl NSCopying for SCNConstraint {}
27);
28
29unsafe impl CopyingHelper for SCNConstraint {
30    type Result = Self;
31}
32
33extern_conformance!(
34    unsafe impl NSObjectProtocol for SCNConstraint {}
35);
36
37extern_conformance!(
38    unsafe impl NSSecureCoding for SCNConstraint {}
39);
40
41#[cfg(feature = "SCNAnimation")]
42extern_conformance!(
43    unsafe impl SCNAnimatable for SCNConstraint {}
44);
45
46impl SCNConstraint {
47    extern_methods!(
48        /// Determines whether the constraint is enabled or not. Defaults to YES.
49        #[unsafe(method(isEnabled))]
50        #[unsafe(method_family = none)]
51        pub unsafe fn isEnabled(&self) -> bool;
52
53        /// Setter for [`isEnabled`][Self::isEnabled].
54        #[unsafe(method(setEnabled:))]
55        #[unsafe(method_family = none)]
56        pub unsafe fn setEnabled(&self, enabled: bool);
57
58        #[cfg(feature = "objc2-core-foundation")]
59        /// Specifies the inflence factor of the receiver. Defaults to 1. Animatable
60        #[unsafe(method(influenceFactor))]
61        #[unsafe(method_family = none)]
62        pub unsafe fn influenceFactor(&self) -> CGFloat;
63
64        #[cfg(feature = "objc2-core-foundation")]
65        /// Setter for [`influenceFactor`][Self::influenceFactor].
66        #[unsafe(method(setInfluenceFactor:))]
67        #[unsafe(method_family = none)]
68        pub unsafe fn setInfluenceFactor(&self, influence_factor: CGFloat);
69
70        /// Specifies whether or not the contraint should applies incrementally and have it's effect being cumulated over the rendered frames. Defaults to YES starting macOS 10.13, iOS 11, tvOS 11 and watchOS 4. Defaults to NO in previous versions.
71        #[unsafe(method(isIncremental))]
72        #[unsafe(method_family = none)]
73        pub unsafe fn isIncremental(&self) -> bool;
74
75        /// Setter for [`isIncremental`][Self::isIncremental].
76        #[unsafe(method(setIncremental:))]
77        #[unsafe(method_family = none)]
78        pub unsafe fn setIncremental(&self, incremental: bool);
79    );
80}
81
82/// Methods declared on superclass `NSObject`.
83impl SCNConstraint {
84    extern_methods!(
85        #[unsafe(method(init))]
86        #[unsafe(method_family = init)]
87        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
88
89        #[unsafe(method(new))]
90        #[unsafe(method_family = new)]
91        pub unsafe fn new() -> Retained<Self>;
92    );
93}
94
95extern_class!(
96    /// A SCNLookAtConstraint applies on a node's orientation so that it always look at another node.
97    ///
98    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnlookatconstraint?language=objc)
99    #[unsafe(super(SCNConstraint, NSObject))]
100    #[derive(Debug, PartialEq, Eq, Hash)]
101    pub struct SCNLookAtConstraint;
102);
103
104extern_conformance!(
105    unsafe impl NSCoding for SCNLookAtConstraint {}
106);
107
108extern_conformance!(
109    unsafe impl NSCopying for SCNLookAtConstraint {}
110);
111
112unsafe impl CopyingHelper for SCNLookAtConstraint {
113    type Result = Self;
114}
115
116extern_conformance!(
117    unsafe impl NSObjectProtocol for SCNLookAtConstraint {}
118);
119
120extern_conformance!(
121    unsafe impl NSSecureCoding for SCNLookAtConstraint {}
122);
123
124#[cfg(feature = "SCNAnimation")]
125extern_conformance!(
126    unsafe impl SCNAnimatable for SCNLookAtConstraint {}
127);
128
129impl SCNLookAtConstraint {
130    extern_methods!(
131        #[cfg(feature = "SCNNode")]
132        /// Creates and returns a SCNLookAtConstraint object with the specified target.
133        ///
134        /// Parameter `target`: The target node to look at.
135        #[unsafe(method(lookAtConstraintWithTarget:))]
136        #[unsafe(method_family = none)]
137        pub unsafe fn lookAtConstraintWithTarget(target: Option<&SCNNode>) -> Retained<Self>;
138
139        #[cfg(feature = "SCNNode")]
140        /// Defines the target node to look at.
141        #[unsafe(method(target))]
142        #[unsafe(method_family = none)]
143        pub unsafe fn target(&self) -> Option<Retained<SCNNode>>;
144
145        #[cfg(feature = "SCNNode")]
146        /// Setter for [`target`][Self::target].
147        #[unsafe(method(setTarget:))]
148        #[unsafe(method_family = none)]
149        pub unsafe fn setTarget(&self, target: Option<&SCNNode>);
150
151        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
152        /// Offset look at position in target space. Defaults to zero. Animatable
153        #[unsafe(method(targetOffset))]
154        #[unsafe(method_family = none)]
155        pub unsafe fn targetOffset(&self) -> SCNVector3;
156
157        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
158        /// Setter for [`targetOffset`][Self::targetOffset].
159        #[unsafe(method(setTargetOffset:))]
160        #[unsafe(method_family = none)]
161        pub unsafe fn setTargetOffset(&self, target_offset: SCNVector3);
162
163        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
164        /// Front direction in the constraint owner local space. Defaults to -[SCNNode localFront]. Animatable
165        #[unsafe(method(localFront))]
166        #[unsafe(method_family = none)]
167        pub unsafe fn localFront(&self) -> SCNVector3;
168
169        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
170        /// Setter for [`localFront`][Self::localFront].
171        #[unsafe(method(setLocalFront:))]
172        #[unsafe(method_family = none)]
173        pub unsafe fn setLocalFront(&self, local_front: SCNVector3);
174
175        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
176        /// Up reference direction in world space. Defaults to -[SCNNode localUp]. Animatable
177        #[unsafe(method(worldUp))]
178        #[unsafe(method_family = none)]
179        pub unsafe fn worldUp(&self) -> SCNVector3;
180
181        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
182        /// Setter for [`worldUp`][Self::worldUp].
183        #[unsafe(method(setWorldUp:))]
184        #[unsafe(method_family = none)]
185        pub unsafe fn setWorldUp(&self, world_up: SCNVector3);
186
187        /// Specifies whether the receiver enables the gimbal lock. Defaults to NO.
188        ///
189        /// Enabling the gimbal lock prevents the receiver from rotating the constrained node around to roll axis.
190        #[unsafe(method(gimbalLockEnabled))]
191        #[unsafe(method_family = none)]
192        pub unsafe fn gimbalLockEnabled(&self) -> bool;
193
194        /// Setter for [`gimbalLockEnabled`][Self::gimbalLockEnabled].
195        #[unsafe(method(setGimbalLockEnabled:))]
196        #[unsafe(method_family = none)]
197        pub unsafe fn setGimbalLockEnabled(&self, gimbal_lock_enabled: bool);
198    );
199}
200
201/// Methods declared on superclass `NSObject`.
202impl SCNLookAtConstraint {
203    extern_methods!(
204        #[unsafe(method(init))]
205        #[unsafe(method_family = init)]
206        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
207
208        #[unsafe(method(new))]
209        #[unsafe(method_family = new)]
210        pub unsafe fn new() -> Retained<Self>;
211    );
212}
213
214/// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnbillboardaxis?language=objc)
215// NS_OPTIONS
216#[repr(transparent)]
217#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
218pub struct SCNBillboardAxis(pub NSUInteger);
219bitflags::bitflags! {
220    impl SCNBillboardAxis: NSUInteger {
221        #[doc(alias = "SCNBillboardAxisX")]
222        const X = 0x1<<0;
223        #[doc(alias = "SCNBillboardAxisY")]
224        const Y = 0x1<<1;
225        #[doc(alias = "SCNBillboardAxisZ")]
226        const Z = 0x1<<2;
227        #[doc(alias = "SCNBillboardAxisAll")]
228        const All = SCNBillboardAxis::X.0|SCNBillboardAxis::Y.0|SCNBillboardAxis::Z.0;
229    }
230}
231
232unsafe impl Encode for SCNBillboardAxis {
233    const ENCODING: Encoding = NSUInteger::ENCODING;
234}
235
236unsafe impl RefEncode for SCNBillboardAxis {
237    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
238}
239
240extern_class!(
241    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnbillboardconstraint?language=objc)
242    #[unsafe(super(SCNConstraint, NSObject))]
243    #[derive(Debug, PartialEq, Eq, Hash)]
244    pub struct SCNBillboardConstraint;
245);
246
247extern_conformance!(
248    unsafe impl NSCoding for SCNBillboardConstraint {}
249);
250
251extern_conformance!(
252    unsafe impl NSCopying for SCNBillboardConstraint {}
253);
254
255unsafe impl CopyingHelper for SCNBillboardConstraint {
256    type Result = Self;
257}
258
259extern_conformance!(
260    unsafe impl NSObjectProtocol for SCNBillboardConstraint {}
261);
262
263extern_conformance!(
264    unsafe impl NSSecureCoding for SCNBillboardConstraint {}
265);
266
267#[cfg(feature = "SCNAnimation")]
268extern_conformance!(
269    unsafe impl SCNAnimatable for SCNBillboardConstraint {}
270);
271
272impl SCNBillboardConstraint {
273    extern_methods!(
274        /// Creates and returns a SCNBillboardConstraint constraint.
275        ///
276        /// A billboard constraint forces the receiver to look into the direction of the current point of view.
277        #[unsafe(method(billboardConstraint))]
278        #[unsafe(method_family = none)]
279        pub unsafe fn billboardConstraint() -> Retained<Self>;
280
281        /// Specifies the axes on which the billboarding orientation operates. Defaults to SCNBillboardAxisAll.
282        #[unsafe(method(freeAxes))]
283        #[unsafe(method_family = none)]
284        pub unsafe fn freeAxes(&self) -> SCNBillboardAxis;
285
286        /// Setter for [`freeAxes`][Self::freeAxes].
287        #[unsafe(method(setFreeAxes:))]
288        #[unsafe(method_family = none)]
289        pub unsafe fn setFreeAxes(&self, free_axes: SCNBillboardAxis);
290    );
291}
292
293/// Methods declared on superclass `NSObject`.
294impl SCNBillboardConstraint {
295    extern_methods!(
296        #[unsafe(method(init))]
297        #[unsafe(method_family = init)]
298        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
299
300        #[unsafe(method(new))]
301        #[unsafe(method_family = new)]
302        pub unsafe fn new() -> Retained<Self>;
303    );
304}
305
306extern_class!(
307    /// A SCNTransformConstraint applies on the transform of a node via a custom block.
308    ///
309    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scntransformconstraint?language=objc)
310    #[unsafe(super(SCNConstraint, NSObject))]
311    #[derive(Debug, PartialEq, Eq, Hash)]
312    pub struct SCNTransformConstraint;
313);
314
315extern_conformance!(
316    unsafe impl NSCoding for SCNTransformConstraint {}
317);
318
319extern_conformance!(
320    unsafe impl NSCopying for SCNTransformConstraint {}
321);
322
323unsafe impl CopyingHelper for SCNTransformConstraint {
324    type Result = Self;
325}
326
327extern_conformance!(
328    unsafe impl NSObjectProtocol for SCNTransformConstraint {}
329);
330
331extern_conformance!(
332    unsafe impl NSSecureCoding for SCNTransformConstraint {}
333);
334
335#[cfg(feature = "SCNAnimation")]
336extern_conformance!(
337    unsafe impl SCNAnimatable for SCNTransformConstraint {}
338);
339
340impl SCNTransformConstraint {
341    extern_methods!(
342        #[cfg(all(
343            feature = "SCNNode",
344            feature = "SceneKitTypes",
345            feature = "block2",
346            feature = "objc2-quartz-core"
347        ))]
348        #[cfg(not(target_os = "watchos"))]
349        /// Creates and returns a SCNTransformConstraint object with the specified parameters.
350        ///
351        /// Parameter `world`: Determines whether the constraint is evaluated in world or local space.
352        ///
353        /// Parameter `block`: The custom block to call to evaluate the constraint.
354        ///
355        /// The node and its transform are passed to the block. The transform returned by the block will be used to render the node.
356        #[unsafe(method(transformConstraintInWorldSpace:withBlock:))]
357        #[unsafe(method_family = none)]
358        pub unsafe fn transformConstraintInWorldSpace_withBlock(
359            world: bool,
360            block: &block2::DynBlock<dyn Fn(NonNull<SCNNode>, SCNMatrix4) -> SCNMatrix4>,
361        ) -> Retained<Self>;
362
363        #[cfg(all(
364            feature = "SCNNode",
365            feature = "SceneKitTypes",
366            feature = "block2",
367            feature = "objc2-core-foundation"
368        ))]
369        /// Creates and returns a SCNTransformConstraint object with the specified parameters.
370        ///
371        /// Parameter `world`: Determines whether the constraint is evaluated in world or local space.
372        ///
373        /// Parameter `block`: The custom block to call to evaluate the constraint.
374        ///
375        /// The node and its position are passed to the block. The position returned by the block will be used to render the node.
376        #[unsafe(method(positionConstraintInWorldSpace:withBlock:))]
377        #[unsafe(method_family = none)]
378        pub unsafe fn positionConstraintInWorldSpace_withBlock(
379            world: bool,
380            block: &block2::DynBlock<dyn Fn(NonNull<SCNNode>, SCNVector3) -> SCNVector3>,
381        ) -> Retained<Self>;
382
383        #[cfg(all(
384            feature = "SCNNode",
385            feature = "SceneKitTypes",
386            feature = "block2",
387            feature = "objc2-core-foundation"
388        ))]
389        /// Creates and returns a SCNTransformConstraint object with the specified parameters.
390        ///
391        /// Parameter `world`: Determines whether the constraint is evaluated in world or local space.
392        ///
393        /// Parameter `block`: The custom block to call to evaluate the constraint.
394        ///
395        /// The node and its quaternion are passed to the block. The quaternion returned by the block will be used to render the node.
396        #[unsafe(method(orientationConstraintInWorldSpace:withBlock:))]
397        #[unsafe(method_family = none)]
398        pub unsafe fn orientationConstraintInWorldSpace_withBlock(
399            world: bool,
400            block: &block2::DynBlock<dyn Fn(NonNull<SCNNode>, SCNQuaternion) -> SCNQuaternion>,
401        ) -> Retained<Self>;
402    );
403}
404
405/// Methods declared on superclass `NSObject`.
406impl SCNTransformConstraint {
407    extern_methods!(
408        #[unsafe(method(init))]
409        #[unsafe(method_family = init)]
410        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
411
412        #[unsafe(method(new))]
413        #[unsafe(method_family = new)]
414        pub unsafe fn new() -> Retained<Self>;
415    );
416}
417
418extern_class!(
419    /// A SCNIKConstraint applies an inverse kinematics constraint
420    ///
421    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnikconstraint?language=objc)
422    #[unsafe(super(SCNConstraint, NSObject))]
423    #[derive(Debug, PartialEq, Eq, Hash)]
424    pub struct SCNIKConstraint;
425);
426
427extern_conformance!(
428    unsafe impl NSCoding for SCNIKConstraint {}
429);
430
431extern_conformance!(
432    unsafe impl NSCopying for SCNIKConstraint {}
433);
434
435unsafe impl CopyingHelper for SCNIKConstraint {
436    type Result = Self;
437}
438
439extern_conformance!(
440    unsafe impl NSObjectProtocol for SCNIKConstraint {}
441);
442
443extern_conformance!(
444    unsafe impl NSSecureCoding for SCNIKConstraint {}
445);
446
447#[cfg(feature = "SCNAnimation")]
448extern_conformance!(
449    unsafe impl SCNAnimatable for SCNIKConstraint {}
450);
451
452impl SCNIKConstraint {
453    extern_methods!(
454        #[cfg(feature = "SCNNode")]
455        /// Creates and returns a SCNIKConstraint object with the specified parameter.
456        ///
457        /// Parameter `chainRootNode`: The root node of the kinematic chain.
458        ///
459        /// "chainRootNode" must be an ancestor of the node on which the constraint is applied.
460        #[unsafe(method(initWithChainRootNode:))]
461        #[unsafe(method_family = init)]
462        pub unsafe fn initWithChainRootNode(
463            this: Allocated<Self>,
464            chain_root_node: &SCNNode,
465        ) -> Retained<Self>;
466
467        #[cfg(feature = "SCNNode")]
468        /// Creates and returns a SCNIKConstraint object with the specified parameter.
469        ///
470        /// Parameter `chainRootNode`: The root node of the kinematic chain.
471        ///
472        /// "chainRootNode" must be an ancestor of the node on which the constraint is applied.
473        #[unsafe(method(inverseKinematicsConstraintWithChainRootNode:))]
474        #[unsafe(method_family = none)]
475        pub unsafe fn inverseKinematicsConstraintWithChainRootNode(
476            chain_root_node: &SCNNode,
477        ) -> Retained<Self>;
478
479        #[cfg(feature = "SCNNode")]
480        /// Specifies the root node of the kinematic chain.
481        #[unsafe(method(chainRootNode))]
482        #[unsafe(method_family = none)]
483        pub unsafe fn chainRootNode(&self) -> Retained<SCNNode>;
484
485        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
486        /// Specifies the target position (in world space coordinates) of the end joint (i.e the node that owns the IK constraint). Defaults to (0,0,0). Animatable.
487        #[unsafe(method(targetPosition))]
488        #[unsafe(method_family = none)]
489        pub unsafe fn targetPosition(&self) -> SCNVector3;
490
491        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
492        /// Setter for [`targetPosition`][Self::targetPosition].
493        #[unsafe(method(setTargetPosition:))]
494        #[unsafe(method_family = none)]
495        pub unsafe fn setTargetPosition(&self, target_position: SCNVector3);
496
497        #[cfg(all(feature = "SCNNode", feature = "objc2-core-foundation"))]
498        /// Specifies the maximum rotation allowed (in degrees) for the specified joint from its initial orientation. Defaults to 180.
499        #[unsafe(method(setMaxAllowedRotationAngle:forJoint:))]
500        #[unsafe(method_family = none)]
501        pub unsafe fn setMaxAllowedRotationAngle_forJoint(&self, angle: CGFloat, node: &SCNNode);
502
503        #[cfg(all(feature = "SCNNode", feature = "objc2-core-foundation"))]
504        #[unsafe(method(maxAllowedRotationAngleForJoint:))]
505        #[unsafe(method_family = none)]
506        pub unsafe fn maxAllowedRotationAngleForJoint(&self, node: &SCNNode) -> CGFloat;
507    );
508}
509
510/// Methods declared on superclass `NSObject`.
511impl SCNIKConstraint {
512    extern_methods!(
513        #[unsafe(method(init))]
514        #[unsafe(method_family = init)]
515        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
516
517        #[unsafe(method(new))]
518        #[unsafe(method_family = new)]
519        pub unsafe fn new() -> Retained<Self>;
520    );
521}
522
523extern_class!(
524    /// A SCNDistanceConstraint ensure a minimum/maximum distance with a target node.
525    ///
526    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scndistanceconstraint?language=objc)
527    #[unsafe(super(SCNConstraint, NSObject))]
528    #[derive(Debug, PartialEq, Eq, Hash)]
529    pub struct SCNDistanceConstraint;
530);
531
532extern_conformance!(
533    unsafe impl NSCoding for SCNDistanceConstraint {}
534);
535
536extern_conformance!(
537    unsafe impl NSCopying for SCNDistanceConstraint {}
538);
539
540unsafe impl CopyingHelper for SCNDistanceConstraint {
541    type Result = Self;
542}
543
544extern_conformance!(
545    unsafe impl NSObjectProtocol for SCNDistanceConstraint {}
546);
547
548extern_conformance!(
549    unsafe impl NSSecureCoding for SCNDistanceConstraint {}
550);
551
552#[cfg(feature = "SCNAnimation")]
553extern_conformance!(
554    unsafe impl SCNAnimatable for SCNDistanceConstraint {}
555);
556
557impl SCNDistanceConstraint {
558    extern_methods!(
559        #[cfg(feature = "SCNNode")]
560        /// Creates and returns a SCNDistanceConstraint constraint.
561        #[unsafe(method(distanceConstraintWithTarget:))]
562        #[unsafe(method_family = none)]
563        pub unsafe fn distanceConstraintWithTarget(target: Option<&SCNNode>) -> Retained<Self>;
564
565        #[cfg(feature = "SCNNode")]
566        /// Defines the target node to keep distance with.
567        #[unsafe(method(target))]
568        #[unsafe(method_family = none)]
569        pub unsafe fn target(&self) -> Option<Retained<SCNNode>>;
570
571        #[cfg(feature = "SCNNode")]
572        /// Setter for [`target`][Self::target].
573        #[unsafe(method(setTarget:))]
574        #[unsafe(method_family = none)]
575        pub unsafe fn setTarget(&self, target: Option<&SCNNode>);
576
577        #[cfg(feature = "objc2-core-foundation")]
578        /// The minimum distance. Defaults to 0. Animatable.
579        #[unsafe(method(minimumDistance))]
580        #[unsafe(method_family = none)]
581        pub unsafe fn minimumDistance(&self) -> CGFloat;
582
583        #[cfg(feature = "objc2-core-foundation")]
584        /// Setter for [`minimumDistance`][Self::minimumDistance].
585        #[unsafe(method(setMinimumDistance:))]
586        #[unsafe(method_family = none)]
587        pub unsafe fn setMinimumDistance(&self, minimum_distance: CGFloat);
588
589        #[cfg(feature = "objc2-core-foundation")]
590        /// The minimum distance. Defaults to MAXFLOAT. Animatable.
591        #[unsafe(method(maximumDistance))]
592        #[unsafe(method_family = none)]
593        pub unsafe fn maximumDistance(&self) -> CGFloat;
594
595        #[cfg(feature = "objc2-core-foundation")]
596        /// Setter for [`maximumDistance`][Self::maximumDistance].
597        #[unsafe(method(setMaximumDistance:))]
598        #[unsafe(method_family = none)]
599        pub unsafe fn setMaximumDistance(&self, maximum_distance: CGFloat);
600    );
601}
602
603/// Methods declared on superclass `NSObject`.
604impl SCNDistanceConstraint {
605    extern_methods!(
606        #[unsafe(method(init))]
607        #[unsafe(method_family = init)]
608        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
609
610        #[unsafe(method(new))]
611        #[unsafe(method_family = new)]
612        pub unsafe fn new() -> Retained<Self>;
613    );
614}
615
616extern_class!(
617    /// A SCNReplicatorConstraint replicates the position/orientation/scale of a target node
618    ///
619    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnreplicatorconstraint?language=objc)
620    #[unsafe(super(SCNConstraint, NSObject))]
621    #[derive(Debug, PartialEq, Eq, Hash)]
622    pub struct SCNReplicatorConstraint;
623);
624
625extern_conformance!(
626    unsafe impl NSCoding for SCNReplicatorConstraint {}
627);
628
629extern_conformance!(
630    unsafe impl NSCopying for SCNReplicatorConstraint {}
631);
632
633unsafe impl CopyingHelper for SCNReplicatorConstraint {
634    type Result = Self;
635}
636
637extern_conformance!(
638    unsafe impl NSObjectProtocol for SCNReplicatorConstraint {}
639);
640
641extern_conformance!(
642    unsafe impl NSSecureCoding for SCNReplicatorConstraint {}
643);
644
645#[cfg(feature = "SCNAnimation")]
646extern_conformance!(
647    unsafe impl SCNAnimatable for SCNReplicatorConstraint {}
648);
649
650impl SCNReplicatorConstraint {
651    extern_methods!(
652        #[cfg(feature = "SCNNode")]
653        /// Creates and returns a SCNReplicatorConstraint constraint.
654        #[unsafe(method(replicatorConstraintWithTarget:))]
655        #[unsafe(method_family = none)]
656        pub unsafe fn replicatorConstraintWithTarget(target: Option<&SCNNode>) -> Retained<Self>;
657
658        #[cfg(feature = "SCNNode")]
659        /// Defines the target node to replicate
660        #[unsafe(method(target))]
661        #[unsafe(method_family = none)]
662        pub unsafe fn target(&self) -> Option<Retained<SCNNode>>;
663
664        #[cfg(feature = "SCNNode")]
665        /// Setter for [`target`][Self::target].
666        #[unsafe(method(setTarget:))]
667        #[unsafe(method_family = none)]
668        pub unsafe fn setTarget(&self, target: Option<&SCNNode>);
669
670        /// Defines whether or not the constraint should replicate the target orientation. Defaults to YES.
671        #[unsafe(method(replicatesOrientation))]
672        #[unsafe(method_family = none)]
673        pub unsafe fn replicatesOrientation(&self) -> bool;
674
675        /// Setter for [`replicatesOrientation`][Self::replicatesOrientation].
676        #[unsafe(method(setReplicatesOrientation:))]
677        #[unsafe(method_family = none)]
678        pub unsafe fn setReplicatesOrientation(&self, replicates_orientation: bool);
679
680        /// Defines whether or not the constraint should replicate the target position. Defaults to YES.
681        #[unsafe(method(replicatesPosition))]
682        #[unsafe(method_family = none)]
683        pub unsafe fn replicatesPosition(&self) -> bool;
684
685        /// Setter for [`replicatesPosition`][Self::replicatesPosition].
686        #[unsafe(method(setReplicatesPosition:))]
687        #[unsafe(method_family = none)]
688        pub unsafe fn setReplicatesPosition(&self, replicates_position: bool);
689
690        /// Defines whether or not the constraint should replicate the target scale. Defaults to YES.
691        #[unsafe(method(replicatesScale))]
692        #[unsafe(method_family = none)]
693        pub unsafe fn replicatesScale(&self) -> bool;
694
695        /// Setter for [`replicatesScale`][Self::replicatesScale].
696        #[unsafe(method(setReplicatesScale:))]
697        #[unsafe(method_family = none)]
698        pub unsafe fn setReplicatesScale(&self, replicates_scale: bool);
699
700        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
701        /// Defines an addition orientation offset. Defaults to no offset. Animatable.
702        #[unsafe(method(orientationOffset))]
703        #[unsafe(method_family = none)]
704        pub unsafe fn orientationOffset(&self) -> SCNQuaternion;
705
706        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
707        /// Setter for [`orientationOffset`][Self::orientationOffset].
708        #[unsafe(method(setOrientationOffset:))]
709        #[unsafe(method_family = none)]
710        pub unsafe fn setOrientationOffset(&self, orientation_offset: SCNQuaternion);
711
712        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
713        /// Defines an addition orientation offset. Defaults to no offset. Animatable.
714        #[unsafe(method(positionOffset))]
715        #[unsafe(method_family = none)]
716        pub unsafe fn positionOffset(&self) -> SCNVector3;
717
718        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
719        /// Setter for [`positionOffset`][Self::positionOffset].
720        #[unsafe(method(setPositionOffset:))]
721        #[unsafe(method_family = none)]
722        pub unsafe fn setPositionOffset(&self, position_offset: SCNVector3);
723
724        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
725        /// Defines an addition scale offset. Defaults to no offset. Animatable.
726        #[unsafe(method(scaleOffset))]
727        #[unsafe(method_family = none)]
728        pub unsafe fn scaleOffset(&self) -> SCNVector3;
729
730        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
731        /// Setter for [`scaleOffset`][Self::scaleOffset].
732        #[unsafe(method(setScaleOffset:))]
733        #[unsafe(method_family = none)]
734        pub unsafe fn setScaleOffset(&self, scale_offset: SCNVector3);
735    );
736}
737
738/// Methods declared on superclass `NSObject`.
739impl SCNReplicatorConstraint {
740    extern_methods!(
741        #[unsafe(method(init))]
742        #[unsafe(method_family = init)]
743        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
744
745        #[unsafe(method(new))]
746        #[unsafe(method_family = new)]
747        pub unsafe fn new() -> Retained<Self>;
748    );
749}
750
751extern_class!(
752    /// A SCNAccelerationConstraint caps the acceleration and velocity of a node
753    ///
754    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnaccelerationconstraint?language=objc)
755    #[unsafe(super(SCNConstraint, NSObject))]
756    #[derive(Debug, PartialEq, Eq, Hash)]
757    pub struct SCNAccelerationConstraint;
758);
759
760extern_conformance!(
761    unsafe impl NSCoding for SCNAccelerationConstraint {}
762);
763
764extern_conformance!(
765    unsafe impl NSCopying for SCNAccelerationConstraint {}
766);
767
768unsafe impl CopyingHelper for SCNAccelerationConstraint {
769    type Result = Self;
770}
771
772extern_conformance!(
773    unsafe impl NSObjectProtocol for SCNAccelerationConstraint {}
774);
775
776extern_conformance!(
777    unsafe impl NSSecureCoding for SCNAccelerationConstraint {}
778);
779
780#[cfg(feature = "SCNAnimation")]
781extern_conformance!(
782    unsafe impl SCNAnimatable for SCNAccelerationConstraint {}
783);
784
785impl SCNAccelerationConstraint {
786    extern_methods!(
787        /// Creates and returns a SCNAccelerationConstraint object.
788        #[unsafe(method(accelerationConstraint))]
789        #[unsafe(method_family = none)]
790        pub unsafe fn accelerationConstraint() -> Retained<Self>;
791
792        #[cfg(feature = "objc2-core-foundation")]
793        /// Controls the maximum linear acceleration. Defaults to MAXFLOAT. Animatable.
794        ///
795        /// The maximum linear acceleration is in m.s^-2
796        #[unsafe(method(maximumLinearAcceleration))]
797        #[unsafe(method_family = none)]
798        pub unsafe fn maximumLinearAcceleration(&self) -> CGFloat;
799
800        #[cfg(feature = "objc2-core-foundation")]
801        /// Setter for [`maximumLinearAcceleration`][Self::maximumLinearAcceleration].
802        #[unsafe(method(setMaximumLinearAcceleration:))]
803        #[unsafe(method_family = none)]
804        pub unsafe fn setMaximumLinearAcceleration(&self, maximum_linear_acceleration: CGFloat);
805
806        #[cfg(feature = "objc2-core-foundation")]
807        /// Controls the maximum linear velocity. Defaults to MAXFLOAT. Animatable.
808        ///
809        /// The maximum linear velocity is in m.s
810        #[unsafe(method(maximumLinearVelocity))]
811        #[unsafe(method_family = none)]
812        pub unsafe fn maximumLinearVelocity(&self) -> CGFloat;
813
814        #[cfg(feature = "objc2-core-foundation")]
815        /// Setter for [`maximumLinearVelocity`][Self::maximumLinearVelocity].
816        #[unsafe(method(setMaximumLinearVelocity:))]
817        #[unsafe(method_family = none)]
818        pub unsafe fn setMaximumLinearVelocity(&self, maximum_linear_velocity: CGFloat);
819
820        #[cfg(feature = "objc2-core-foundation")]
821        /// Controls the distance at which the node should start decelerating. Defaults to 0. Animatable.
822        #[unsafe(method(decelerationDistance))]
823        #[unsafe(method_family = none)]
824        pub unsafe fn decelerationDistance(&self) -> CGFloat;
825
826        #[cfg(feature = "objc2-core-foundation")]
827        /// Setter for [`decelerationDistance`][Self::decelerationDistance].
828        #[unsafe(method(setDecelerationDistance:))]
829        #[unsafe(method_family = none)]
830        pub unsafe fn setDecelerationDistance(&self, deceleration_distance: CGFloat);
831
832        #[cfg(feature = "objc2-core-foundation")]
833        /// Specifies the damping factor of the receiver. Optionally reduce the body's linear velocity each frame to simulate fluid/air friction. Value should be zero or greater. Defaults to 0.1. Animatable.
834        #[unsafe(method(damping))]
835        #[unsafe(method_family = none)]
836        pub unsafe fn damping(&self) -> CGFloat;
837
838        #[cfg(feature = "objc2-core-foundation")]
839        /// Setter for [`damping`][Self::damping].
840        #[unsafe(method(setDamping:))]
841        #[unsafe(method_family = none)]
842        pub unsafe fn setDamping(&self, damping: CGFloat);
843    );
844}
845
846/// Methods declared on superclass `NSObject`.
847impl SCNAccelerationConstraint {
848    extern_methods!(
849        #[unsafe(method(init))]
850        #[unsafe(method_family = init)]
851        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
852
853        #[unsafe(method(new))]
854        #[unsafe(method_family = new)]
855        pub unsafe fn new() -> Retained<Self>;
856    );
857}
858
859extern_class!(
860    /// A SCNSliderConstraint constraint makes a node to collide and slide against a category of nodes
861    ///
862    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnsliderconstraint?language=objc)
863    #[unsafe(super(SCNConstraint, NSObject))]
864    #[derive(Debug, PartialEq, Eq, Hash)]
865    pub struct SCNSliderConstraint;
866);
867
868extern_conformance!(
869    unsafe impl NSCoding for SCNSliderConstraint {}
870);
871
872extern_conformance!(
873    unsafe impl NSCopying for SCNSliderConstraint {}
874);
875
876unsafe impl CopyingHelper for SCNSliderConstraint {
877    type Result = Self;
878}
879
880extern_conformance!(
881    unsafe impl NSObjectProtocol for SCNSliderConstraint {}
882);
883
884extern_conformance!(
885    unsafe impl NSSecureCoding for SCNSliderConstraint {}
886);
887
888#[cfg(feature = "SCNAnimation")]
889extern_conformance!(
890    unsafe impl SCNAnimatable for SCNSliderConstraint {}
891);
892
893impl SCNSliderConstraint {
894    extern_methods!(
895        /// Creates and returns a SCNSliderConstraint object.
896        #[unsafe(method(sliderConstraint))]
897        #[unsafe(method_family = none)]
898        pub unsafe fn sliderConstraint() -> Retained<Self>;
899
900        /// Defines the category of node to collide against. Defaults to 0.
901        #[unsafe(method(collisionCategoryBitMask))]
902        #[unsafe(method_family = none)]
903        pub unsafe fn collisionCategoryBitMask(&self) -> NSUInteger;
904
905        /// Setter for [`collisionCategoryBitMask`][Self::collisionCategoryBitMask].
906        #[unsafe(method(setCollisionCategoryBitMask:))]
907        #[unsafe(method_family = none)]
908        pub unsafe fn setCollisionCategoryBitMask(&self, collision_category_bit_mask: NSUInteger);
909
910        #[cfg(feature = "objc2-core-foundation")]
911        /// Defines the radius of the slider. Defaults to 1.
912        #[unsafe(method(radius))]
913        #[unsafe(method_family = none)]
914        pub unsafe fn radius(&self) -> CGFloat;
915
916        #[cfg(feature = "objc2-core-foundation")]
917        /// Setter for [`radius`][Self::radius].
918        #[unsafe(method(setRadius:))]
919        #[unsafe(method_family = none)]
920        pub unsafe fn setRadius(&self, radius: CGFloat);
921
922        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
923        /// Defines the offset of the slider. Defaults to (0,0,0).
924        #[unsafe(method(offset))]
925        #[unsafe(method_family = none)]
926        pub unsafe fn offset(&self) -> SCNVector3;
927
928        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
929        /// Setter for [`offset`][Self::offset].
930        #[unsafe(method(setOffset:))]
931        #[unsafe(method_family = none)]
932        pub unsafe fn setOffset(&self, offset: SCNVector3);
933    );
934}
935
936/// Methods declared on superclass `NSObject`.
937impl SCNSliderConstraint {
938    extern_methods!(
939        #[unsafe(method(init))]
940        #[unsafe(method_family = init)]
941        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
942
943        #[unsafe(method(new))]
944        #[unsafe(method_family = new)]
945        pub unsafe fn new() -> Retained<Self>;
946    );
947}
948
949extern_protocol!(
950    /// [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnavoidoccluderconstraintdelegate?language=objc)
951    pub unsafe trait SCNAvoidOccluderConstraintDelegate: NSObjectProtocol {
952        #[cfg(feature = "SCNNode")]
953        #[optional]
954        #[unsafe(method(avoidOccluderConstraint:shouldAvoidOccluder:forNode:))]
955        #[unsafe(method_family = none)]
956        unsafe fn avoidOccluderConstraint_shouldAvoidOccluder_forNode(
957            &self,
958            constraint: &SCNAvoidOccluderConstraint,
959            occluder: &SCNNode,
960            node: &SCNNode,
961        ) -> bool;
962
963        #[cfg(feature = "SCNNode")]
964        #[optional]
965        #[unsafe(method(avoidOccluderConstraint:didAvoidOccluder:forNode:))]
966        #[unsafe(method_family = none)]
967        unsafe fn avoidOccluderConstraint_didAvoidOccluder_forNode(
968            &self,
969            constraint: &SCNAvoidOccluderConstraint,
970            occluder: &SCNNode,
971            node: &SCNNode,
972        );
973    }
974);
975
976extern_class!(
977    /// A SCNAvoidOccluderConstraint constraints place the receiver at a position that prevent nodes with the specified category to occlude the target.
978    ///
979    /// The target node and it's children are ignored as potential occluders.
980    ///
981    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnavoidoccluderconstraint?language=objc)
982    #[unsafe(super(SCNConstraint, NSObject))]
983    #[derive(Debug, PartialEq, Eq, Hash)]
984    pub struct SCNAvoidOccluderConstraint;
985);
986
987extern_conformance!(
988    unsafe impl NSCoding for SCNAvoidOccluderConstraint {}
989);
990
991extern_conformance!(
992    unsafe impl NSCopying for SCNAvoidOccluderConstraint {}
993);
994
995unsafe impl CopyingHelper for SCNAvoidOccluderConstraint {
996    type Result = Self;
997}
998
999extern_conformance!(
1000    unsafe impl NSObjectProtocol for SCNAvoidOccluderConstraint {}
1001);
1002
1003extern_conformance!(
1004    unsafe impl NSSecureCoding for SCNAvoidOccluderConstraint {}
1005);
1006
1007#[cfg(feature = "SCNAnimation")]
1008extern_conformance!(
1009    unsafe impl SCNAnimatable for SCNAvoidOccluderConstraint {}
1010);
1011
1012impl SCNAvoidOccluderConstraint {
1013    extern_methods!(
1014        #[cfg(feature = "SCNNode")]
1015        /// Creates and returns a SCNAvoidOccluderConstraint object.
1016        #[unsafe(method(avoidOccluderConstraintWithTarget:))]
1017        #[unsafe(method_family = none)]
1018        pub unsafe fn avoidOccluderConstraintWithTarget(target: Option<&SCNNode>)
1019            -> Retained<Self>;
1020
1021        /// The receiver's delegate
1022        #[unsafe(method(delegate))]
1023        #[unsafe(method_family = none)]
1024        pub unsafe fn delegate(
1025            &self,
1026        ) -> Retained<ProtocolObject<dyn SCNAvoidOccluderConstraintDelegate>>;
1027
1028        /// Setter for [`delegate`][Self::delegate].
1029        #[unsafe(method(setDelegate:))]
1030        #[unsafe(method_family = none)]
1031        pub unsafe fn setDelegate(
1032            &self,
1033            delegate: &ProtocolObject<dyn SCNAvoidOccluderConstraintDelegate>,
1034        );
1035
1036        #[cfg(feature = "SCNNode")]
1037        /// Defines the target node
1038        #[unsafe(method(target))]
1039        #[unsafe(method_family = none)]
1040        pub unsafe fn target(&self) -> Option<Retained<SCNNode>>;
1041
1042        #[cfg(feature = "SCNNode")]
1043        /// Setter for [`target`][Self::target].
1044        #[unsafe(method(setTarget:))]
1045        #[unsafe(method_family = none)]
1046        pub unsafe fn setTarget(&self, target: Option<&SCNNode>);
1047
1048        /// Defines the category of node to consider as occluder. Defaults to 1.
1049        #[unsafe(method(occluderCategoryBitMask))]
1050        #[unsafe(method_family = none)]
1051        pub unsafe fn occluderCategoryBitMask(&self) -> NSUInteger;
1052
1053        /// Setter for [`occluderCategoryBitMask`][Self::occluderCategoryBitMask].
1054        #[unsafe(method(setOccluderCategoryBitMask:))]
1055        #[unsafe(method_family = none)]
1056        pub unsafe fn setOccluderCategoryBitMask(&self, occluder_category_bit_mask: NSUInteger);
1057
1058        #[cfg(feature = "objc2-core-foundation")]
1059        /// Defines the bias the apply after moving the receiver to avoid occluders. Defaults to 10e-5.
1060        ///
1061        /// A positive bias will move the receiver closer to the target.
1062        #[unsafe(method(bias))]
1063        #[unsafe(method_family = none)]
1064        pub unsafe fn bias(&self) -> CGFloat;
1065
1066        #[cfg(feature = "objc2-core-foundation")]
1067        /// Setter for [`bias`][Self::bias].
1068        #[unsafe(method(setBias:))]
1069        #[unsafe(method_family = none)]
1070        pub unsafe fn setBias(&self, bias: CGFloat);
1071    );
1072}
1073
1074/// Methods declared on superclass `NSObject`.
1075impl SCNAvoidOccluderConstraint {
1076    extern_methods!(
1077        #[unsafe(method(init))]
1078        #[unsafe(method_family = init)]
1079        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
1080
1081        #[unsafe(method(new))]
1082        #[unsafe(method_family = new)]
1083        pub unsafe fn new() -> Retained<Self>;
1084    );
1085}