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