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