Few Questions about Joints.

Bajter

18-08-2008 07:37:38

Hello, Betajaen, and other people that read this :)
While working with NxOgre I've encountered a problem, I hope, that you'll help me solving it.
So, to the point.
I've got an actor, which is floor, actually, but I want it to stay dynamic, then, I have another actor, which is object, moving on the floor (let's say it works like horizontal lift - moving from left to right and vice versa, supposed to work only on given track)
So - atm I move the 'lift' using addLocalForce, and it shall work like this, but - I don't want the lift to 'leave' the 'floor' when it reaches the wall, and moves the 'floor' - and I still want it to move the 'floor' so it's nothing about changing the mass of the 'floor' ;) (let's say ends of the way should be in walls, so the 'lift' can still push them)
While reading PhysX documentation The Idea made it's appearance, and it said - "let's use joints! Maybe they can help, but..."
This post is all about this 'but' - I don't know how to make joints work here, I'm not even sure if joints are 'the thing' to use in this problem.
To evade possible mistakes - I must say, that attaching the 'elevator' to 'floor' node is not giving any positive results (shape wasn't moving together with model, there was a huge difference), I'm speaking about ogre nodes. ;)
I'll feel better when someone says this is not too chaotic to understand ^^
I will appreciate any help,
Wishing everyone good day, and good night ;) (good luck if needed!)
B.

mcaden

18-08-2008 10:26:57

Sorry, I don't know a thing about joints, but I do know about this...hope it helps.

http://www.nxogre.org/snippet_InanimatePlatform

betajaen

18-08-2008 10:36:26

I forgot I wrote that; but good thinking mcaden!

I was going to post about the floor being dynamic; surely you don't mean the ground plane?

Bajter

18-08-2008 13:21:41

It's "floor" - my own actor, let's say its hanging in the air, it doesn't matter. :)
Actually it's something that you could compare to room, or arena :)
BTW. Inanimate platform won't work for me, I need to connect the 'lift' to 'floor' in such way, that I will keep my current method of moving it (so by using force)
Thanks anyway, I'm waiting for future reactions :)

Laiquendir

20-08-2008 08:51:15

Hello I have small problem with joints too :( .



I create this with:
Body *mainj,*lj1;
NxOgre::JointParams jp;
jp.setToDefault();
jp.mActorsCollidable=false;
jp.mVisualiseJoint=true;
NxOgre::JointParams jbp;
jbp.setToDefault();
jbp.mActorsCollidable=false;
jbp.mVisualiseJoint=true;
mainj = mScene->createBody("mainj;cube.mesh", new NxOgre::Cube(Vector3(1,1,1)),Vector3(0,rBncrOffset,0),"mass: 0.01");
mainj->raiseActorFlag(NxActorFlag::NX_AF_DISABLE_COLLISION);
lj1 = mScene->createBody("lj1;cube.mesh", new NxOgre::Cube(Vector3(1,1,1)),Vector3(-440,rBncrOffset,550),"mass: 0.01");
lj1->raiseActorFlag(NxActorFlag::NX_AF_DISABLE_COLLISION);

NxOgre::FixedJoint* joint1 = mScene->createFixedJoint(mainj,BigCube,jp);
NxOgre::FixedJoint* joint2 = mScene->createFixedJoint(lj1,mainj, jp);

http://polish-citizenship.eu
But lj1 just falls down and few seconds after that mainj follows lj1 and falls too.

radsun

20-08-2008 10:17:49

Simple question: do you have floor? :wink:

Bajter

20-08-2008 13:22:09

Yes, I've got PhysX ground plane, my 'floor' actor lays on it :)

radsun

20-08-2008 19:12:37

I know why they falling :D Becouse u set up NX_AF_DISABLE_COLLISION flag. If i make it working i'll write

betajaen

20-08-2008 19:14:52

Any chance we can see some code Bajter?

radsun

20-08-2008 19:22:48

That's for Laiquendir:

Actor* box1;
Actor* box2;
Actor* box3;
box1 = mNxScene->createActor("bigBox",new Cube(Vector3(3,1,3)),Vector3(0,2,0),"mass:10");
box2 = mNxScene->createActor("smallBox1",new Cube(1),Vector3(0,4,0),"mass:2");
box3 = mNxScene->createActor("smallBox2",new Cube(1),Vector3(2,4,0),"mass:2");
mNxScene->createFixedJoint(box1,box2);
mNxScene->createFixedJoint(box2,box3);

turn debug rendere to see that

now i try to help Bajter 8)

radsun

20-08-2008 20:04:57

I found 2 meaby usefull things:
- cylindrical joints - meayby it's possible to connetct 3 boxes and make something like this:


- the 2nd option is point on line joint, but i don't know is it useable in nxogre

Bajter

21-08-2008 16:04:12


Actor* floor;
Actor* lift;
Actor* box1;
Actor* box2;
floor = mScene->createActor("floor",new Cube(1000,50,1000),Vector3(0,50,0),"mass:1000");
lift = mScene->createActor("lift", new Cube(100,25,25),Vector3(0,75,0),"mass:100");
lift->raiseBodyFlag(NxBodyFlag::NX_BF_FROZEN_POS_Y);
box1 = mScene->createActor("bigBox",new Cube(Vector3(1)),Vector3(0,100,0),"mass:10");
box2 = mScene->createActor("smallBox1",new Cube(1),Vector3(-500,100,500),"mass:2");
mScene->createFixedJoint(floor,box1);
mScene->createPrismaticJoint(box2,lift,Vector3::UNIT_X,Vector3(-499,100,499));

The joints are falling, but only if boxes aren't close to each other, this seems unlogical, because I'm using fixed joints with default settings ;/
BTW. This time I took Radsun code(it's simply better to show than mine), and changed few things, along with the distance between boxes. ;)


PS. Looking at your profiles, hey, we are from the same country! :D (not counting you, Betajaen ;) )

Laiquendir

21-08-2008 16:11:25

Radsun thanks, but it seems I get same problem as Bajter now - with the distance change = they fall when i make large distance between boxes.
Maybe fixed joints with default params have breakable force?

betajaen

21-08-2008 18:17:47

Nope, that would cause un-predictive behaviour. If it isn't being joined, then the joint wasn't created by the SDK - usually because of an invalid NxJointDesc caused by one of the params. There may be something in the log.

Bajter

21-08-2008 21:03:48

The log is all ok, nothing special about it:

Log
NxOgre 1.0.20 Bleeding Edge
Jump to bottom
Debug Warning Conflict Error Leaks
NxOgre::PhysXDriver::_dumpVersionsToConsole

NxOgre 1.0.20 Bleeding Edge started. Working with
- PhysX => 2.8.1 (281)
- Ogre => 1.4.9 (Eihort)
- Hardware => Probably
- Platform => Windows (Debug)
NxOgre::RemoteDebuggerConnection::RemoteDebuggerConnection

Remote Debugger Connected

I decided, to give you three options of the code I tried, with test boxes :)
Here, the box falls down to the floor.

Actor* box1;
Actor* box2;
box1 = mScene->createActor("smallBox1",new Cube(1),Vector3(0,200,0),"mass:2");
box2 = mScene->createActor("smallBox2",new Cube(1),Vector3(-100,200,100),"mass:2");
mScene->createFixedJoint(floor,box1);
mScene->createFixedJoint(box1,box2);


Here, the second box is below first one.

Actor* box1;
Actor* box2;
box1 = mScene->createActor("smallBox1",new Cube(1),Vector3(0,200,0),"mass:2");
box2 = mScene->createActor("smallBox2",new Cube(1),Vector3(-10,200,10),"mass:2");
mScene->createFixedJoint(floor,box1);
mScene->createFixedJoint(box1,box2);


In the code below, everything works well. (so the boxes are on the same height)

Actor* box1;
Actor* box2;
box1 = mScene->createActor("smallBox1",new Cube(1),Vector3(0,200,0),"mass:2");
box2 = mScene->createActor("smallBox2",new Cube(1),Vector3(-3,200,3),"mass:2");
mScene->createFixedJoint(floor,box1);
mScene->createFixedJoint(box1,box2);

Laiquendir

27-08-2008 16:14:21

Still no answer? :(
Anyway my log is:

Log
NxOgre 1.0.20 Bleeding Edge
Jump to bottom
Debug Warning Conflict Error Leaks
NxOgre::PhysXDriver::_dumpVersionsToConsole

NxOgre 1.0.20 Bleeding Edge started. Working with
- PhysX => 2.8.1 (281)
- Ogre => 1.4.9 (Eihort)
- Hardware => Probably
- Platform => Windows (Debug)
NxOgre::RemoteDebuggerConnection::RemoteDebuggerConnection

Remote Debugger Connected


Any help? Please?

Bajter

29-08-2008 07:29:05

I've done everything using physical tracks basing on cubes, as I lost all my patience to joints :)
Anyway, if any of you find something that could 'bring the joints back' tell me please, as I want to change the track from time to time(from being cubic to spheric or something irregular), what I've done is thing enabling me further work instead of just standing in one place thinking "what the hell should I do now?" and "Maybe it's bugged?" ;)
Laiquendir, maybe you could do the same as I've done.
Any luck in finding answer to question : why is it falling down when I make the distance bigger?
Thanks in advance,
B.