WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rating: Thread Rating: 4 votes, 5.00 average. Display Modes
  #1  
Old 09-10-2008, 05:27 PM
rubberpimple rubberpimple is offline
Member
 
Join Date: Jan 2008
Location: Phoenix, Arizona
Posts: 16
Collision with child nodes

Hi,

A previous thread went as follows:

Initial Question:
is it possible to detect collision between specific bone of the 5DT glove's hand model and some other objects ? When I try to apply collision mesh directly on a specific bone, it says that VizBone object has no attribute collideMesh. Is there some other way, then ?

Farshizzo, your reply was:
You cannot perform collision on bones, only the entire avatar mesh. Are you trying to detect when the fingers touch something? If so, you can create an empty group node with a collision shape similar to the finger, then before performing collision detection you can manually place the group node at the current finger bone location. Either way, if you can describe what you are trying to accomplish I can provide you with some sample code.

I tried to reply to the post, but it doesn't seem to have bee noticed. I repeated my original question below:
I'd love to see the code for this. I'm trying to do collision detection between a hand model and specific child nodes of a parent object. Did I read somewhere that I can only do collision detection on nodes that are children of viz.WORLD?

Thanks!
__________________
David
Reply With Quote
  #2  
Old 09-11-2008, 05:40 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Thanks for the post. Sorry, we have not had time to answer yet. We will respond tomorrow or early next week.
Reply With Quote
  #3  
Old 09-12-2008, 04:17 PM
rubberpimple rubberpimple is offline
Member
 
Join Date: Jan 2008
Location: Phoenix, Arizona
Posts: 16
Cool...looking forward to it!
__________________
David
Reply With Quote
  #4  
Old 09-15-2008, 05:36 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
In response to collision detection on child nodes this should not be a problem. As long as you have your callback function for collision events and you have enabled collision notification on the node that will generate the event <VizNode>.enable( viz.COLLIDE_NOTIFY ) it should work.

As for the code, we have not forgotten your request. I don't think I can help with that but when Farshizzo has some time he will be able to help you out.
Reply With Quote
  #5  
Old 09-17-2008, 05:27 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I don't have a fully working example to show you, but the concept is very simple. First create an empty group node and define a collision shape that matches the bone you are interested in:
Code:
boneCollide = viz.addGroup()
boneCollide.collideBox([0.1,0.1,0.2])
Then when you want to check for collisions with the bone, just get the position of the bone in world coordinates and update the boneCollide object with it:
Code:
boneCollide.setPosition(bone.getPosition(viz.AVATAR_WORLD))
boneCollide.setQuat(bone.getQuat(viz.AVATAR_WORLD))

#Perform collision detection
nodes = viz.phys.intersectNode(boneCollide)
for n in nodes:
    print 'bone collided with',n
Does this help you?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
real time collision on animation path whj Vizard 10 10-06-2008 05:38 PM
Collision detection with haptic pen mjabon Vizard 3 01-17-2008 07:35 PM
Pivot points for child objects in Vizard with 3ds Max Gladsomebeast Vizard 0 09-19-2006 12:21 PM
Child Object Rotation paulgoldberg Vizard 5 09-05-2006 12:33 PM
collision events trigger Eunice Vizard 1 01-03-2006 11:39 AM


All times are GMT -7. The time now is 02:03 PM.


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