PDA

View Full Version : Remove link and have object drop/collide?


cgibb
02-28-2010, 05:33 PM
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
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
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:

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?
room.collideMesh()
room.disable( viz.DYNAMICS )

cgibb
03-02-2010, 04:18 PM
Have you tried applying a collide mesh to the room model?
room.collideMesh()
room.disable( viz.DYNAMICS )


This worked great in combination with collideBox()

Thanks again!