objc2_scene_kit/generated/
SCNSkinner.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::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// SCNSkinner controls the deformation of skinned geometries
12    ///
13    /// See also [Apple's documentation](https://developer.apple.com/documentation/scenekit/scnskinner?language=objc)
14    #[unsafe(super(NSObject))]
15    #[derive(Debug, PartialEq, Eq, Hash)]
16    pub struct SCNSkinner;
17);
18
19extern_conformance!(
20    unsafe impl NSCoding for SCNSkinner {}
21);
22
23extern_conformance!(
24    unsafe impl NSObjectProtocol for SCNSkinner {}
25);
26
27extern_conformance!(
28    unsafe impl NSSecureCoding for SCNSkinner {}
29);
30
31impl SCNSkinner {
32    extern_methods!(
33        #[cfg(feature = "SCNNode")]
34        /// Specifies the skeleton of the receiver.
35        ///
36        /// When setting a new skeleton, the new skeleton must have the same hierarchy of joints.
37        #[unsafe(method(skeleton))]
38        #[unsafe(method_family = none)]
39        pub unsafe fn skeleton(&self) -> Option<Retained<SCNNode>>;
40
41        #[cfg(feature = "SCNNode")]
42        /// Setter for [`skeleton`][Self::skeleton].
43        ///
44        /// This is a [weak property][objc2::topics::weak_property].
45        #[unsafe(method(setSkeleton:))]
46        #[unsafe(method_family = none)]
47        pub unsafe fn setSkeleton(&self, skeleton: Option<&SCNNode>);
48
49        #[cfg(all(feature = "SCNGeometry", feature = "SCNNode"))]
50        /// Creates and initialize a skinner instance with the specified parameters.
51        ///
52        /// Parameter `baseGeometry`: Specifies the base geometry used by the skinner
53        ///
54        /// Parameter `bones`: Specifies the array of bones.
55        ///
56        /// Parameter `boneInverseBindTransforms`: The inverse of the bone’s bind-space transformation matrix at the time the bind shape was bound to this bone.
57        ///
58        /// Parameter `boneWeights`: A buffer of weights. This contains the weights of every influence of every vertex. The number of influence per vertex is controlled by the number of component in the geometry source.
59        ///
60        /// Parameter `boneIndices`: A buffer of bone indexes. This buffer contains the corresponding index in the bones array for every weight in the weights buffer.
61        #[unsafe(method(skinnerWithBaseGeometry:bones:boneInverseBindTransforms:boneWeights:boneIndices:))]
62        #[unsafe(method_family = none)]
63        pub unsafe fn skinnerWithBaseGeometry_bones_boneInverseBindTransforms_boneWeights_boneIndices(
64            base_geometry: Option<&SCNGeometry>,
65            bones: &NSArray<SCNNode>,
66            bone_inverse_bind_transforms: Option<&NSArray<NSValue>>,
67            bone_weights: &SCNGeometrySource,
68            bone_indices: &SCNGeometrySource,
69        ) -> Retained<Self>;
70
71        #[cfg(feature = "SCNGeometry")]
72        /// Specifies the base geometry of the receiver.
73        ///
74        /// Updating this will change the geometry of all the nodes sharing the skinner.
75        /// Access the node's geometry if you want to update this specific skinner properties (materials for example).
76        /// Access this property if you want a whole new geometry (which will necessarily be shared among the skinner instances), with
77        /// different sources, for instance.
78        #[unsafe(method(baseGeometry))]
79        #[unsafe(method_family = none)]
80        pub unsafe fn baseGeometry(&self) -> Option<Retained<SCNGeometry>>;
81
82        #[cfg(feature = "SCNGeometry")]
83        /// Setter for [`baseGeometry`][Self::baseGeometry].
84        #[unsafe(method(setBaseGeometry:))]
85        #[unsafe(method_family = none)]
86        pub unsafe fn setBaseGeometry(&self, base_geometry: Option<&SCNGeometry>);
87
88        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-quartz-core"))]
89        #[cfg(not(target_os = "watchos"))]
90        /// Specifies the transform of the baseGeometry at the time when the mesh was bound to a skeleton. This transforms the baseGeometry from object space to a space on which the skinning then applies.
91        #[unsafe(method(baseGeometryBindTransform))]
92        #[unsafe(method_family = none)]
93        pub unsafe fn baseGeometryBindTransform(&self) -> SCNMatrix4;
94
95        #[cfg(all(feature = "SceneKitTypes", feature = "objc2-quartz-core"))]
96        #[cfg(not(target_os = "watchos"))]
97        /// Setter for [`baseGeometryBindTransform`][Self::baseGeometryBindTransform].
98        #[unsafe(method(setBaseGeometryBindTransform:))]
99        #[unsafe(method_family = none)]
100        pub unsafe fn setBaseGeometryBindTransform(&self, base_geometry_bind_transform: SCNMatrix4);
101
102        /// The inverse of the bone’s bind-space transformation matrix at the time the bind shape was bound to this bone.
103        ///
104        /// boneInverseBindTransforms is an array of SCNMatrix4 wrapped into instances of NSValue.
105        #[unsafe(method(boneInverseBindTransforms))]
106        #[unsafe(method_family = none)]
107        pub unsafe fn boneInverseBindTransforms(&self) -> Option<Retained<NSArray<NSValue>>>;
108
109        #[cfg(feature = "SCNNode")]
110        /// The bones of the skinner.
111        #[unsafe(method(bones))]
112        #[unsafe(method_family = none)]
113        pub unsafe fn bones(&self) -> Retained<NSArray<SCNNode>>;
114
115        #[cfg(feature = "SCNGeometry")]
116        /// The bone weights of the receiver.
117        #[unsafe(method(boneWeights))]
118        #[unsafe(method_family = none)]
119        pub unsafe fn boneWeights(&self) -> Retained<SCNGeometrySource>;
120
121        #[cfg(feature = "SCNGeometry")]
122        /// The bone indices of the receiver.
123        #[unsafe(method(boneIndices))]
124        #[unsafe(method_family = none)]
125        pub unsafe fn boneIndices(&self) -> Retained<SCNGeometrySource>;
126    );
127}
128
129/// Methods declared on superclass `NSObject`.
130impl SCNSkinner {
131    extern_methods!(
132        #[unsafe(method(init))]
133        #[unsafe(method_family = init)]
134        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
135
136        #[unsafe(method(new))]
137        #[unsafe(method_family = new)]
138        pub unsafe fn new() -> Retained<Self>;
139    );
140}