Adds a Collider to the world and attaches a BoxShape
.
Arguments
Name | Type | Default | Description |
x | number | 0 |
The x coordinate of the center of the box, in meters.
|
y | number | 0 |
The y coordinate of the center of the box, in meters.
|
z | number | 0 |
The z coordinate of the center of the box, in meters.
|
width | number | 1 |
The width of the box, in meters.
|
height | number | width |
The height of the box, in meters.
|
depth | number | width |
The depth of the box, in meters.
|
Returns
Name | Type | Description |
collider | Collider |
The new Collider.
|
Arguments
Name | Type | Description |
position | Vec3 |
The position of the center of the box, in meters.
|
size | Vec3 |
The size of the box, 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
.
See also