This is a bit better but it is still not detecting a collision on every impact any ideas anyone mabey I need to play around with TOK_RefreshPhysic(.1,2)?
Include "Inc_EasyTOK.bb"
Const Balls=1,Maps=2
Graphics3D 800,600
SetBuffer BackBuffer()
Cam=CreateCamera()
PositionEntity Cam,0,0,-40
Global Light=CreateLight()
PositionEntity Light,0,50,-10
TOK_InitWorld(0,-.6,0,1000,100)
Ball1=CreateSphere()
EntityType(ball1,Balls)
TOK_CreateRBSphere("Ball",Ball1,0,0,0,0,0,0,1,.2,"",255,255,255,1,0)
FreeEntity Ball1
Global Map=CreateCube()
ScaleEntity Map,2,2,2
EntityType Map,Maps
EntityColor Map,255,0,0
PositionEntity Map,0,-20,0
TOK_CreateTokCollider(Map,"",Map,Maps,0); Set the collision type to maps
Collisions Balls,Maps,2,2
Repeat
UpdateWorld()
TOK_RefreshPhysic(.1,2)
TOK_RefreshEasyTOK()
RenderWorld()
If EntityCollided(TOK_GetRBMesh("Ball"),Maps)
TOK_ApplyImpulse("ball",0,.5,0)
EndIf
Flip
Until KeyHit(1)
TOK_FreePhysic()
End
Include "Inc_EasyTOK.bb"
Const Balls=1,Maps=2
Graphics3D 800,600
SetBuffer BackBuffer()
Cam=CreateCamera()
PositionEntity Cam,0,0,-40
Global Light=CreateLight()
PositionEntity Light,0,50,-10
TOK_InitWorld(0,-.6,0,1000,100)
Ball1=CreateSphere()
EntityType(ball1,Balls)
TOK_CreateRBSphere("Ball",Ball1,0,0,0,0,0,0,1,.2,"",255,255,255,1,0)
FreeEntity Ball1
Global Map=CreateCube()
ScaleEntity Map,2,2,2
EntityType Map,Maps
EntityColor Map,255,0,0
PositionEntity Map,0,-20,0
TOK_CreateTokCollider(Map,"",Map,Maps,0); Set the collision type to maps
Collisions Balls,Maps,2,2
Repeat
UpdateWorld()
TOK_RefreshPhysic(.1,2)
TOK_RefreshEasyTOK()
RenderWorld()
If EntityCollided(TOK_GetRBMesh("Ball"),Maps)
TOK_ApplyImpulse("ball",0,.5,0)
EndIf
Flip
Until KeyHit(1)
TOK_FreePhysic()
End