MeshShape

Edit

A type of Shape that can be used for triangle meshes.

Constructors

lovr.physics.newMeshShapeCreate a new MeshShape.
World:newMeshColliderAdd a Collider with a MeshShape to the World.

Methods

Shape:containsPointCheck if a point is inside the shape.
Shape:destroyDestroy the Shape.
Shape:getAABBGet the Shape's axis aligned bounding box.
Shape:getCenterOfMassGet the center of mass of the Shape.
Shape:getColliderGet the Collider the Shape is attached to.
Shape:getDensityGet the density of the Shape.
Shape:getInertiaGet the inertia of the Shape.
Shape:getMassGet the mass of the Shape.
Shape:getOffsetGet the local offset of the Shape.
Shape:getOrientationGet the orientation of the Shape.
Shape:getPoseGet the pose of the Shape.
Shape:getPositionGet the position of the Shape.
Shape:getTypeGet the type of the Shape.
Shape:getUserDataGet the Lua value associated with the Shape.
Shape:getVolumeGet the volume of the Shape.
Shape:isDestroyedCheck if the Shape is destroyed.
Shape:raycastCast a ray against the shape.
Shape:setDensitySet the density of the Shape.
Shape:setOffsetSet the local offset of the Shape.
Shape:setUserDataAssociate a Lua value with the Shape.
MeshShape:getScaleGet the scale the MeshShape was created with.

Notes

If a Collider contains a MeshShape, it will be forced to become kinematic. ConvexShape can be used instead for dynamic mesh colliders.

See also