objc2_scene_kit/generated/
SCNCameraController.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
12#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct SCNInteractionMode(pub NSInteger);
17impl SCNInteractionMode {
18 #[doc(alias = "SCNInteractionModeFly")]
19 pub const Fly: Self = Self(0);
20 #[doc(alias = "SCNInteractionModeOrbitTurntable")]
21 pub const OrbitTurntable: Self = Self(1);
22 #[doc(alias = "SCNInteractionModeOrbitAngleMapping")]
23 pub const OrbitAngleMapping: Self = Self(2);
24 #[doc(alias = "SCNInteractionModeOrbitCenteredArcball")]
25 pub const OrbitCenteredArcball: Self = Self(3);
26 #[doc(alias = "SCNInteractionModeOrbitArcball")]
27 pub const OrbitArcball: Self = Self(4);
28 #[doc(alias = "SCNInteractionModePan")]
29 pub const Pan: Self = Self(5);
30 #[doc(alias = "SCNInteractionModeTruck")]
31 pub const Truck: Self = Self(6);
32}
33
34unsafe impl Encode for SCNInteractionMode {
35 const ENCODING: Encoding = NSInteger::ENCODING;
36}
37
38unsafe impl RefEncode for SCNInteractionMode {
39 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
40}
41
42extern_protocol!(
43 pub unsafe trait SCNCameraControllerDelegate: NSObjectProtocol {
45 #[optional]
46 #[unsafe(method(cameraInertiaWillStartForController:))]
47 #[unsafe(method_family = none)]
48 unsafe fn cameraInertiaWillStartForController(
49 &self,
50 camera_controller: &SCNCameraController,
51 );
52
53 #[optional]
54 #[unsafe(method(cameraInertiaDidEndForController:))]
55 #[unsafe(method_family = none)]
56 unsafe fn cameraInertiaDidEndForController(&self, camera_controller: &SCNCameraController);
57 }
58);
59
60extern_class!(
61 #[unsafe(super(NSObject))]
63 #[derive(Debug, PartialEq, Eq, Hash)]
64 pub struct SCNCameraController;
65);
66
67unsafe impl NSObjectProtocol for SCNCameraController {}
68
69impl SCNCameraController {
70 extern_methods!(
71 #[unsafe(method(delegate))]
72 #[unsafe(method_family = none)]
73 pub unsafe fn delegate(
74 &self,
75 ) -> Option<Retained<ProtocolObject<dyn SCNCameraControllerDelegate>>>;
76
77 #[unsafe(method(setDelegate:))]
79 #[unsafe(method_family = none)]
80 pub unsafe fn setDelegate(
81 &self,
82 delegate: Option<&ProtocolObject<dyn SCNCameraControllerDelegate>>,
83 );
84
85 #[cfg(feature = "SCNNode")]
86 #[unsafe(method(pointOfView))]
87 #[unsafe(method_family = none)]
88 pub unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>;
89
90 #[cfg(feature = "SCNNode")]
91 #[unsafe(method(setPointOfView:))]
93 #[unsafe(method_family = none)]
94 pub unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>);
95
96 #[unsafe(method(interactionMode))]
97 #[unsafe(method_family = none)]
98 pub unsafe fn interactionMode(&self) -> SCNInteractionMode;
99
100 #[unsafe(method(setInteractionMode:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setInteractionMode(&self, interaction_mode: SCNInteractionMode);
104
105 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
106 #[unsafe(method(target))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn target(&self) -> SCNVector3;
109
110 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
111 #[unsafe(method(setTarget:))]
113 #[unsafe(method_family = none)]
114 pub unsafe fn setTarget(&self, target: SCNVector3);
115
116 #[unsafe(method(automaticTarget))]
117 #[unsafe(method_family = none)]
118 pub unsafe fn automaticTarget(&self) -> bool;
119
120 #[unsafe(method(setAutomaticTarget:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setAutomaticTarget(&self, automatic_target: bool);
124
125 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
126 #[unsafe(method(worldUp))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn worldUp(&self) -> SCNVector3;
129
130 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
131 #[unsafe(method(setWorldUp:))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn setWorldUp(&self, world_up: SCNVector3);
135
136 #[unsafe(method(inertiaEnabled))]
137 #[unsafe(method_family = none)]
138 pub unsafe fn inertiaEnabled(&self) -> bool;
139
140 #[unsafe(method(setInertiaEnabled:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn setInertiaEnabled(&self, inertia_enabled: bool);
144
145 #[unsafe(method(inertiaFriction))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn inertiaFriction(&self) -> c_float;
148
149 #[unsafe(method(setInertiaFriction:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn setInertiaFriction(&self, inertia_friction: c_float);
153
154 #[unsafe(method(isInertiaRunning))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn isInertiaRunning(&self) -> bool;
157
158 #[unsafe(method(minimumVerticalAngle))]
159 #[unsafe(method_family = none)]
160 pub unsafe fn minimumVerticalAngle(&self) -> c_float;
161
162 #[unsafe(method(setMinimumVerticalAngle:))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn setMinimumVerticalAngle(&self, minimum_vertical_angle: c_float);
166
167 #[unsafe(method(maximumVerticalAngle))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn maximumVerticalAngle(&self) -> c_float;
170
171 #[unsafe(method(setMaximumVerticalAngle:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn setMaximumVerticalAngle(&self, maximum_vertical_angle: c_float);
175
176 #[unsafe(method(minimumHorizontalAngle))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn minimumHorizontalAngle(&self) -> c_float;
179
180 #[unsafe(method(setMinimumHorizontalAngle:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setMinimumHorizontalAngle(&self, minimum_horizontal_angle: c_float);
184
185 #[unsafe(method(maximumHorizontalAngle))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn maximumHorizontalAngle(&self) -> c_float;
188
189 #[unsafe(method(setMaximumHorizontalAngle:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn setMaximumHorizontalAngle(&self, maximum_horizontal_angle: c_float);
193
194 #[unsafe(method(translateInCameraSpaceByX:Y:Z:))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn translateInCameraSpaceByX_Y_Z(
197 &self,
198 delta_x: c_float,
199 delta_y: c_float,
200 delta_z: c_float,
201 );
202
203 #[cfg(feature = "SCNNode")]
204 #[unsafe(method(frameNodes:))]
205 #[unsafe(method_family = none)]
206 pub unsafe fn frameNodes(&self, nodes: &NSArray<SCNNode>);
207
208 #[unsafe(method(rotateByX:Y:))]
209 #[unsafe(method_family = none)]
210 pub unsafe fn rotateByX_Y(&self, delta_x: c_float, delta_y: c_float);
211
212 #[cfg(feature = "objc2-core-foundation")]
213 #[unsafe(method(rollBy:aroundScreenPoint:viewport:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn rollBy_aroundScreenPoint_viewport(
216 &self,
217 delta: c_float,
218 point: CGPoint,
219 viewport: CGSize,
220 );
221
222 #[cfg(feature = "objc2-core-foundation")]
223 #[unsafe(method(dollyBy:onScreenPoint:viewport:))]
224 #[unsafe(method_family = none)]
225 pub unsafe fn dollyBy_onScreenPoint_viewport(
226 &self,
227 delta: c_float,
228 point: CGPoint,
229 viewport: CGSize,
230 );
231
232 #[unsafe(method(rollAroundTarget:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn rollAroundTarget(&self, delta: c_float);
235
236 #[unsafe(method(dollyToTarget:))]
237 #[unsafe(method_family = none)]
238 pub unsafe fn dollyToTarget(&self, delta: c_float);
239
240 #[unsafe(method(clearRoll))]
241 #[unsafe(method_family = none)]
242 pub unsafe fn clearRoll(&self);
243
244 #[unsafe(method(stopInertia))]
245 #[unsafe(method_family = none)]
246 pub unsafe fn stopInertia(&self);
247
248 #[cfg(feature = "objc2-core-foundation")]
249 #[unsafe(method(beginInteraction:withViewport:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn beginInteraction_withViewport(&self, location: CGPoint, viewport: CGSize);
252
253 #[cfg(feature = "objc2-core-foundation")]
254 #[unsafe(method(continueInteraction:withViewport:sensitivity:))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn continueInteraction_withViewport_sensitivity(
257 &self,
258 location: CGPoint,
259 viewport: CGSize,
260 sensitivity: CGFloat,
261 );
262
263 #[cfg(feature = "objc2-core-foundation")]
264 #[unsafe(method(endInteraction:withViewport:velocity:))]
265 #[unsafe(method_family = none)]
266 pub unsafe fn endInteraction_withViewport_velocity(
267 &self,
268 location: CGPoint,
269 viewport: CGSize,
270 velocity: CGPoint,
271 );
272 );
273}
274
275impl SCNCameraController {
277 extern_methods!(
278 #[unsafe(method(init))]
279 #[unsafe(method_family = init)]
280 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
281
282 #[unsafe(method(new))]
283 #[unsafe(method_family = new)]
284 pub unsafe fn new() -> Retained<Self>;
285 );
286}