PDA

View Full Version : Physics - Discs & Discs Holder


rmcconnell11
09-16-2013, 02:50 PM
Hey Guys,

I am having some trouble to setting the right physic shapes for my models. I have three discs, with varying diameter holes, that rest on the disc holder. I need to dis-assemble the discs, move the disc holder and re-assemble the discs. The discs need to back in the right order, the top disc should not go further than its inner diameter permits.

I have enabled collide notify on all objects, and created collideBox shapes on the discs. But I cannot get the right shape for the holder so that the discs fall until they cannot go any further.

I have uploaded the code and some pictures for reference. Also apologies for the state the code is in..... :)

Jeff
09-17-2013, 12:53 PM
If you are using collide boxes the result will be like stacking boxes. Perhaps you can set this up a different way without physics. Using proximity sensors you can determine when a disk is above the holder and animate its movement into place.

rmcconnell11
09-21-2013, 06:54 AM
Thanks, Jeff, that really is looking like the best option at this point......
Do you know if there is a way to disable physics until objects are grabbed? that way I can still have them colliding into other objects...

rmcconnell11
09-23-2013, 03:36 AM
Jeff any idea if I can create objects that fit around the disc holder and apply physics shapes to that, but still be able to grab the object? Any time a link them the objects either go nuts or I cannot use the GrabHand function.....

Jeff
09-23-2013, 11:30 AM
With physics enabled is all the grab code working the way you want? If so, then you could disable physics on the node once it's in place above the holder using node.disable(viz.PHYSICS). Then animate its movement down.

rmcconnell11
11-05-2013, 06:32 AM
Hey Jeff, managed to get the physics around the options OK but I am having a bit of trouble with the grabhand function itself (I think, it could be other things). Anyway, when grabbing the objects to move them to a different location they tend to spiral and jump around the hand alot. Would you know if this is because the grabhand is just pinching the objects rather than grabbing them or due is it just down to physics itself?