here is an example showing what I meant with the collisions. doesn't matter what shapes you use
compound shapes was the only solution in this example
// Project: steeringTest
// Created: 2018-11-17
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "clowns test" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
#constant KEY_UP = 38
bottom=CreateObjectBox(10,1,10)
top=CreateObjectBox(9.0,.5,9.0)
SetObjectPosition(top,0,2.5,-2.5)
SetObjectColor(top,255,255,255,100)
SetObjectTransparency(top,1)
leftBound=CreateObjectBox(.25,2.5,10)
SetObjectPosition(leftBound,-5.1,.5,0)
rightBound=CreateObjectBox(.25,2.5,10)
SetObjectPosition(rightBound,5,.5,0)
bottomBound=CreateObjectBox(10,2.5,.25)
SetObjectPosition(bottomBound,0,.5,-5)
bound1=CreateObjectBox(.25,2,3)
SetObjectPosition(bound1,-4.0,.5,-3.5)
SetObjectColor(bound1,255,0,0,255)
bound2=CreateObjectBox(.25,2,3)
SetObjectPosition(bound2,-2.5,.5,-3.5)
SetObjectColor(bound2,255,0,0,255)
bound3=CreateObjectBox(.25,2,3)
SetObjectPosition(bound3,-1.0,.5,-3.5)
SetObjectColor(bound3,255,0,0,255)
bound4=CreateObjectBox(.25,2,3)
SetObjectPosition(bound4,.5,.5,-3.5)
SetObjectColor(bound4,255,0,0,255)
bound5=CreateObjectBox(.25,2,3)
SetObjectPosition(bound5,2.0,.5,-3.5)
SetObjectColor(bound5,255,0,0,255)
bound6=CreateObjectBox(.25,2,3)
SetObjectPosition(bound6,3.5,.5,-3.5)
SetObjectColor(bound6,255,0,0,255)
//FixObjectToObject(top,bottom)
FixObjectToObject(leftBound,bottom)
FixObjectToObject(rightBound,bottom)
FixObjectToObject(bottomBound,bottom)
FixObjectToObject(bound1,bottom)
FixObjectToObject(bound2,bottom)
FixObjectToObject(bound3,bottom)
FixObjectToObject(bound4,bottom)
FixObjectToObject(bound5,bottom)
FixObjectToObject(bound6,bottom)
Tube=CreateObjectCylinder(10,2.5,10)
SetObjectColor(tube,0,255,0,100)
SetObjectPosition(tube,0,4.5,7)
SetObjectTransparency(tube,1)
tubeBottom=CreateObjectBox(2,.25,8)
SetObjectPosition(tubeBottom,0,.5,6)
SetObjectColor(tubeBottom,0,0,255,0)
SetObjectTransparency(tubeBottom,1)
tubeLeft=CreateObjectBox(.25,2,8)
SetObjectPosition(tubeLeft,-1.0,.5,0)
SetObjectColor(tubeLeft,0,0,255,0)
SetObjectTransparency(tubeLeft,1)
tubeRight=CreateObjectBox(.25,2,8)
SetObjectPosition(tubeRight,1.0,.5,0)
SetObjectColor(tubeRight,0,0,255,0)
SetObjectTransparency(tubeRight,1)
RotateObjectLocalX(top,-20)
RotateObjectLocalX(bottom,-20)
RotateObjectLocalX(tube,70)
RotateObjectLocalX(tubeBottom,-20)
RotateObjectLocalX(tubeLeft,-20)
RotateObjectLocalX(tubeRight,-20)
Create3DPhysicsWorld(20)
Create3DPhysicsStaticBody(bottom):SetObjectShapeBox(bottom)
Create3DPhysicsStaticBody(top):SetObjectShapeBox(top)
Create3DPhysicsStaticBody(leftBound):SetObjectShapeBox(leftBound)
Create3DPhysicsStaticBody(rightBound):SetObjectShapeBox(rightBound)
Create3DPhysicsStaticBody(bottomBound):SetObjectShapeBox(bottomBound)
Create3DPhysicsStaticBody(bound1):SetObjectShapeBox(bound1)
Create3DPhysicsStaticBody(bound2):SetObjectShapeBox(bound2)
Create3DPhysicsStaticBody(bound3):SetObjectShapeBox(bound3)
Create3DPhysicsStaticBody(bound4):SetObjectShapeBox(bound4)
Create3DPhysicsStaticBody(bound5):SetObjectShapeBox(bound5)
Create3DPhysicsStaticBody(bound6):SetObjectShapeBox(bound6)
Create3DPhysicsKinematicBody(tubeBottom):SetObjectShapeBox(tubeBottom)
Create3DPhysicsKinematicBody(tubeLeft):SetObjectShapeBox(tubeLeft)
Create3DPhysicsKinematicBody(tubeRight):SetObjectShapeBox(tubeRight)
Set3DPhysicsGravity(0,-1,0)
SetObjectPosition(tubeBottom,0,3,6)
SetObjectPosition(tubeLeft,-1.0,3,6)
SetObjectPosition(tubeRight,1.0,3,6)
//FixObjectToObject(tubeLeft,tubeBottom)
//FixObjectToObject(tubeRight,tubeBottom)
direction=2
do
if direction=1
RotateObjectLocalZ(tube,-.5)
RotateObjectLocalY(tubeBottom,.5)
RotateObjectLocalY(tubeLeft,.5)
RotateObjectLocalY(tubeRight,.5)
if trunc(GetObjectAngleY(tubeBottom))=35 then direction=2
elseif direction=2
RotateObjectLocalZ(tube,.5)
RotateObjectLocalY(tubeBottom,-.5)
RotateObjectLocalY(tubeLeft,-.5)
RotateObjectLocalY(tubeRight,-.5)
if trunc(GetObjectAngleY(tubeBottom))=325 then direction=1
endif
if GetRawKeyPressed(32)
sphere=createObjectSphere(1.10,10,10)
SetObjectColor(sphere,255,0,0,255)
SetObjectPosition(sphere,0,4,7)
Create3DPhysicsDynamicBody(sphere)
//SetObject3DPhysicsLinearVelocity(sphere,0,-.5,.25, -.5 )
SetObjectShapeSphere(sphere)
SetObject3DPhysicsRestitution(sphere,.5)
endif
print(getObjectAngleX(tube))
Step3DPhysicsWorld()
sync()
loop
PS:a memblock collision system would be great and allow a player to move around in the world properly
fubar