objc2_sprite_kit/generated/
SKPhysicsJoint.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
12extern_class!(
13 #[unsafe(super(NSObject))]
15 #[derive(Debug, PartialEq, Eq, Hash)]
16 pub struct SKPhysicsJoint;
17);
18
19extern_conformance!(
20 unsafe impl NSCoding for SKPhysicsJoint {}
21);
22
23extern_conformance!(
24 unsafe impl NSObjectProtocol for SKPhysicsJoint {}
25);
26
27extern_conformance!(
28 unsafe impl NSSecureCoding for SKPhysicsJoint {}
29);
30
31impl SKPhysicsJoint {
32 extern_methods!(
33 #[cfg(feature = "SKPhysicsBody")]
34 #[unsafe(method(bodyA))]
35 #[unsafe(method_family = none)]
36 pub unsafe fn bodyA(&self) -> Retained<SKPhysicsBody>;
37
38 #[cfg(feature = "SKPhysicsBody")]
39 #[unsafe(method(setBodyA:))]
41 #[unsafe(method_family = none)]
42 pub unsafe fn setBodyA(&self, body_a: &SKPhysicsBody);
43
44 #[cfg(feature = "SKPhysicsBody")]
45 #[unsafe(method(bodyB))]
46 #[unsafe(method_family = none)]
47 pub unsafe fn bodyB(&self) -> Retained<SKPhysicsBody>;
48
49 #[cfg(feature = "SKPhysicsBody")]
50 #[unsafe(method(setBodyB:))]
52 #[unsafe(method_family = none)]
53 pub unsafe fn setBodyB(&self, body_b: &SKPhysicsBody);
54
55 #[cfg(feature = "objc2-core-foundation")]
56 #[unsafe(method(reactionForce))]
57 #[unsafe(method_family = none)]
58 pub unsafe fn reactionForce(&self) -> CGVector;
59
60 #[cfg(feature = "objc2-core-foundation")]
61 #[unsafe(method(reactionTorque))]
62 #[unsafe(method_family = none)]
63 pub unsafe fn reactionTorque(&self) -> CGFloat;
64 );
65}
66
67impl SKPhysicsJoint {
69 extern_methods!(
70 #[unsafe(method(init))]
71 #[unsafe(method_family = init)]
72 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
73
74 #[unsafe(method(new))]
75 #[unsafe(method_family = new)]
76 pub unsafe fn new() -> Retained<Self>;
77 );
78}
79
80extern_class!(
81 #[unsafe(super(SKPhysicsJoint, NSObject))]
83 #[derive(Debug, PartialEq, Eq, Hash)]
84 pub struct SKPhysicsJointPin;
85);
86
87extern_conformance!(
88 unsafe impl NSCoding for SKPhysicsJointPin {}
89);
90
91extern_conformance!(
92 unsafe impl NSObjectProtocol for SKPhysicsJointPin {}
93);
94
95extern_conformance!(
96 unsafe impl NSSecureCoding for SKPhysicsJointPin {}
97);
98
99impl SKPhysicsJointPin {
100 extern_methods!(
101 #[cfg(all(feature = "SKPhysicsBody", feature = "objc2-core-foundation"))]
102 #[unsafe(method(jointWithBodyA:bodyB:anchor:))]
103 #[unsafe(method_family = none)]
104 pub unsafe fn jointWithBodyA_bodyB_anchor(
105 body_a: &SKPhysicsBody,
106 body_b: &SKPhysicsBody,
107 anchor: CGPoint,
108 ) -> Retained<SKPhysicsJointPin>;
109
110 #[unsafe(method(shouldEnableLimits))]
111 #[unsafe(method_family = none)]
112 pub unsafe fn shouldEnableLimits(&self) -> bool;
113
114 #[unsafe(method(setShouldEnableLimits:))]
116 #[unsafe(method_family = none)]
117 pub unsafe fn setShouldEnableLimits(&self, should_enable_limits: bool);
118
119 #[cfg(feature = "objc2-core-foundation")]
120 #[unsafe(method(lowerAngleLimit))]
121 #[unsafe(method_family = none)]
122 pub unsafe fn lowerAngleLimit(&self) -> CGFloat;
123
124 #[cfg(feature = "objc2-core-foundation")]
125 #[unsafe(method(setLowerAngleLimit:))]
127 #[unsafe(method_family = none)]
128 pub unsafe fn setLowerAngleLimit(&self, lower_angle_limit: CGFloat);
129
130 #[cfg(feature = "objc2-core-foundation")]
131 #[unsafe(method(upperAngleLimit))]
132 #[unsafe(method_family = none)]
133 pub unsafe fn upperAngleLimit(&self) -> CGFloat;
134
135 #[cfg(feature = "objc2-core-foundation")]
136 #[unsafe(method(setUpperAngleLimit:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn setUpperAngleLimit(&self, upper_angle_limit: CGFloat);
140
141 #[cfg(feature = "objc2-core-foundation")]
142 #[unsafe(method(frictionTorque))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn frictionTorque(&self) -> CGFloat;
145
146 #[cfg(feature = "objc2-core-foundation")]
147 #[unsafe(method(setFrictionTorque:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setFrictionTorque(&self, friction_torque: CGFloat);
151
152 #[cfg(feature = "objc2-core-foundation")]
153 #[unsafe(method(rotationSpeed))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn rotationSpeed(&self) -> CGFloat;
156
157 #[cfg(feature = "objc2-core-foundation")]
158 #[unsafe(method(setRotationSpeed:))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn setRotationSpeed(&self, rotation_speed: CGFloat);
162 );
163}
164
165impl SKPhysicsJointPin {
167 extern_methods!(
168 #[unsafe(method(init))]
169 #[unsafe(method_family = init)]
170 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
171
172 #[unsafe(method(new))]
173 #[unsafe(method_family = new)]
174 pub unsafe fn new() -> Retained<Self>;
175 );
176}
177
178extern_class!(
179 #[unsafe(super(SKPhysicsJoint, NSObject))]
181 #[derive(Debug, PartialEq, Eq, Hash)]
182 pub struct SKPhysicsJointSpring;
183);
184
185extern_conformance!(
186 unsafe impl NSCoding for SKPhysicsJointSpring {}
187);
188
189extern_conformance!(
190 unsafe impl NSObjectProtocol for SKPhysicsJointSpring {}
191);
192
193extern_conformance!(
194 unsafe impl NSSecureCoding for SKPhysicsJointSpring {}
195);
196
197impl SKPhysicsJointSpring {
198 extern_methods!(
199 #[cfg(all(feature = "SKPhysicsBody", feature = "objc2-core-foundation"))]
200 #[unsafe(method(jointWithBodyA:bodyB:anchorA:anchorB:))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn jointWithBodyA_bodyB_anchorA_anchorB(
203 body_a: &SKPhysicsBody,
204 body_b: &SKPhysicsBody,
205 anchor_a: CGPoint,
206 anchor_b: CGPoint,
207 ) -> Retained<SKPhysicsJointSpring>;
208
209 #[cfg(feature = "objc2-core-foundation")]
210 #[unsafe(method(damping))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn damping(&self) -> CGFloat;
213
214 #[cfg(feature = "objc2-core-foundation")]
215 #[unsafe(method(setDamping:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn setDamping(&self, damping: CGFloat);
219
220 #[cfg(feature = "objc2-core-foundation")]
221 #[unsafe(method(frequency))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn frequency(&self) -> CGFloat;
224
225 #[cfg(feature = "objc2-core-foundation")]
226 #[unsafe(method(setFrequency:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn setFrequency(&self, frequency: CGFloat);
230 );
231}
232
233impl SKPhysicsJointSpring {
235 extern_methods!(
236 #[unsafe(method(init))]
237 #[unsafe(method_family = init)]
238 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
239
240 #[unsafe(method(new))]
241 #[unsafe(method_family = new)]
242 pub unsafe fn new() -> Retained<Self>;
243 );
244}
245
246extern_class!(
247 #[unsafe(super(SKPhysicsJoint, NSObject))]
249 #[derive(Debug, PartialEq, Eq, Hash)]
250 pub struct SKPhysicsJointFixed;
251);
252
253extern_conformance!(
254 unsafe impl NSCoding for SKPhysicsJointFixed {}
255);
256
257extern_conformance!(
258 unsafe impl NSObjectProtocol for SKPhysicsJointFixed {}
259);
260
261extern_conformance!(
262 unsafe impl NSSecureCoding for SKPhysicsJointFixed {}
263);
264
265impl SKPhysicsJointFixed {
266 extern_methods!(
267 #[cfg(all(feature = "SKPhysicsBody", feature = "objc2-core-foundation"))]
268 #[unsafe(method(jointWithBodyA:bodyB:anchor:))]
269 #[unsafe(method_family = none)]
270 pub unsafe fn jointWithBodyA_bodyB_anchor(
271 body_a: &SKPhysicsBody,
272 body_b: &SKPhysicsBody,
273 anchor: CGPoint,
274 ) -> Retained<SKPhysicsJointFixed>;
275 );
276}
277
278impl SKPhysicsJointFixed {
280 extern_methods!(
281 #[unsafe(method(init))]
282 #[unsafe(method_family = init)]
283 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
284
285 #[unsafe(method(new))]
286 #[unsafe(method_family = new)]
287 pub unsafe fn new() -> Retained<Self>;
288 );
289}
290
291extern_class!(
292 #[unsafe(super(SKPhysicsJoint, NSObject))]
294 #[derive(Debug, PartialEq, Eq, Hash)]
295 pub struct SKPhysicsJointSliding;
296);
297
298extern_conformance!(
299 unsafe impl NSCoding for SKPhysicsJointSliding {}
300);
301
302extern_conformance!(
303 unsafe impl NSObjectProtocol for SKPhysicsJointSliding {}
304);
305
306extern_conformance!(
307 unsafe impl NSSecureCoding for SKPhysicsJointSliding {}
308);
309
310impl SKPhysicsJointSliding {
311 extern_methods!(
312 #[cfg(all(feature = "SKPhysicsBody", feature = "objc2-core-foundation"))]
313 #[unsafe(method(jointWithBodyA:bodyB:anchor:axis:))]
314 #[unsafe(method_family = none)]
315 pub unsafe fn jointWithBodyA_bodyB_anchor_axis(
316 body_a: &SKPhysicsBody,
317 body_b: &SKPhysicsBody,
318 anchor: CGPoint,
319 axis: CGVector,
320 ) -> Retained<SKPhysicsJointSliding>;
321
322 #[unsafe(method(shouldEnableLimits))]
323 #[unsafe(method_family = none)]
324 pub unsafe fn shouldEnableLimits(&self) -> bool;
325
326 #[unsafe(method(setShouldEnableLimits:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn setShouldEnableLimits(&self, should_enable_limits: bool);
330
331 #[cfg(feature = "objc2-core-foundation")]
332 #[unsafe(method(lowerDistanceLimit))]
333 #[unsafe(method_family = none)]
334 pub unsafe fn lowerDistanceLimit(&self) -> CGFloat;
335
336 #[cfg(feature = "objc2-core-foundation")]
337 #[unsafe(method(setLowerDistanceLimit:))]
339 #[unsafe(method_family = none)]
340 pub unsafe fn setLowerDistanceLimit(&self, lower_distance_limit: CGFloat);
341
342 #[cfg(feature = "objc2-core-foundation")]
343 #[unsafe(method(upperDistanceLimit))]
344 #[unsafe(method_family = none)]
345 pub unsafe fn upperDistanceLimit(&self) -> CGFloat;
346
347 #[cfg(feature = "objc2-core-foundation")]
348 #[unsafe(method(setUpperDistanceLimit:))]
350 #[unsafe(method_family = none)]
351 pub unsafe fn setUpperDistanceLimit(&self, upper_distance_limit: CGFloat);
352 );
353}
354
355impl SKPhysicsJointSliding {
357 extern_methods!(
358 #[unsafe(method(init))]
359 #[unsafe(method_family = init)]
360 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
361
362 #[unsafe(method(new))]
363 #[unsafe(method_family = new)]
364 pub unsafe fn new() -> Retained<Self>;
365 );
366}
367
368extern_class!(
369 #[unsafe(super(SKPhysicsJoint, NSObject))]
371 #[derive(Debug, PartialEq, Eq, Hash)]
372 pub struct SKPhysicsJointLimit;
373);
374
375extern_conformance!(
376 unsafe impl NSCoding for SKPhysicsJointLimit {}
377);
378
379extern_conformance!(
380 unsafe impl NSObjectProtocol for SKPhysicsJointLimit {}
381);
382
383extern_conformance!(
384 unsafe impl NSSecureCoding for SKPhysicsJointLimit {}
385);
386
387impl SKPhysicsJointLimit {
388 extern_methods!(
389 #[cfg(feature = "objc2-core-foundation")]
390 #[unsafe(method(maxLength))]
391 #[unsafe(method_family = none)]
392 pub unsafe fn maxLength(&self) -> CGFloat;
393
394 #[cfg(feature = "objc2-core-foundation")]
395 #[unsafe(method(setMaxLength:))]
397 #[unsafe(method_family = none)]
398 pub unsafe fn setMaxLength(&self, max_length: CGFloat);
399
400 #[cfg(all(feature = "SKPhysicsBody", feature = "objc2-core-foundation"))]
401 #[unsafe(method(jointWithBodyA:bodyB:anchorA:anchorB:))]
402 #[unsafe(method_family = none)]
403 pub unsafe fn jointWithBodyA_bodyB_anchorA_anchorB(
404 body_a: &SKPhysicsBody,
405 body_b: &SKPhysicsBody,
406 anchor_a: CGPoint,
407 anchor_b: CGPoint,
408 ) -> Retained<SKPhysicsJointLimit>;
409 );
410}
411
412impl SKPhysicsJointLimit {
414 extern_methods!(
415 #[unsafe(method(init))]
416 #[unsafe(method_family = init)]
417 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
418
419 #[unsafe(method(new))]
420 #[unsafe(method_family = new)]
421 pub unsafe fn new() -> Retained<Self>;
422 );
423}