WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 10-11-2006, 05:04 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
viz.intersect() is different from physics collision callbacks. viz.intersect() returns collisions over a line. The physics callbacks are triggered when two objects collide. So it depends on what you need.

If you need line intersection tests, then viz.phys.intersectLine() will be much faster than viz.intersect. However, viz.phys.intersectLine() only returns results for objects that are part of the physics simulation. So you must define a collision volume for each node that should take part in the intersection test.

If you want know when two objects are colliding then you have two options. Use the physics collision callbacks. You must explicitly enable collision notifications for each object that you are interested in:
Code:
node.enable(viz.COLLIDE_NOTIFY)
Look at the duckcourt script for an example. The other option is to use the viz.phys.intersectNode command. This will return a list of all the nodes an object is colliding with. However, similar to the viz.phys.intersectLine() command, it only checks for collisions with objects that are part of the physics simulation.

In general it is more efficient to handle collision callbacks than to manually query for intersections every frame.
Reply With Quote
 

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 10:43 AM.


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