Adds a Collider to the world and attaches a CylinderShape.
Arguments
| Name | Type | Default | Description |
| x | number | 0 |
The x coordinate of the center of the cylinder, in meters.
|
| y | number | 0 |
The y coordinate of the center of the cylinder, in meters.
|
| z | number | 0 |
The z coordinate of the center of the cylinder, in meters.
|
| radius | number | 1 |
The radius of the cylinder, in meters.
|
| length | number | 1 |
The length of the cylinder, in meters.
|
Returns
| Name | Type | Description |
| collider | Collider |
The new Collider.
|
Arguments
| Name | Type | Default | Description |
| position | Vec3 | |
The position of the center of the cylinder, in meters.
|
| radius | number | 1 |
The radius of the cylinder, in meters.
|
| length | number | 1 |
The length of the cylinder, in meters.
|
Returns
| Name | Type | Description |
| collider | Collider |
The new Collider.
|
This will throw an error if there are too many colliders in the world. The limit defaults to 16384 and can be changed in lovr.physics.newWorld.
The length of the cylinder goes along its local Z axis.
See also