Platforms to show: All Mac Windows Linux Cross-Platform

Back to SCNPhysicsVehicleMBS class.

SCNPhysicsVehicleMBS.applyBrakingForce(value as double, index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Applies a force between the specified wheel and the ground under the vehicle.

value: The magnitude of the torque, in newton-meters.
index: The index of the wheel applying the force.

Applying a braking force causes the wheel to slow down regardless of the direction it’s currently spinning in.

As with all physical quantities in SceneKit, you need not use realistic force measurements in your app—the effects of the physics simulation depend on the relative differences between forces, not on their absolute values. You may use whatever values produce the behavior or gameplay you’re looking for as long as you use them consistently.

Calling this method applies a braking force for one step (or frame) of the physics simulation. To continuously decelerate a vehicle, call this method again on subequent simulation steps (for example, from your scene renderer delegate’s renderer method) until the vehicle stops or reaches your desired speed.

SCNPhysicsVehicleMBS.applyEngineForce(value as double, index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Applies a force between the specified wheel and the ground under the vehicle.

value: The magnitude of the force, in newtons.
index: The index of the wheel applying the force.

Applying a positive force turns the wheel in a direction that would move the vehicle forward; applying a negative force moves the vehicle in reverse.

As with all physical quantities in SceneKit, you need not use realistic force measurements in your app—the effects of the physics simulation depend on the relative differences between forces, not on their absolute values. You may use whatever values produce the behavior or gameplay you’re looking for as long as you use them consistently.

Calling this method applies a force for one step (or frame) of the physics simulation. To continuously accelerate a vehicle, call this method again on subequent simulation steps (for example, from your scene renderer delegate’s renderer method) until the vehicle reaches your desired speed.

SCNPhysicsVehicleMBS.Constructor(chassisBody as SCNPhysicsBodyMBS, wheels() as SCNPhysicsVehicleWheelMBS)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Creates a vehicle behavior.

chassisBody: A physics body to serve as the vehicle’s chassis.
wheels: An array of SCNPhysicsVehicleWheel objects representing the vehicle’s wheels. A vehicle must have at least one wheel.

Returns a new vehicle behavior.

Each object in the wheels array associates a node with the wheel to serve as its visual representation and defines properties for the wheel’s physical characteristics. Each wheel object must reference a unique node, which should be a child of the node containing the physics body used for the vehicle’s chassis. Typically, you load a node hierarchy representing the vehicle and all of its wheels from a scene file and then designate which nodes serve as the body and wheels.

For a behavior to take effect, you must add it to the physics simulation by calling the addBehavior: method on your scene’s SCNPhysicsWorldMBS object.

SCNPhysicsVehicleMBS.setSteeringAngle(value as double, index as Integer)

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
Pivots the specified wheel around its steering axis.

value: The angle to set the wheel at relative to its steering axis, in radians.
index: The index, in the vehicle’s wheels array, of the wheel to be pivoted.

Steering angles are relative to the wheel’s steeringAxis vector. With the default steering axis of {0.0, -1.0, 0.0}, a steering angle of 0.0 represents neutral steering, positive values steer the vehicle to the right, and negative values steer to the left.

SCNPhysicsVehicleMBS.wheels as SCNPhysicsVehicleWheelMBS()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method SceneKit MBS Mac64bit Plugin 20.2 ✅ Yes ❌ No ❌ No ✅ Yes Desktop & iOS
An array of SCNPhysicsVehicleWheelMBS objects representing the vehicle’s wheels.

You can dynamically change the suspension and traction properties of a wheel connected to the vehicle by using the corresponding SCNPhysicsVehicleWheelMBS object.

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


The biggest plugin in space...