#1
|
|||
|
|||
Collision questions
Hi,
I'm currently using collision detection in my code, but I'd like to keep the intersecting object from passing though each other. I've read lots of posts but cannot get the right combination of physics, intersection and collision settings. Here's a sample of what I'm doing: # Some BasicsI would like both objects to NOT be subject to gravitational forces, but would like for the hand to stop when it contacts the object, and for the object to stay in place as well. Collisions are detected using the viz.phys.intersectNode(myHand) command Any help is appreciated!
__________________
David |
#2
|
|||
|
|||
From what you described it seems like you just need to disable dynamics on both objects. This will remove the affect of gravity. If you are manually checking for collisions using the viz.phys.intersectNode command, then move the hand to its previous position when it intersects with the object. Let me know if I misunderstood your question.
|
#3
|
|||
|
|||
The gravity isn't the problem, just the collisions. I would like for the hand object to stop when it intersects the cylinder object, instead of passing into it.
__________________
David |
#4
|
|||
|
|||
sorry, just a clarification...
I thought that the physics engine would have a method by which it would prevent two solid objects from occupying the same physical space, perhaps depending on some user-defined physical parameter such as density, hardness, etc.... From your reply I guess this isn't the case? Avoiding such overlaps must be done programatically?
__________________
David |
#5
|
|||
|
|||
Ok, it sounds like you want to have a dynamic object whose position is controlled by a tracker? If so, then you will need to use a physics spring. You tell the spring the desired position/rotation of the object and the physics engine will apply the necessary forces to get the object to that position, but it will stop if it collides with other objects in the environment. Search the docs for addSpring, it is documented under the Forces section of the Physics engine reference.
We use this technique for scripts where a person uses their hand to interactive with a physics environment. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Collision detection with haptic pen | mjabon | Vizard | 3 | 01-17-2008 06:35 PM |
linked object collision | pgagolf | Vizard | 1 | 04-19-2007 01:27 PM |
Collision with avatars and scene not working | JvdBosch | Vizard | 12 | 09-14-2006 06:01 PM |
collision events trigger | Eunice | Vizard | 1 | 01-03-2006 10:39 AM |
Walking avatars --> collision detection? | sjroorda | Vizard | 3 | 10-13-2005 04:47 AM |