lua.box2d.world.body
body=world:body(def)
Create a body in the world.
def contains the values that you can set in a b2BodyDef and must be a unique table as it will be retained.
All of these are optional so can be nil.
Vectors are a table containing values in the integer indexes. This may also be a fake table created by lua meta.
Values with _ are sub structs eg motionLocks_linearX is motionLocks.linearX
Booleans should be true or false
name is a string that should be 31 chars or less and is only used to
help with debugging.
type is a string and must be "static" or "kinematic" or "dynamic"
allowFastRotation
angularDamping
angularVelocity
enableSleep
motionLocks_linearX
motionLocks_linearY
motionLocks_angularZ
gravityScale
isAwake
isBullet
isEnabled
linearDamping
linearVelocity
name
position
rotation
sleepThreshold
type
lua.box2d.world.body.shape
shape=body:shape(def)
Create a shape in the body.
def contains the values that you can set in a b2ShapeDef and must be a unique table as it will be retained.
All of these are optional so can be nil.
Vectors are a table containing { x , y } values. This may also be a fake table created by lua meta.
Booleans should be true or false
Minor safety issue regarding filter bitmasks since lua(jit) uses doubles these bit masks should only use 52 bits not 64 so the integers can fit safely into a double. When using hex the top 3 nibbles should always be 0 like so 0x000fffffffffffff that is 13 Fs if you are counting.
density
enableContactEvents
enableHitEvents
enablePreSolveEvents
enableSensorEvents
filter
invokeContactCreation
isSensor
material_customColor
material_friction
material_restitution
material_rollingResistance
material_tangentSpeed
material_userMaterialId
updateBodyMass
if def.shape=="circle" then def also contains the values that you can set in a b2Circle
center
radius
if def.shape=="segment" then def also contains the values that you can set in a b2Segment
point1
point2
if def.shape=="capsule" then def also contains the values that you can set in a b2Capsule
center1
center2
radius
if def.shape=="box" then def also contains the values that you can set in a b2Polygon using b2MakeOffsetRoundedBox
halfWidth
halfHeight
center
rotation
radius