sure...
Framework leadwerks.engine
Import "c:\program files\leadwerks engine sdk\bmx\framework\framework.bmx"
RegisterAbstractPath(AppDir)
GCSetMode(2)
Graphics(800, 600)
fw:TFramework = CreateFramework()
If Not fw RuntimeError "Failed to initialize engine."
PositionEntity(fw.Main.Camera, Vec3(0, 1, - 4))
light:TLight = CreateDirectionalLight()
RotateEntity(light, Vec3(45, 45, 0))
drum:TModel = LoadModel("abstract::oildrum.gmf")
SetBodyMass(drum, 1)
EntityType(drum, 1)
PositionEntity(drum, Vec3(0, 5, 0))
groundbody:TBody = CreateBodyBox(10, .1, 10)
EntityType(groundbody, 1)
groundmesh:TMesh = CreateCube(groundbody)
ScaleEntity(groundmesh, Vec3(10, .1, 10))
EntityColor(groundmesh, Vec4(.5, 0, .5, 1))
Collisions(1, 1, 1)
SetEntityCallback(drum, MyCallBack, ENTITYCALLBACK_COLLISION)
Repeat
If KeyHit(KEY_ESCAPE) Exit
If AppTerminate() Exit
If KeyHit(KEY_SPACE)
PositionEntity(drum, Vec3(Rand(0, 3), Rand(1, 8), Rand(0, 3)))
RotateEntity(drum, Vec3(Rand(0, 90), Rand(0, 90), Rand(0, 90)))
End If
fw.Update()
fw.Render()
Flip(1)
Forever
GCCollect()
End
Function MyCallBack(entity0:TEntity, entity1:TEntity, position:Tvec3, normal:Tvec3, force:Tvec3, speed:Float)
AppLog("Position: " + position.x + ", " + position.y + ", " + position.z)
AppLog("Normal: " + normal.x + ", " + normal.y + ", " + normal.z)
AppLog("Force: " + force.x + ", " + force.y + ", " + force.z)
AppLog("Speed: " + speed)
End Function