[HELP] Hinges: Limiting rotation

ricardo_arango

25-09-2006 04:01:16

Let's say I have a box.. And I want to attach another box to it..


|BOX1|------[BOX2]


I tried using a hinge (UNIT_Y) to attach them... but it rotates!

How can I stop the rotation completely?

Or is there another way to attach two collision objects together?

walaber

25-09-2006 05:26:24

1. what exactly are you trying to do?

if the boxes will always stay together, you can use a "compoundcollision" object to combine the collision shapes.

if they need to break apart later, you will need to connect them witha "fixed joint", which is not one of the default joints. there is one included with OgreNewt though (Prebuil Custom Joints).

ricardo_arango

25-09-2006 06:04:14

Exactly i am making a swinging rope.. My character at the moment is simply a box. So I divided the rope in tiny boxes... when I go up and down the rope I change from one box to another.. and when I press forward and backward I apply forces to the box to swing the rope...

ricardo_arango

25-09-2006 06:19:18

How do I create a fixed joint?

ricardo_arango

25-09-2006 06:58:26

You also said that I cold use a compoundcollision object..but only if they stay together all the time...

wouldn't it be possible to create a compound collision and then destroy it and crete again, etc.. and preformance-wise better than using a fixed joint which you say is really expensive..?

ricardo_arango

25-09-2006 07:19:52

Also.. I am using hinges for my rope... with the UNIT_X axis for the pin... But I can still apply forces and make the rope bend a bit in the X axis...and I want it to be perfectly straight.. how can I do that...

Also.. If I put a little mass for each box.. let's say 100grams.. and at the end of the rope I put 50Kg the thing just goes crazy when I apply forces.. it spins forever, faster every time,

Also when created with those masses the objects separate a little bit forming a gap in between them, as if they were streched springs..

Vectrex

25-09-2006 07:23:07

I found turning of self collisions helped with ropes, but I still got it going crazy if the rope was too long etc

ricardo_arango

25-09-2006 16:25:36

How do I do remove collisions?