World:newMeshCollider

Adds a new Collider to the World with a MeshShape already attached.


collider = World:newMeshCollider(vertices, indices)

Arguments

NameTypeDescription
verticestable The table of vertices in the mesh. Each vertex is a table with 3 numbers.
indicestable A table of triangle indices representing how the vertices are connected in the Mesh.

Returns

NameTypeDescription
colliderCollider The new Collider.

collider = World:newMeshCollider(model)

Arguments

NameTypeDescription
modelModel A Model to use for the mesh data. Similar to calling Model:getTriangles and passing it to this function, but has better performance.

Returns

NameTypeDescription
colliderCollider The new Collider.

See also