WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 10-04-2011, 11:54 AM
AtomicRaiden AtomicRaiden is offline
Member
 
Join Date: Oct 2011
Posts: 3
Main view collision problem

Hey guys,

I am working on a school project and I am trying to create door animations. I put a cube around a door for collision purposes for a simple collision detection. I have the cube set with .enable( viz.COLLIDE_NOTIFY ) and a callback for collisions event. The problem I am having is that the walls are also throwing a collide event even though I only have the door collision cube with the collide event. I was wondering is there was work around to only have the door collision throw the event and nothing else?
Reply With Quote
  #2  
Old 10-04-2011, 02:50 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
It sounds like you also have collision shapes applied to the walls. In that case you can check to see which objects are involved in the collision. These are passed with the event object to the callback function as the attributes obj1 (node that generated the event) and obj2 (node it collided with). If obj2 is the door then you can animate it opening, otherwise you can ignore the collision.
Reply With Quote
  #3  
Old 10-05-2011, 06:30 PM
AtomicRaiden AtomicRaiden is offline
Member
 
Join Date: Oct 2011
Posts: 3
I did not apply any collision shapes to any .IVE I imported. I am currently only using the geometry of the wall itself as collision. I simply imported the .IVE's and placed them in the world with no additional functions added to the objects. The only object I modified was the door collision box. I tried to print out object1 and object2 but only object1 is being collided with during the collisions. When I try to print out object2 an error is thrown. I appreciate your info provided but is there something else I am missing?
Reply With Quote
  #4  
Old 10-06-2011, 09:56 AM
AtomicRaiden AtomicRaiden is offline
Member
 
Join Date: Oct 2011
Posts: 3
When I import my .IVE's I am not applying any collision shapes. I am simply using the geometry of the walls and other objects as the collision. I didn't add any modifiers to the objects I imported expect for the door collision box. Additionally in Vizard 4.0 I noticed that the collision callback event does not have obj1 or obj2 anymore and only has "object". Is there another way to determine whether the door collision is being collided when the collision event gets called? Thanks for given info and anymore provided in the future.
Reply With Quote
  #5  
Old 10-06-2011, 11:48 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Sorry, I didn't pay attention to the subject here. In my last post I was referring to collisions regarding the physics engine. When handling viewpoint collision, the event object passed to the callback function has information about the node collided with, the point of contact and the name of the subnode:

http://docs.worldviz.com/vizard/Even...OLLISION_EVENT

The viz.COLLIDE_NOTIFY flag you mentioned is related to collision events with the physics engine, not viewpoint collision. When you enable viewpoint collision all objects will automatically be included. You can disable viewpoint collision for a specific object:
Code:
object.disable(viz.INTERSECTION)
If you have added two different objects, a room and a cube for the door you can check to see if the object is the cube:
Code:
def onCollision(info):
	if info.object == cube:
		#open door
	
viz.callback(viz.COLLISION_EVENT, onCollision)
Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Collision problem Dave Vizard 2 09-16-2010 04:25 AM
Freeform view on an animated object problem jaylocco Vizard 2 06-08-2009 08:09 PM
view problem nlfrnassimi Vizard 3 03-11-2009 08:33 PM
problem with stereo mode shivanangel Vizard 3 10-17-2006 09:58 AM
problem with collision detection paulpars Vizard 6 06-09-2006 06:03 PM


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


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