View Single Post
  #2  
Old 04-15-2005, 05:46 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi,

The collidingwith function does not take object hierarchies into account. You can use a temporary work around for this though. Add an empty object to the world. To check for collisions update the empty objects position with the balls position and then call collidingwith on the empty object. Here's some sample code to explain it better:
Code:
#Add a fake ball to the world (This will be an empty object)
fakeBall = viz.add(viz.GROUP)
#Enable collisions on the fake ball
fakeBall .collidesphere(0.25)

#Before you call collidingwith do the following
fakeBall.translate(ball.get(viz.POSITION,viz.ABSOLUTE_WORLD))
fakeBall.rotatequat(ball.get(viz.QUAT,viz.ABSOLUTE_WORLD))
Reply With Quote