How can I get a rotating object to 'push' a ball?
The object in question is a scaled cube.
Try the example below.
USE THE MOUSE TO CONTROL THE BALL
If you follow the rotating object around then the collisions work .. that is, the ball is blocked.
However, if you go against the rotation then the ball can pass through.
What I want to do is get the object to push or rebound the ball away.
@MASTERBEAKER > This is the problem I'm having regarding the email I sent you.
Any help / scary maths stuff would be appreciated.
Thanks coders.
NOTE: If you keep the ball still and close to the block then NO collisions are reported.
The object in question is a scaled cube.
Try the example below.
USE THE MOUSE TO CONTROL THE BALL
If you follow the rotating object around then the collisions work .. that is, the ball is blocked.
However, if you go against the rotation then the ball can pass through.
What I want to do is get the object to push or rebound the ball away.
@MASTERBEAKER > This is the problem I'm having regarding the email I sent you.
Any help / scary maths stuff would be appreciated.
Thanks coders.
NOTE: If you keep the ball still and close to the block then NO collisions are reported.
; colliding with rotating block ; Following rotation of block stops ball as expected ; Going against rotation allows ball to pass through * ; * How do I prevent this and get the block to 'push' the ball? ; (Syntax Error) ; display Graphics3D 640,480,0,2 HidePointer ; entitys cam=CreateCamera() : MoveEntity cam,0,5,-9 light=CreateLight() block=CreateCube() : MoveEntity block,-2,0,0 : EntityColor block,200,100,100 ScaleEntity block,0.4,1,3 ball=CreateSphere() : MoveEntity ball,2.5,0,0 : EntityColor ball,100,200,200 PointEntity cam,ball ; collisions Const cBALL=1 , cBLOCK=2 EntityType ball,cBALL : EntityRadius ball,1 EntityType block,cBLOCK Collisions cBALL,cBLOCK,2,1 ; init MoveMouse 320,240 : FlushMouse vx#=0 : vz#=0 ; MAINLOOP Repeat ; mouse control vx=vx+Float(MouseXSpeed())/96 vz=vz-Float(MouseYSpeed())/96 vx=vx/1.1 : vz=vz/1.1 MoveMouse 320,240 MoveEntity ball,vx,0,vz TurnEntity block,0,0.05,0 UpdateWorld : RenderWorld Text 10,10,"Collided with = "+EntityCollided(block,cBALL) Text 10,30,"BLOCK handle = "+block Text 10,50," BALL handle = "+ball Text 320,450,"MOVE BALL WITH MOUSE",1 Flip Until KeyHit(1) End