WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-28-2010, 06:33 PM
cgibb cgibb is offline
Member
 
Join Date: Apr 2009
Posts: 14
Remove link and have object drop/collide?

Hello,

Is there an easy way to remove a link, but then have the object drop and collide with other objects?

For example: a user picks up an object, a link is created with viz.grab(foo,bar), and when they right click, the link is removed with link.remove().

Is it possible for that object to fall to the ground/collide with another object (table, floor, etc.) without manually setting the position? Currently, it floats in mid-air.

Thanks in advance!
Reply With Quote
  #2  
Old 03-01-2010, 01:40 AM
dwaik dwaik is offline
Member
 
Join Date: Feb 2010
Posts: 26
Hello;
am facing that problem too and i have nother one maybe you could help me,
i need to know the object under the mouse, so that i can grab it, any idea?
thanks in advance
Reply With Quote
  #3  
Old 03-01-2010, 07:12 AM
cgibb cgibb is offline
Member
 
Join Date: Apr 2009
Posts: 14
Quote:
Originally Posted by dwaik View Post
Hello;
am facing that problem too and i have nother one maybe you could help me,
i need to know the object under the mouse, so that i can grab it, any idea?
thanks in advance
Please don't hijack this thread. Thanks.
Reply With Quote
  #4  
Old 03-01-2010, 10:54 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
You will need to enable the physics engine in order to have collisions between objects and the effects of gravity. The Vizard docs explain how to add physics.
Reply With Quote
  #5  
Old 03-01-2010, 09:52 PM
cgibb cgibb is offline
Member
 
Join Date: Apr 2009
Posts: 14
Quote:
Originally Posted by Jeff View Post
You will need to enable the physics engine in order to have collisions between objects and the effects of gravity. The Vizard docs explain how to add physics.
Thanks, Jeff. That worked when an object hits the ground, but what about other objects in my base model? For example, if I have a room with a built in counter, is there a way for the 'dropped' object to collide with that?

Here's a bit of what I'm working with:
Code:
viz.phys.enable()
room.collidePlane()

if link and checkobject(object) == 'foobar':
	foobar.collideBox(1,2.5,1) #hits the ground
	link.remove()
The object (foobar) in this situation will drop right through the counter to the ground.

Thanks again.
Reply With Quote
  #6  
Old 03-02-2010, 04:42 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Have you tried applying a collide mesh to the room model?
Code:
room.collideMesh()
room.disable( viz.DYNAMICS )
Reply With Quote
  #7  
Old 03-02-2010, 05:18 PM
cgibb cgibb is offline
Member
 
Join Date: Apr 2009
Posts: 14
Quote:
Originally Posted by Jeff View Post
Have you tried applying a collide mesh to the room model?
Code:
room.collideMesh()
room.disable( viz.DYNAMICS )

This worked great in combination with collideBox()

Thanks again!
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:20 AM.


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