Thread: stop physic
View Single Post
  #1  
Old 03-10-2009, 01:39 AM
nlfrnassimi nlfrnassimi is offline
Member
 
Join Date: Feb 2009
Posts: 37
stop physic

Hi,

I have created a simple bouncing ball. I want it to stop when it reaches a particular point. But I don't know how. I'll appreciate any help.

Here is my code for ball:


import viz

viz.go()

viz.phys.enable()

ground = viz.add('tut_ground.wrl') # Add ground
ground.collidePlane() # Make collideable plane
ball = viz.add('ball.wrl',pos=[0,.2,6]) # Add a ball
ballPhys = ball.collideSphere(bounce = 2) # Enable physics on ball
ball.applyForce([0,.3,.2],0.5) # Apply small force for half a second
Reply With Quote