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