I cant seem to change the position of the anchor...

scratchyrice

20-04-2009 18:10:37

...with any joints, Ive tried it with both fixed and spherical joints, And it simply will not work.


_physxJoint = _myPhysicsSystem->_getPhysXScene()->createSphericalJoint(_actorA->_getPhysXActor(), _actorB->_getPhysXActor(), Ogre::Vector3(1000,1000,1000), myparams);
_physxJoint->setGlobalAnchor(NxVec3(1000, 1000, 1000));
_physxJoint->setGlobalAxis(Ogre::Vector3(0, 0, 1));


Ive tried that, As you can see, It should move the anchor off up into the sky somewhere, But when i do this, There is no diffrence in the simulation whatsoever. The anchor still apperars to be at the centre of mass of actor b. Obviously this is a rather vital part of joint physics, So im hoping its just a hicup on my part, Any help would be much appreciated.

Cheers

Scratchy

scratchyrice

20-04-2009 19:01:45

P.S im using bleeding (1.0)

betajaen

20-04-2009 19:47:26

I had a check, and the code does exist that should implement it.

This is a nasty idea; What about creating a NxSphericalJointDesc, fill the coordinates out, then use setGlobalAnchor/setGlobalAxis then copy them over to the params or what ever it is in SphericalJoint.

scratchyrice

20-04-2009 20:34:29

This is a nasty idea; What about creating a NxSphericalJointDesc, fill the coordinates out, then use setGlobalAnchor/setGlobalAxis then copy them over to the params or what ever it is in SphericalJoint.
I just tired this, No effect whatsoever. I think there may be some weird bug in the spherical joint constructor. I say this because setbreakable works fine on a fixed joint, But has no effect whatsoever on a spherical joint. Also spherical joint's dont seem to limit how far away the actors can get from each other, Which is a bit odd. Any help would be much appreciated.

Cheers

Scratchy

betajaen

20-04-2009 21:22:20

What about setting up a D6 joint? That is pretending to be a spherical joint. Obviously via PhysX as NxOgre doesn't have an implementation of it yet (apart from the copy on my harddrive).

scratchyrice

20-04-2009 21:49:38

Thanks, i will do that. Ive now tried creating a spherical joint directly through the physx api (getNxScene), And i get hte same results. Seems i simply do not know what im doing at this point, Or am using the wrong joint type for what im trying to achive.

Cheers

Scratchy

betajaen

20-04-2009 22:00:38

Also if this helps, as I have to write my own setGlobalAnchor code, this seems to produce correct results;

NxVec3 globalAnchor(3, 5.5, 0);

NxVec3 local[2];

local[0] = globalAnchor;
local[0] -= actor[0]->getGlobalPosition();
local[1] = globalAnchor;
local[1] -= actor[1]->getGlobalPosition();


But of course, a monkey could of figured that out. ;)