I'm starting use 3d physics and have a strange problem. If i running game on android devise or PC it have not bug, but when running in AppGameKit player on my iPad is have strange bug
There is code.
// Project: T22
// Created: 2016-08-24
// show all errors
SetErrorMode(2)
Global player
global cub
// set window properties
SetWindowTitle( "T22" )
SetWindowSize( 1024, 768, 0 )
// set display properties
SetVirtualResolution( 1024, 768 )
SetOrientationAllowed( 1, 1, 1, 1 )
Create3DPhysicsWorld(1)
cub=CreateObjectBox(10,1,10)
SetObjectPosition(cub,0,-1,0)
Create3DPhysicsStaticBody(cub)
SetObjectShapeBox(cub)
sync()
player=CreateObjectBox(2,2,2)
characterOffsetVec = CreateVector3( 0.0, -0.1, 0.0 )
//This vector indicates the axis your model faces forward.
//For example if your model faces down the - Z axis use this vector.
objectOrientationVec = CreateVector3( 0, 1, 0 )
Create3DPhysicsCharacterController( player, 1, characterOffsetVec, objectOrientationVec, 1)
Set3DPhysicsCharacterControllerPosition(player,0,10,0)
Set3DPhysicsCharacterControllerStepHeight(player,0.1)
DeleteVector3( characterOffsetVec )
DeleteVector3( objectOrientationVec )
///===========================================//
addvirtualbutton( 2, 150,600,70 )
addvirtualbutton( 3, 50,550,70)
addvirtualbutton( 4, 250,550,70)
addvirtualbutton( 5, 800,550,70)
Addvirtualbutton(6,150,455,70)
//============================================//
do
moveplayer()
Step3DPhysicsWorld()
Sync()
Print( ScreenFPS() )
loop
function moveplayer()
WalkVelocity=5
Move3DPhysicsCharacterController( player, 0, WalkVelocity)
if GetRawKeyState( 87 ) or GetVirtualButtonState(6)=1
Move3DPhysicsCharacterController( player, 1, WalkVelocity )
move = 1
endif
if GetRawKeyState( 83 ) or GetVirtualButtonState(2)=1
Move3DPhysicsCharacterController( player, 2, WalkVelocity )
move = 1
endif
if GetRawKeyState( 65 ) or GetVirtualButtonState(3)=1
Move3DPhysicsCharacterController( player, 3, WalkVelocity )
move = 1
endif
if GetRawKeyState( 68 ) or GetVirtualButtonState(4)=1
Move3DPhysicsCharacterController( player, 4, WalkVelocity )
move = 1
endif
if GetRawKeyPressed( 32 ) or GetVirtualButtonState(5)=1
Jump3DPhysicsCharacterController(player)
endif
endfunction
And there is bug - my 3d object cube does not moving and his position inner big cube... I have not idea