PhysicsForceComponent

@MainThread
class PhysicsForceComponent : Component

A Component that applies constant force or torque (in local coordinate space) to drive physics-based motion on an entity. Force is measured in newtons (N). Torque is measured in newton-meters (N·m).

To work properly, the entity must also have a CollisionComponent and a RigidBodyComponent with its rigidBodyMode set to RigidBodyMode.DYNAMIC.

Constructors

Link copied to clipboard
constructor()

Default constructor.

constructor(force: Vector3, torque: Vector3)

Creates a physics force component with the specified force and torque.

Properties

Link copied to clipboard

The force applied in the local coordinate to control the motion, measured in Newtons (N). The default value is Vector3(0F, 0F, 0F).

Link copied to clipboard

The torque applied in the local coordinate to control the motion, measured in Newton-meters (N·m). The default value is Vector3(0f, 0f, 0f).

Functions

Link copied to clipboard
open override fun clone(): Component

Creates and returns a copy of this Component instance.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String