WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-11-2006, 07:21 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
In this case collision callbacks won't work, so you need to manually call the intersect function yourself.
Reply With Quote
  #2  
Old 07-12-2007, 04:21 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Quote:
Originally Posted by farshizzo View Post
In this case collision callbacks won't work, so you need to manually call the intersect function yourself.
Why? Will the collision callbacks work while dragging something with the HD? That's what I'm trying to do....
Reply With Quote
  #3  
Old 07-13-2007, 11:39 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Yes, the callbacks will still work when you are dragging an object. Like I mentioned above, you will need to explicitly enable collision notifications on an object for a callback to be triggered.
Reply With Quote
  #4  
Old 07-16-2007, 02:27 PM
mjabon mjabon is offline
Member
 
Join Date: Jul 2007
Posts: 63
Quote:
Originally Posted by farshizzo View Post
Yes, the callbacks will still work when you are dragging an object. Like I mentioned above, you will need to explicitly enable collision notifications on an object for a callback to be triggered.
I have enabled collision on everything but it still never registers the callback. I did this:

made a bunch of screws and said this for each one:
Code:
screw.collideCapsule()
screw.enable(viz.COLLIDE_NOTIFY)
I also made a box:
Code:
currentBox.collideMesh()					#make a collision mesh so we know when screws hit it
currentBox.enable(viz.COLLIDE_NOTIFY)
Then I did this:

Code:
def onCollide(e):
	print "collision!"
	global allM1Screws, allM2Screws
	#Did a screw hit the box?
	if ((e.obj2 in allM1Screws) or (e.obj2 in allM2Screws)):
		#Change color of box
		e.obj1.color( random.choice( [viz.RED,viz.GREEN,viz.SKYBLUE,viz.YELLOW,viz.ORANGE,viz.PURPLE] ) )

        
viz.callback( viz.COLLIDE_BEGIN_EVENT, onCollide )


viz.collision(viz.ON)
I never enter the collision callback code

Last edited by mjabon; 07-16-2007 at 02:28 PM. Reason: forgot something
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 05:07 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC