class
Physics
Provides global physics settings, factory methods for physics objects and scene queries.
Public
Constructors
Physics
Methods
~Physics
ToggleCollision
Enables or disables collision between two layers.
Each physics object can be assigned a specific layer, and here you can determine which layers can interact with each other.
IsCollisionEnabled
Checks if two collision layers are allowed to interact.
staticInstance
Returns a reference to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticInstancePtr
Returns a pointer to the module instance.
Module has to have been started up first otherwise an exception will be thrown.
staticShutDown
Shuts down this module and frees any resources it is using.
staticIsStarted
Query if the module has been started.
Internal
Methods
CreateMaterial
Creates a new physics material.
- staticFriction
- Controls friction when two in-contact objects are not moving lateral to each other (for example how difficult is to get an object moving from a static state while it is in contact other object(s)).
- dynamicFriction
- Sets dynamic friction of the material. Controls friction when two in-contact objects are moving lateral to each other (for example how quickly does an object slow down when sliding along another object).
- restitution
- Controls "bounciness" of an object during a collision. Value of 1 means the collision is elastic, and value of 0 means the value is inelastic. Must be in [0, 1] range.
CreateMesh
Creates a physics mesh implementation.
See PhysicsMesh::Create.
CreatePhysicsScene
Creates an object representing the physics scene.
Must be manually released via destroyPhysicsScene().
CreateColliderShape
Creates a new empty collider shape.
Note you must set the shape information after creation.
CreateColliderImplementation
Creates an object that provides low-level functionality required for a Collider.
CreateRigidbodyImplementation
Creates an object that provides low-level functionality required for a Rigidbody.
RayCast
Checks does the ray hit the provided collider shape.
- origin
- Origin of the ray to check.
- unitDirection
- Unit direction of the ray to check.
- colliderShape
- Collider shape to check for hit.
- hit
- Information about the hit. Valid only if the method returns true.
- maximumDistance
- Maximum distance from the ray origin to search for hits.
Returns: True if the ray has hit the collider.
RayCast
Checks does the ray hit any of the shapes on the provided collider.
- origin
- Origin of the ray to check.
- unitDirection
- Unit direction of the ray to check.
- collider
- Collider to check for hit.
- hit
- Information about the hit. Valid only if the method returns true.
- maximumDistance
- Maximum distance from the ray origin to search for hits.
Returns: True if the ray has hit the collider.
Protected
Methods
~Module<T>
OnStartUp
Override if you want your module to be notified once it has been constructed and started.
OnShutDown
Override if you want your module to be notified just before it is deleted.
staticInstanceInternal
Returns a singleton instance of this module.