Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNPhysicsShapeMBS class.

SCNPhysicsShapeMBS.SCNPhysicsShapeKeepAsCompoundKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An option for selecting whether to create a group of independent shapes or combine them into a single shape.

The value for this key is a boolean value. The default value is true, specifying that SceneKit convert separate geometries into separate shapes and join the resulting shapes. If false, SceneKit creates a single shape approximating the combined form of the geometries.

SCNPhysicsShapeMBS.SCNPhysicsShapeOptionCollisionMargin as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Collision margin of the physics shape (as a number)

SCNPhysicsShapeMBS.SCNPhysicsShapeScaleKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An option for selecting the scale factor of the shape relative to the local coordinate space of the node containing it.

The value for this key is a SCNVector3MBS object , whose components describe the scale factor in each of the x-, y- and z-axis directions. The default value is the vector {1.0, 1.0, 1.0}, specifying no change of scale.
SceneKit’s physics simulation ignores the scale property of nodes containing physics bodies when simulating collisions. Instead, use this option to provide a scale factor when creating custom physics shapes. (If you create a physics body for a node without specifying a custom shape, SceneKit uses the node’s scale property to infer this scale factor at creation time.)

SCNPhysicsShapeMBS.SCNPhysicsShapeTypeBoundingBox as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The physics shape is the smallest box containing the geometry.

This option provides the lowest level of detail and the fastest simulation performance. Use it for generally box-shaped physics bodies or when constructing a compound physics shape.

SCNPhysicsShapeMBS.SCNPhysicsShapeTypeConcavePolyhedron as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The physics shape is a concave polyhedron closely following the surface of the geometry.

This option provides the highest level of detail, at a high cost to simulation performance. Use it only for irregularly shaped bodies where precise collision behavior is crucial to your app’s design.
This shape type may only be used for static physics bodies (that is, those whose type property is SCNPhysicsBodyTypeStatic).

SCNPhysicsShapeMBS.SCNPhysicsShapeTypeConvexHull as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
The physics shape is a convex polyhedron roughly enclosing the geometry.

This option provides a moderate level of detail and simulation performance. Use it for rounded or irregularly shaped physics bodies.

SCNPhysicsShapeMBS.SCNPhysicsShapeTypeKey as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An option for selecting the level of detail at which to create shapes from geometry.

The value for this key is one of the constants listed in Shape Types. The default type is SCNPhysicsShapeTypeConvexHull.

SCNPhysicsShapeMBS.shapeWithGeometry(geometry as SCNGeometryMBS, Options as Dictionary = nil) as SCNPhysicsShapeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a physics shape based on a geometry object.

geometry: A geometry object.
options: A dictionary of options affecting the level of detail of the physics shape, or nil to use default options. For applicable keys and their possible values, see Shape Creation Options Keys.

Returns a new physics shape object.

If you create a physics shape using one of the basic geometry classes (SCNBoxMBS, SCNSphereMBS, SCNPyramidMBS, SCNConeMBS, SCNCylinderMBS, or SCNCapsuleMBS), SceneKit uses an idealized form of that geometry for the physics shape instead of using the geometry’s vertex data to simulate collisions. For example, if you create a physics shape from an SCNSphere object, SceneKit simulates collisions for any object that passes within the sphere’s radius.

Because the idealized forms of simple geometries are computationally much simpler than the vertex data needed for displaying them, using basic geometries for physics shapes (or compound shapes created from basic geometries with the shapeWithShapes method) often provides the best balance between simulation accuracy and performance.

To use the newly created physics shape, create a physics body with the the bodyWithType method, or assign the shape to the physicsShape property of an existing body.

SCNPhysicsShapeMBS.shapeWithNode(node as SCNNodeMBS, Options as Dictionary = nil) as SCNPhysicsShapeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a physics shape from a node or hierarchy of nodes.

node: A node object. The node must contain an SCNGeometryMBS object in its geometry property or have one or more child (or descendant) nodes that contain geometry.
options: A dictionary of options affecting the level of detail of the physics shape, or nil to use default options. For applicable keys and their possible values, see Shape Creation Options Keys.

Returns a new physics shape object.

To use the newly created physics shape, create a physics body with the the bodyWithType method, or assign the shape to the physicsShape property of an existing body.

The node used to create the physics shape need not be the same as the node whose physics body you attach the shape to—or even be in the scene whose physics world you use the shape in. For example, you can create a physics body for a complex object by building a hierarchy of nodes containing simple geometries (using the SCNBoxMBS and SCNSphereMBS classes), and then creating a physics shape from those nodes. The resulting physics shape, a compound of bounding boxes or convex hulls, provides a rough approximation of the complex object without a high cost to simulation performance.

SCNPhysicsShapeMBS.shapeWithShapes(shapes() as SCNPhysicsShapeMBS, transforms() as SCNMatrix4MBS = nil) as SCNPhysicsShapeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
shared method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a new physics shape by combining others.

shapes: An array of SCNPhysicsShapeMBS objects.
transforms: An array SCNMatrix4MBS values, each of which is a transform for the physics shape at the corresponding index in the shapes parameter.

Returns a new physics shape object.

An individual physics shape is defined in its own local coordinate space. Therefore, to describe the positions and orientations of multiple shapes relative to one another, you must use coordinate transformations.

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


The biggest plugin in space...