I've done wrong?
RegisterAbstractPath("")
require("Scripts/constants/engine_const")
Graphics(800,600)
fw = CreateWorld()
--create camera
cam=CreateCamera()
CameraClearColor(cam,Vec4(0,0,1,1))
MoveEntity(cam,Vec3(0,0.85,-2))
buffer=CreateBuffer(800,600,BUFFER_COLOR)
--create light
light=CreateSpotLight(8)
RotateEntity(light,Vec3(20,45,0))
EntityColor(light,Vec4(2,2,2,1))
MoveEntity(light,Vec3(0,0,-5))
SetShadowmapSize(light,1024)
-- create body
body = CreateBodyBox(1,1,1)
body:SetMass(1)
body:SetPosition(Vec3(0,2,2))
EntityType(body,1)
--create ground
ground = CreateBodyBox(10,0.1,10)
PositionEntity(ground,Vec3(0,-1,0))
EntityType(ground,1)
Collisions(1,1,1)
DebugPhysics (1)
while(KeyHit(KEY_ESCAPE)) ==0 do
fw:Update()
SetBuffer(buffer)
fw:Render()
SetBuffer(BackBuffer())
RenderLights(buffer)
Flip(0)
end
why body does not fall?