-
Notifications
You must be signed in to change notification settings - Fork 9
RigidBodyComponent
The RigidBodyComponent it's basically a collider object placed in the world. The RigidBody can be built on 3 different shapes:
- BoxRigidBodyComponent
- CapsuleRigidBodyComponent
- SphereRigidBodyComponent
The RigidBody can also be of three types:
- static_rigidbody: it's a static collider that must be moved manually. Has "infinite mass and zero velocity".
- kinematic_rigidbody: its velocity can be changed manually but its position is computed by the physics engine. Remember that it has "infinite mass".
- dynamic_rigidbody: has non-zero mass, non-zero velocity determined by forces and its position is determined by the physics engine.
You can edit a RigidBody to make it act differently in the world. Mostly important, you can edit: it's friction coefficient and it's bounciness.
The most important part of the RigidBody is that you can apply a force to it. You can use:
apply_force_to_center(...)
and apply_torqe(...)
to apply a force on the RigidBody to make it move.
Remember that the dynamic RigidBody it's not conneted to a mesh by default. If you want to make an object move (for example the ball) you must call attach_to_mesh(...)
. This will update the mesh position with the physics engine result.
This documentation describe only a small part of the engine, since it's not made to be used by a large amount of people.
If you would like to know more about a part of the engine, how to do something, or if a part of the documentation is not correct/out of date, please open an issue and tell me.
Thank you for reading the ScrapEngine Wiki!
Getting started
Engine structure
Using the Engine