Menu
Lumberyard
Developer Guide (Version 1.11)

Physics Lua Functions

CryLua is deprecated and will be removed in a future version of Lumberyard.

These functions are commonly used to register new explosion and crack shapes in the physics engine.

File location: Game/Scripts/physics.lua

  • Loaded from: Game/Scripts/main.lua

Physics.RegisterExplosionShape()

Registers a boolean carving shape for breakable objects in the physics engine.

Parameter Description
sGeometryFile Name of a boolean shape cgf file.
fSize Shape's characteristic size.
BreakId Breakability index (0-based) used to identify the breakable material.
fProbability Shape's relative probability; when several shapes with the same size appear as candidates for carving, these relative probabilities are used to select one.
sSplintersfile Name of a splinters cgf file, used for trees to add splinters at the breakage location.
fSplintersOffset Size offset for the splinters.
sSplintersCloudEffect Name of splinters particle fx; this effect is played when a splinters-based constraint breaks and splinters disappear.

Physics.RegisterExplosionCrack()

Registers a new explosion crack for breakable objects in the physics engine.

Parameter Description
sGeometryFile Name of a crack shape cgf file. This type of file must have three helpers to mark the corners, named "1","2" and "3".
BreakId Breakability index (0-based) used to identify the breakable material.