Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNPhysicsBodyMBS class.

SCNPhysicsBodyMBS.AffectedByGravity as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value that determines whether the constant gravity of a scene accelerates the body.

If this property is true (the default), and the type of the body is SCNPhysicsBodyTypeDynamic, the gravity property of the scene’s physicsWorld object causes the body to accelerate.
If this property is false, the body is not affected by scene gravity. This option can be useful when making physics bodies whose behavior should be governed by SCNPhysicsFieldMBS objects instead of a constant global acceleration.
(Read and Write property)

SCNPhysicsBodyMBS.allowsResting as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value that specifies whether SceneKit can automatically mark the physics body at rest.

If true (the default), SceneKit keeps track of whether the body is moving or affected by forces, automatically setting its Resting property to true when it is “at rest.” The physics simulation runs faster when simulating fewer bodies, so treating a body as resting temporarily removes it from the simulation to improve performance.

SceneKit automatically returns a resting body to the simulation if another body collides with it, if you change its position or velocity, or if you apply a force to it. However, SceneKit uses a faster, less accurate simulation when deciding whether to change a body’s isResting property back to false. If testing your app reveals unexpected physics behaviors involving resting bodies, changing those bodies’ allowsResting property to false may improve simulation accuracy.
(Read and Write property)

SCNPhysicsBodyMBS.angularDamping as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A factor that reduces the body’s angular velocity.

This property simulates the effect of rotational friction on a body. A damping factor of 0.0 specifies no loss in angular velocity, and a damping factor of 1.0 prevents the body from rotating. The default damping factor is 0.1.
(Read and Write property)

SCNPhysicsBodyMBS.angularVelocity as SCNVector4MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A vector describing both the current rotation axis and rotational speed (in radians per second) of the physics body.

A positive rotational speed indicates counterclockwise rotation (when viewed from the direction the rotation axis points in).
SceneKit’s physics simulation determines the angular velocity (and corresponding change in rotation) of each dynamic physics body in the scene. You can also set a body’s velocity directly to set the physics simulation in motion or influence its behavior.

The effect of reading or setting this property’s value changes based on the current context:

  • When invoked within a rendering loop method (any of the events), or from any other code invoked from within such a method, reading the property returns the current result of the physics simulation, and setting the property immediately applies the change.
  • When invoked at any other time, reading the property returns the last value set for the property, and setting the property does not take effect until the next pass through the rendering loop.
(Read and Write property)

SCNPhysicsBodyMBS.angularVelocityFactor as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A multiplier affecting how SceneKit applies rotations computed by the physics simulation to the node containing the physics body.

Use this property to constrain or restrict the effect of physics simulation on the node containing the physics body. For example, you can force a body to rotate in only one axis by setting its angular velocity factor to {0.0, 1.0, 0.0}.
(Read and Write property)

SCNPhysicsBodyMBS.categoryBitMask as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A mask that defines which categories this physics body belongs to.

Every physics body in a scene can be assigned to one or more categories, each corresponding to a bit in the bit mask. You define the mask values used in your game. Use this property together with the physicsShape and contactTestBitMask properties to define which physics bodies interact with each other and when your game is notified of interactions.
The default value is SCNPhysicsCollisionCategoryStatic for static bodies and SCNPhysicsCollisionCategoryDefault for dynamic and kinematic bodies.
(Read and Write property)

SCNPhysicsBodyMBS.charge as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The electric charge of the body, in coulombs.

A body’s charge determines its behavior when affected by an electric or magnetic field. Use the SCNPhysicsFieldMBS class to add these fields to your scene. Bodies with positive or negative charges behave differently when affected by electric or magnetic fields. The default electric charge on a physics body is 0.0, causing it to be unaffected by electric and magnetic fields.

Note that you need not use realistic measurements for the bodies in your app—the effects of the physics simulation depend on the relative masses of different bodies, not the absolute values. You may use whatever values produce the behavior or gameplay you’re looking for as long as you use them consistently.
(Read and Write property)

SCNPhysicsBodyMBS.collisionBitMask as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A mask that defines which categories of physics bodies can collide with this physics body.

When two physics bodies contact each other, a collision may occur. SceneKit compares the body’s collision mask to the other body’s category mask by performing a bitwise AND operation. If the result is a nonzero value, then the body is affected by the collision. Each body independently chooses whether it wants to be affected by the other body. For example, you might choose to avoid collision calculations that would make negligible changes to a body’s velocity.

The default value is SCNPhysicsCollisionCategoryAll (a bit mask whose every bit is enabled), specifying that the body will collide with bodies of all other categories.
(Read and Write property)

SCNPhysicsBodyMBS.contactTestBitMask as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A mask that defines which categories of bodies cause intersection notifications with this physics body.

When two physics bodies overlap, a contact may occur. SceneKit compares the body’s contact mask to the other body’s category mask by performing a bitwise AND operation. If the result is a nonzero value, SceneKit creates an SCNPhysicsContactMBS object describing the contact and sends messages to the contactDelegate object of the scene’s physics world. For best performance, only set bits in the contact mask for interactions you are interested in.

For applications running in OS X v10.10 or iOS 8, this property’s value matches that of the collisionBitMask property—that is, SceneKit sends contact messages if and only if a collision occurs. For applications running in OS X v10.11 or iOS 9 or later, this property’s value defaults to zero and need not match the collision mask—that is, a pair of bodies generates contact messages whenever the bodies intersect, regardless of whether they collide or pass through one another.
(Read and Write property)

SCNPhysicsBodyMBS.damping as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A factor that reduces the body’s linear velocity.

This property simulates the effect of fluid friction or air resistance on a body. A damping factor of 0.0 specifies no loss in velocity, and a damping factor of 1.0 prevents the body from moving. The default damping factor is 0.1.
(Read and Write property)

SCNPhysicsBodyMBS.friction as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The body’s resistance to sliding motion.

This property simulates the roughness of the body’s surface. When two bodies are in contact and a force is applied that would cause them to slide against one another, the friction values for both bodies determine their resistance to motion. If both bodies’ friction value is 0.0, they slide freely against each other. If both bodies’ friction value is 1.0, they do not slide at all. The default friction is 0.5.
(Read and Write property)

SCNPhysicsBodyMBS.Handle as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Internal object reference.

(Read and Write property)

SCNPhysicsBodyMBS.isResting as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value that indicates whether the physics body is at rest.

This property’s default value is false, but SceneKit’s physics simulation may automatically set it to true if the body is not moving and not affected by any forces. A resting body does not participate in the simulation until another body collides with it or you change its position or velocity or apply a force to it.
(Read only property)

SCNPhysicsBodyMBS.mass as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The mass of the body, in kilograms.

The mass of a body affects its momentum and how it responds to forces. The default mass for dynamic bodies is 1.0. The default mass for static and kinematic bodies is 0.0, but these bodies are unaffected by mass.

Note that you need not use realistic measurements for the bodies in your app—the effects of the physics simulation depend on the relative masses of different bodies, not the absolute values. You may use whatever values produce the behavior or gameplay you’re looking for as long as you use them consistently.
(Read and Write property)

SCNPhysicsBodyMBS.momentOfInertia as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The body’s moment of inertia, expressed in the local coordinate system of the node that contains the body.

A body’s moment of inertia determines how it responds to torques (that is, forces with a rotational component). Each component of this vector is the moment of inertia for the corresponding principal axis (in the coordinate system containing the physics body). For example, if the x-component value of the moment vector is less than the y-component value, the body rotates more freely about its x-axis than its y-axis.

By default, SceneKit automatically determines the body’s moment of inertia based on its shape and mass. Use this property to define a custom moment of inertia (for example, to model an object of non-uniform density). Using a custom moment of inertia requires setting the usesDefaultMomentOfInertia property to false.
(Read and Write property)

SCNPhysicsBodyMBS.physicsShape as SCNPhysicsShapeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An object that defines the solid volume of the physics body for use in collision detection.

The physics simulation does not use a node’s visible geometry for collision detection—the simulation can run faster when using simple shapes, and it can also be useful to design your app or game using invisible collision shapes for some elements. Typically, you set a body’s physics shape to a bounding box or primitive shape that roughly matches its node’s visible content, but you can use a more detailed shape for more precise collision detection at a cost to performance.
For details on creating physics shapes, see SCNPhysicsShapeMBS.
(Read and Write property)

SCNPhysicsBodyMBS.restitution as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A factor that determines how much kinetic energy the body loses or gains in collisions.

This property simulates the “bounciness” of a body. A restitution of 1.0 means that the body loses no energy in a collision—for example, a ball dropped onto a flat surface will bounce back to the height it fell from. A restitution of 0.0 means the body does not bounce after a collision. A restitution of greater than 1.0 causes the body to gain energy in collisions. The default restitution is 0.5.
(Read and Write property)

SCNPhysicsBodyMBS.rollingFriction as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The body’s resistance to rolling motion.

This property simulates the traction between a rounded body and bodies it might roll against. A rolling friction of 0.0 (the default) means that a body induced to roll (for example, by being placed on an inclined surface) will continue to roll without slowing down unless otherwise acted upon, and a rolling friction of 1.0 prevents the body from rolling.
(Read and Write property)

SCNPhysicsBodyMBS.type as Integer

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A constant that determines how the physics body responds to forces and collisions.

(Read and Write property)

SCNPhysicsBodyMBS.usesDefaultMomentOfInertia as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A Boolean value that determines whether SceneKit automatically calculates the body’s moment of inertia or allows setting a custom value.

A body’s moment of inertia determines how it responds to torques (that is, forces with a rotational component).
If this property is true (the default), SceneKit automatically determines the body’s moment of inertia based on its shape and mass. Set this property to false and use the momentOfInertia property to define a custom moment of inertia (for example, to model an object of non-uniform density).
(Read and Write property)

SCNPhysicsBodyMBS.velocity as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A vector describing both the current speed (in meters per second) and direction of motion of the physics body.

SceneKit’s physics simulation determines the velocity (and corresponding change in position) of each dynamic physics body in the scene. You can also set a body’s velocity directly to set the physics simulation in motion or influence its behavior.
The effect of reading or setting this property’s value changes based on the current context:

  • When invoked within a rendering loop method (any of the events), or from any other code invoked from within such a method, reading the property returns the current result of the physics simulation, and setting the property immediately applies the change.
  • When invoked at any other time, reading the property returns the last value set for the property, and setting the property does not take effect until the next pass through the rendering loop.
(Read and Write property)

SCNPhysicsBodyMBS.velocityFactor as SCNVector3MBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
property SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
A multiplier affecting how SceneKit applies translations computed by the physics simulation to the node containing the physics body.

Use this property to constrain or restrict the effect of physics simulation on the node containing the physics body. For example, you can force a body to move in only two dimensions by setting its velocity factor to {1.0, 1.0, 0.0}.
(Read and Write property)

The items on this page are in the following plugins: MBS Mac64bit Plugin.


The biggest plugin in space...