objc2_scene_kit/generated/
SCNPhysicsBody.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 SCNPhysicsBodyType(pub NSInteger);
17impl SCNPhysicsBodyType {
18 #[doc(alias = "SCNPhysicsBodyTypeStatic")]
19 pub const Static: Self = Self(0);
20 #[doc(alias = "SCNPhysicsBodyTypeDynamic")]
21 pub const Dynamic: Self = Self(1);
22 #[doc(alias = "SCNPhysicsBodyTypeKinematic")]
23 pub const Kinematic: Self = Self(2);
24}
25
26unsafe impl Encode for SCNPhysicsBodyType {
27 const ENCODING: Encoding = NSInteger::ENCODING;
28}
29
30unsafe impl RefEncode for SCNPhysicsBodyType {
31 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
32}
33
34#[repr(transparent)]
37#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
38pub struct SCNPhysicsCollisionCategory(pub NSUInteger);
39bitflags::bitflags! {
40 impl SCNPhysicsCollisionCategory: NSUInteger {
41 #[doc(alias = "SCNPhysicsCollisionCategoryDefault")]
42 const Default = 1<<0;
43 #[doc(alias = "SCNPhysicsCollisionCategoryStatic")]
44 const Static = 1<<1;
45 #[doc(alias = "SCNPhysicsCollisionCategoryAll")]
46 const All = !0;
47 }
48}
49
50unsafe impl Encode for SCNPhysicsCollisionCategory {
51 const ENCODING: Encoding = NSUInteger::ENCODING;
52}
53
54unsafe impl RefEncode for SCNPhysicsCollisionCategory {
55 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
56}
57
58extern_class!(
59 #[unsafe(super(NSObject))]
63 #[derive(Debug, PartialEq, Eq, Hash)]
64 pub struct SCNPhysicsBody;
65);
66
67unsafe impl NSCoding for SCNPhysicsBody {}
68
69unsafe impl NSCopying for SCNPhysicsBody {}
70
71unsafe impl CopyingHelper for SCNPhysicsBody {
72 type Result = Self;
73}
74
75unsafe impl NSObjectProtocol for SCNPhysicsBody {}
76
77unsafe impl NSSecureCoding for SCNPhysicsBody {}
78
79impl SCNPhysicsBody {
80 extern_methods!(
81 #[unsafe(method(staticBody))]
82 #[unsafe(method_family = none)]
83 pub unsafe fn staticBody() -> Retained<Self>;
84
85 #[unsafe(method(dynamicBody))]
86 #[unsafe(method_family = none)]
87 pub unsafe fn dynamicBody() -> Retained<Self>;
88
89 #[unsafe(method(kinematicBody))]
90 #[unsafe(method_family = none)]
91 pub unsafe fn kinematicBody() -> Retained<Self>;
92
93 #[cfg(feature = "SCNPhysicsShape")]
94 #[unsafe(method(bodyWithType:shape:))]
95 #[unsafe(method_family = none)]
96 pub unsafe fn bodyWithType_shape(
97 r#type: SCNPhysicsBodyType,
98 shape: Option<&SCNPhysicsShape>,
99 ) -> Retained<Self>;
100
101 #[unsafe(method(type))]
102 #[unsafe(method_family = none)]
103 pub unsafe fn r#type(&self) -> SCNPhysicsBodyType;
104
105 #[unsafe(method(setType:))]
107 #[unsafe(method_family = none)]
108 pub unsafe fn setType(&self, r#type: SCNPhysicsBodyType);
109
110 #[cfg(feature = "objc2-core-foundation")]
111 #[unsafe(method(mass))]
112 #[unsafe(method_family = none)]
113 pub unsafe fn mass(&self) -> CGFloat;
114
115 #[cfg(feature = "objc2-core-foundation")]
116 #[unsafe(method(setMass:))]
118 #[unsafe(method_family = none)]
119 pub unsafe fn setMass(&self, mass: CGFloat);
120
121 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
122 #[unsafe(method(momentOfInertia))]
123 #[unsafe(method_family = none)]
124 pub unsafe fn momentOfInertia(&self) -> SCNVector3;
125
126 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
127 #[unsafe(method(setMomentOfInertia:))]
129 #[unsafe(method_family = none)]
130 pub unsafe fn setMomentOfInertia(&self, moment_of_inertia: SCNVector3);
131
132 #[unsafe(method(usesDefaultMomentOfInertia))]
133 #[unsafe(method_family = none)]
134 pub unsafe fn usesDefaultMomentOfInertia(&self) -> bool;
135
136 #[unsafe(method(setUsesDefaultMomentOfInertia:))]
138 #[unsafe(method_family = none)]
139 pub unsafe fn setUsesDefaultMomentOfInertia(&self, uses_default_moment_of_inertia: bool);
140
141 #[cfg(feature = "objc2-core-foundation")]
142 #[unsafe(method(charge))]
143 #[unsafe(method_family = none)]
144 pub unsafe fn charge(&self) -> CGFloat;
145
146 #[cfg(feature = "objc2-core-foundation")]
147 #[unsafe(method(setCharge:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn setCharge(&self, charge: CGFloat);
151
152 #[cfg(feature = "objc2-core-foundation")]
153 #[unsafe(method(friction))]
154 #[unsafe(method_family = none)]
155 pub unsafe fn friction(&self) -> CGFloat;
156
157 #[cfg(feature = "objc2-core-foundation")]
158 #[unsafe(method(setFriction:))]
160 #[unsafe(method_family = none)]
161 pub unsafe fn setFriction(&self, friction: CGFloat);
162
163 #[cfg(feature = "objc2-core-foundation")]
164 #[unsafe(method(restitution))]
165 #[unsafe(method_family = none)]
166 pub unsafe fn restitution(&self) -> CGFloat;
167
168 #[cfg(feature = "objc2-core-foundation")]
169 #[unsafe(method(setRestitution:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn setRestitution(&self, restitution: CGFloat);
173
174 #[cfg(feature = "objc2-core-foundation")]
175 #[unsafe(method(rollingFriction))]
176 #[unsafe(method_family = none)]
177 pub unsafe fn rollingFriction(&self) -> CGFloat;
178
179 #[cfg(feature = "objc2-core-foundation")]
180 #[unsafe(method(setRollingFriction:))]
182 #[unsafe(method_family = none)]
183 pub unsafe fn setRollingFriction(&self, rolling_friction: CGFloat);
184
185 #[cfg(feature = "SCNPhysicsShape")]
186 #[unsafe(method(physicsShape))]
187 #[unsafe(method_family = none)]
188 pub unsafe fn physicsShape(&self) -> Option<Retained<SCNPhysicsShape>>;
189
190 #[cfg(feature = "SCNPhysicsShape")]
191 #[unsafe(method(setPhysicsShape:))]
193 #[unsafe(method_family = none)]
194 pub unsafe fn setPhysicsShape(&self, physics_shape: Option<&SCNPhysicsShape>);
195
196 #[unsafe(method(isResting))]
197 #[unsafe(method_family = none)]
198 pub unsafe fn isResting(&self) -> bool;
199
200 #[unsafe(method(allowsResting))]
201 #[unsafe(method_family = none)]
202 pub unsafe fn allowsResting(&self) -> bool;
203
204 #[unsafe(method(setAllowsResting:))]
206 #[unsafe(method_family = none)]
207 pub unsafe fn setAllowsResting(&self, allows_resting: bool);
208
209 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
210 #[unsafe(method(velocity))]
211 #[unsafe(method_family = none)]
212 pub unsafe fn velocity(&self) -> SCNVector3;
213
214 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
215 #[unsafe(method(setVelocity:))]
217 #[unsafe(method_family = none)]
218 pub unsafe fn setVelocity(&self, velocity: SCNVector3);
219
220 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
221 #[unsafe(method(angularVelocity))]
222 #[unsafe(method_family = none)]
223 pub unsafe fn angularVelocity(&self) -> SCNVector4;
224
225 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
226 #[unsafe(method(setAngularVelocity:))]
228 #[unsafe(method_family = none)]
229 pub unsafe fn setAngularVelocity(&self, angular_velocity: SCNVector4);
230
231 #[cfg(feature = "objc2-core-foundation")]
232 #[unsafe(method(damping))]
233 #[unsafe(method_family = none)]
234 pub unsafe fn damping(&self) -> CGFloat;
235
236 #[cfg(feature = "objc2-core-foundation")]
237 #[unsafe(method(setDamping:))]
239 #[unsafe(method_family = none)]
240 pub unsafe fn setDamping(&self, damping: CGFloat);
241
242 #[cfg(feature = "objc2-core-foundation")]
243 #[unsafe(method(angularDamping))]
244 #[unsafe(method_family = none)]
245 pub unsafe fn angularDamping(&self) -> CGFloat;
246
247 #[cfg(feature = "objc2-core-foundation")]
248 #[unsafe(method(setAngularDamping:))]
250 #[unsafe(method_family = none)]
251 pub unsafe fn setAngularDamping(&self, angular_damping: CGFloat);
252
253 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
254 #[unsafe(method(velocityFactor))]
255 #[unsafe(method_family = none)]
256 pub unsafe fn velocityFactor(&self) -> SCNVector3;
257
258 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
259 #[unsafe(method(setVelocityFactor:))]
261 #[unsafe(method_family = none)]
262 pub unsafe fn setVelocityFactor(&self, velocity_factor: SCNVector3);
263
264 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
265 #[unsafe(method(angularVelocityFactor))]
266 #[unsafe(method_family = none)]
267 pub unsafe fn angularVelocityFactor(&self) -> SCNVector3;
268
269 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
270 #[unsafe(method(setAngularVelocityFactor:))]
272 #[unsafe(method_family = none)]
273 pub unsafe fn setAngularVelocityFactor(&self, angular_velocity_factor: SCNVector3);
274
275 #[unsafe(method(categoryBitMask))]
276 #[unsafe(method_family = none)]
277 pub unsafe fn categoryBitMask(&self) -> NSUInteger;
278
279 #[unsafe(method(setCategoryBitMask:))]
281 #[unsafe(method_family = none)]
282 pub unsafe fn setCategoryBitMask(&self, category_bit_mask: NSUInteger);
283
284 #[unsafe(method(collisionBitMask))]
285 #[unsafe(method_family = none)]
286 pub unsafe fn collisionBitMask(&self) -> NSUInteger;
287
288 #[unsafe(method(setCollisionBitMask:))]
290 #[unsafe(method_family = none)]
291 pub unsafe fn setCollisionBitMask(&self, collision_bit_mask: NSUInteger);
292
293 #[unsafe(method(contactTestBitMask))]
294 #[unsafe(method_family = none)]
295 pub unsafe fn contactTestBitMask(&self) -> NSUInteger;
296
297 #[unsafe(method(setContactTestBitMask:))]
299 #[unsafe(method_family = none)]
300 pub unsafe fn setContactTestBitMask(&self, contact_test_bit_mask: NSUInteger);
301
302 #[unsafe(method(isAffectedByGravity))]
303 #[unsafe(method_family = none)]
304 pub unsafe fn isAffectedByGravity(&self) -> bool;
305
306 #[unsafe(method(setAffectedByGravity:))]
308 #[unsafe(method_family = none)]
309 pub unsafe fn setAffectedByGravity(&self, affected_by_gravity: bool);
310
311 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
312 #[unsafe(method(applyForce:impulse:))]
313 #[unsafe(method_family = none)]
314 pub unsafe fn applyForce_impulse(&self, direction: SCNVector3, impulse: bool);
315
316 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
317 #[unsafe(method(applyForce:atPosition:impulse:))]
318 #[unsafe(method_family = none)]
319 pub unsafe fn applyForce_atPosition_impulse(
320 &self,
321 direction: SCNVector3,
322 position: SCNVector3,
323 impulse: bool,
324 );
325
326 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
327 #[unsafe(method(applyTorque:impulse:))]
328 #[unsafe(method_family = none)]
329 pub unsafe fn applyTorque_impulse(&self, torque: SCNVector4, impulse: bool);
330
331 #[unsafe(method(clearAllForces))]
332 #[unsafe(method_family = none)]
333 pub unsafe fn clearAllForces(&self);
334
335 #[unsafe(method(resetTransform))]
336 #[unsafe(method_family = none)]
337 pub unsafe fn resetTransform(&self);
338
339 #[unsafe(method(setResting:))]
340 #[unsafe(method_family = none)]
341 pub unsafe fn setResting(&self, resting: bool);
342
343 #[cfg(feature = "objc2-core-foundation")]
344 #[unsafe(method(continuousCollisionDetectionThreshold))]
345 #[unsafe(method_family = none)]
346 pub unsafe fn continuousCollisionDetectionThreshold(&self) -> CGFloat;
347
348 #[cfg(feature = "objc2-core-foundation")]
349 #[unsafe(method(setContinuousCollisionDetectionThreshold:))]
351 #[unsafe(method_family = none)]
352 pub unsafe fn setContinuousCollisionDetectionThreshold(
353 &self,
354 continuous_collision_detection_threshold: CGFloat,
355 );
356
357 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
358 #[unsafe(method(centerOfMassOffset))]
359 #[unsafe(method_family = none)]
360 pub unsafe fn centerOfMassOffset(&self) -> SCNVector3;
361
362 #[cfg(all(feature = "SceneKitTypes", feature = "objc2-core-foundation"))]
363 #[unsafe(method(setCenterOfMassOffset:))]
365 #[unsafe(method_family = none)]
366 pub unsafe fn setCenterOfMassOffset(&self, center_of_mass_offset: SCNVector3);
367
368 #[cfg(feature = "objc2-core-foundation")]
369 #[unsafe(method(linearRestingThreshold))]
370 #[unsafe(method_family = none)]
371 pub unsafe fn linearRestingThreshold(&self) -> CGFloat;
372
373 #[cfg(feature = "objc2-core-foundation")]
374 #[unsafe(method(setLinearRestingThreshold:))]
376 #[unsafe(method_family = none)]
377 pub unsafe fn setLinearRestingThreshold(&self, linear_resting_threshold: CGFloat);
378
379 #[cfg(feature = "objc2-core-foundation")]
380 #[unsafe(method(angularRestingThreshold))]
381 #[unsafe(method_family = none)]
382 pub unsafe fn angularRestingThreshold(&self) -> CGFloat;
383
384 #[cfg(feature = "objc2-core-foundation")]
385 #[unsafe(method(setAngularRestingThreshold:))]
387 #[unsafe(method_family = none)]
388 pub unsafe fn setAngularRestingThreshold(&self, angular_resting_threshold: CGFloat);
389 );
390}
391
392impl SCNPhysicsBody {
394 extern_methods!(
395 #[unsafe(method(init))]
396 #[unsafe(method_family = init)]
397 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
398
399 #[unsafe(method(new))]
400 #[unsafe(method_family = new)]
401 pub unsafe fn new() -> Retained<Self>;
402 );
403}