WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Remove link and have object drop/collide? (https://forum.worldviz.com/showthread.php?t=2549)

cgibb 02-28-2010 05:33 PM

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!

dwaik 03-01-2010 12:40 AM

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

cgibb 03-01-2010 06:12 AM

Quote:

Originally Posted by dwaik (Post 9449)
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.

Jeff 03-01-2010 09:54 AM

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.

cgibb 03-01-2010 08:52 PM

Quote:

Originally Posted by Jeff (Post 9459)
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.

Jeff 03-02-2010 03:42 PM

Have you tried applying a collide mesh to the room model?
Code:

room.collideMesh()
room.disable( viz.DYNAMICS )


cgibb 03-02-2010 04:18 PM

Quote:

Originally Posted by Jeff (Post 9474)
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!


All times are GMT -7. The time now is 08:19 PM.

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