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
67extern_conformance!(
68 unsafe impl NSObjectProtocol for SCNCameraController {}
69);
70
71impl SCNCameraController {
72 extern_methods!(
73 #[unsafe(method(delegate))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn delegate(
79 &self,
80 ) -> Option<Retained<ProtocolObject<dyn SCNCameraControllerDelegate>>>;
81
82 #[unsafe(method(setDelegate:))]
88 #[unsafe(method_family = none)]
89 pub unsafe fn setDelegate(
90 &self,
91 delegate: Option<&ProtocolObject<dyn SCNCameraControllerDelegate>>,
92 );
93
94 #[cfg(feature = "SCNNode")]
95 #[unsafe(method(pointOfView))]
96 #[unsafe(method_family = none)]
97 pub unsafe fn pointOfView(&self) -> Option<Retained<SCNNode>>;
98
99 #[cfg(feature = "SCNNode")]
100 #[unsafe(method(setPointOfView:))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn setPointOfView(&self, point_of_view: Option<&SCNNode>);
104
105 #[unsafe(method(interactionMode))]
106 #[unsafe(method_family = none)]
107 pub unsafe fn interactionMode(&self) -> SCNInteractionMode;
108
109 #[unsafe(method(setInteractionMode:))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn setInteractionMode(&self, interaction_mode: SCNInteractionMode);
113
114 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
115 #[unsafe(method(target))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn target(&self) -> SCNVector3;
118
119 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
120 #[unsafe(method(setTarget:))]
122 #[unsafe(method_family = none)]
123 pub unsafe fn setTarget(&self, target: SCNVector3);
124
125 #[unsafe(method(automaticTarget))]
126 #[unsafe(method_family = none)]
127 pub unsafe fn automaticTarget(&self) -> bool;
128
129 #[unsafe(method(setAutomaticTarget:))]
131 #[unsafe(method_family = none)]
132 pub unsafe fn setAutomaticTarget(&self, automatic_target: bool);
133
134 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
135 #[unsafe(method(worldUp))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn worldUp(&self) -> SCNVector3;
138
139 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
140 #[unsafe(method(setWorldUp:))]
142 #[unsafe(method_family = none)]
143 pub unsafe fn setWorldUp(&self, world_up: SCNVector3);
144
145 #[unsafe(method(inertiaEnabled))]
146 #[unsafe(method_family = none)]
147 pub unsafe fn inertiaEnabled(&self) -> bool;
148
149 #[unsafe(method(setInertiaEnabled:))]
151 #[unsafe(method_family = none)]
152 pub unsafe fn setInertiaEnabled(&self, inertia_enabled: bool);
153
154 #[unsafe(method(inertiaFriction))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn inertiaFriction(&self) -> c_float;
157
158 #[unsafe(method(setInertiaFriction:))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn setInertiaFriction(&self, inertia_friction: c_float);
162
163 #[unsafe(method(isInertiaRunning))]
164 #[unsafe(method_family = none)]
165 pub unsafe fn isInertiaRunning(&self) -> bool;
166
167 #[unsafe(method(minimumVerticalAngle))]
168 #[unsafe(method_family = none)]
169 pub unsafe fn minimumVerticalAngle(&self) -> c_float;
170
171 #[unsafe(method(setMinimumVerticalAngle:))]
173 #[unsafe(method_family = none)]
174 pub unsafe fn setMinimumVerticalAngle(&self, minimum_vertical_angle: c_float);
175
176 #[unsafe(method(maximumVerticalAngle))]
177 #[unsafe(method_family = none)]
178 pub unsafe fn maximumVerticalAngle(&self) -> c_float;
179
180 #[unsafe(method(setMaximumVerticalAngle:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setMaximumVerticalAngle(&self, maximum_vertical_angle: c_float);
184
185 #[unsafe(method(minimumHorizontalAngle))]
186 #[unsafe(method_family = none)]
187 pub unsafe fn minimumHorizontalAngle(&self) -> c_float;
188
189 #[unsafe(method(setMinimumHorizontalAngle:))]
191 #[unsafe(method_family = none)]
192 pub unsafe fn setMinimumHorizontalAngle(&self, minimum_horizontal_angle: c_float);
193
194 #[unsafe(method(maximumHorizontalAngle))]
195 #[unsafe(method_family = none)]
196 pub unsafe fn maximumHorizontalAngle(&self) -> c_float;
197
198 #[unsafe(method(setMaximumHorizontalAngle:))]
200 #[unsafe(method_family = none)]
201 pub unsafe fn setMaximumHorizontalAngle(&self, maximum_horizontal_angle: c_float);
202
203 #[unsafe(method(translateInCameraSpaceByX:Y:Z:))]
204 #[unsafe(method_family = none)]
205 pub unsafe fn translateInCameraSpaceByX_Y_Z(
206 &self,
207 delta_x: c_float,
208 delta_y: c_float,
209 delta_z: c_float,
210 );
211
212 #[cfg(feature = "SCNNode")]
213 #[unsafe(method(frameNodes:))]
214 #[unsafe(method_family = none)]
215 pub unsafe fn frameNodes(&self, nodes: &NSArray<SCNNode>);
216
217 #[unsafe(method(rotateByX:Y:))]
218 #[unsafe(method_family = none)]
219 pub unsafe fn rotateByX_Y(&self, delta_x: c_float, delta_y: c_float);
220
221 #[cfg(feature = "objc2-core-foundation")]
222 #[unsafe(method(rollBy:aroundScreenPoint:viewport:))]
223 #[unsafe(method_family = none)]
224 pub unsafe fn rollBy_aroundScreenPoint_viewport(
225 &self,
226 delta: c_float,
227 point: CGPoint,
228 viewport: CGSize,
229 );
230
231 #[cfg(feature = "objc2-core-foundation")]
232 #[unsafe(method(dollyBy:onScreenPoint:viewport:))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn dollyBy_onScreenPoint_viewport(
235 &self,
236 delta: c_float,
237 point: CGPoint,
238 viewport: CGSize,
239 );
240
241 #[unsafe(method(rollAroundTarget:))]
242 #[unsafe(method_family = none)]
243 pub unsafe fn rollAroundTarget(&self, delta: c_float);
244
245 #[unsafe(method(dollyToTarget:))]
246 #[unsafe(method_family = none)]
247 pub unsafe fn dollyToTarget(&self, delta: c_float);
248
249 #[unsafe(method(clearRoll))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn clearRoll(&self);
252
253 #[unsafe(method(stopInertia))]
254 #[unsafe(method_family = none)]
255 pub unsafe fn stopInertia(&self);
256
257 #[cfg(feature = "objc2-core-foundation")]
258 #[unsafe(method(beginInteraction:withViewport:))]
259 #[unsafe(method_family = none)]
260 pub unsafe fn beginInteraction_withViewport(&self, location: CGPoint, viewport: CGSize);
261
262 #[cfg(feature = "objc2-core-foundation")]
263 #[unsafe(method(continueInteraction:withViewport:sensitivity:))]
264 #[unsafe(method_family = none)]
265 pub unsafe fn continueInteraction_withViewport_sensitivity(
266 &self,
267 location: CGPoint,
268 viewport: CGSize,
269 sensitivity: CGFloat,
270 );
271
272 #[cfg(feature = "objc2-core-foundation")]
273 #[unsafe(method(endInteraction:withViewport:velocity:))]
274 #[unsafe(method_family = none)]
275 pub unsafe fn endInteraction_withViewport_velocity(
276 &self,
277 location: CGPoint,
278 viewport: CGSize,
279 velocity: CGPoint,
280 );
281 );
282}
283
284impl SCNCameraController {
286 extern_methods!(
287 #[unsafe(method(init))]
288 #[unsafe(method_family = init)]
289 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
290
291 #[unsafe(method(new))]
292 #[unsafe(method_family = new)]
293 pub unsafe fn new() -> Retained<Self>;
294 );
295}