ghiboz
15-05-2007 13:55:13
how works the joint in 0.9?
i tried to look in the sources, but I don't find nothing.
thanks very much!
ghiboz
15-05-2007 13:55:13
betajaen
15-05-2007 16:58:30
ghiboz
15-05-2007 17:38:53
According to the code I have, only the revolute joint is implemented, but joints should be gradually implemented over the next SVN commits.
betajaen
15-05-2007 17:43:50
ghiboz
15-05-2007 17:46:00
Is English your primary language?
1. Yes
2. I have no idea when.
ghiboz
15-05-2007 18:01:30
2. I have no idea when.
Pottej
25-05-2007 23:26:39
betajaen
25-05-2007 23:32:45
Pottej
25-05-2007 23:39:10
betajaen
25-05-2007 23:44:22
Pottej
26-05-2007 00:01:35
Pottej
26-05-2007 16:29:54
//
// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine.
// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#ifndef __NXOGRE_JOINTSET2_H__
#define __NXOGRE_JOINTSET2_H__
#include "NxOgrePrerequisites.h"
#include "NXOgreJoint.h"
namespace NxOgre {
class NxExport SphericalJoint : public Joint {
public:
SphericalJoint(Actor* a, Actor* b, const Ogre::Vector3 &anchor);
SphericalJoint(Actor* a, const Ogre::Vector3 &anchor);
~SphericalJoint();
protected:
void __createJoint(const Ogre::Vector3 &anchor);
NxSphericalJoint *mSphericalJoint;
NxSphericalJointDesc mDescription;
};
////////////////////////////////////////////////////////////////////////////////////
class NxExport FixedJoint : public Joint {
public:
FixedJoint(Actor* a, Actor* b);
~FixedJoint();
protected:
void __createJoint();
NxFixedJoint *mFixedJoint;
NxFixedJointDesc mDescription;
};
////////////////////////////////////////////////////////////////////////////////////
class NxExport PrismaticJoint : public Joint {
public:
PrismaticJoint(Actor* a, Actor* b, const Ogre::Vector3 &axis);
PrismaticJoint(Actor* a, const Ogre::Vector3 &axis);
~PrismaticJoint();
protected:
void __createJoint(const Ogre::Vector3 &axis);
NxPrismaticJoint *mPrismaticJoint;
NxPrismaticJointDesc mDescription;
};
};
#endif
//
// NxOgre a wrapper for the PhysX (formerly Novodex) physics library and the Ogre 3D rendering engine.
// Copyright (C) 2005 - 2007 Robin Southern and NxOgre.org http://www.nxogre.org
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
//
#include "NxOgreStable.h"
#include "NxOgreJointSet2.h"
#include "NxOgreJoint.h" // For: These joints inherit Joint
#include "NxOgreActor.h" // For: a::getNxActor, b::getNxActor
#include "NxOgreHelpers.h" // For: Vector3 to NxVec3 conversion
#include "NxOgreScene.h" // For: mScene::getNxScene()
namespace NxOgre {
////////////////////////////////////////////////////////////////////////////////////
SphericalJoint::SphericalJoint(Actor *a ,Actor *b, const Ogre::Vector3 &anchor) : Joint(a,b){
mDescription.setToDefault();
__createJoint(anchor);
}
////////////////////////////////////////////////////////////////////////////////////
SphericalJoint::SphericalJoint(Actor *a, const Ogre::Vector3 &anchor) : Joint (a) {
mDescription.setToDefault();
__createJoint(anchor);
}
////////////////////////////////////////////////////////////////////////////////////
void SphericalJoint::__createJoint(const Ogre::Vector3 &anchor) {
mDescription.actor[0] = mActorA->getNxActor();
if (mActorB)
mDescription.actor[1] = mActorB->getNxActor();
else
mDescription.actor[1] = NULL;
mDescription.setGlobalAnchor(toNxVec3(anchor));
mDescription.userData = this;
mNxJoint = mScene->getNxScene()->createJoint(mDescription);
mSphericalJoint = static_cast<NxSphericalJoint*>(mNxJoint);
}
////////////////////////////////////////////////////////////////////////////////////
SphericalJoint::~SphericalJoint() {
mScene->getNxScene()->releaseJoint(*mNxJoint);
}
////////////////////////////////////////////////////////////////////////////////////
FixedJoint::FixedJoint(NxOgre::Actor *a, NxOgre::Actor *b) : Joint (a,b){
mDescription.setToDefault();
__createJoint();
}
////////////////////////////////////////////////////////////////////////////////////
FixedJoint::~FixedJoint() {
mScene->getNxScene()->releaseJoint(*mNxJoint);
}
////////////////////////////////////////////////////////////////////////////////////
void FixedJoint::__createJoint(){
mDescription.actor[0] = mActorA->getNxActor();
mDescription.actor[1] = mActorB->getNxActor();
mDescription.userData = this;
mNxJoint = mScene->getNxScene()->createJoint(mDescription);
mFixedJoint = static_cast<NxFixedJoint*>(mNxJoint);
}
////////////////////////////////////////////////////////////////////////////////////
PrismaticJoint::PrismaticJoint(NxOgre::Actor *a, NxOgre::Actor *b, const Ogre::Vector3 &axis) : Joint(a,b){
mDescription.setToDefault();
__createJoint(axis);
}
////////////////////////////////////////////////////////////////////////////////////
PrismaticJoint::PrismaticJoint(NxOgre::Actor *a, const Ogre::Vector3 &axis) : Joint(a){
mDescription.setToDefault();
__createJoint(axis);
}
////////////////////////////////////////////////////////////////////////////////////
PrismaticJoint::~PrismaticJoint(){
mScene->getNxScene()->releaseJoint(*mNxJoint);
}
////////////////////////////////////////////////////////////////////////////////////
void PrismaticJoint::__createJoint(const Ogre::Vector3 &axis){
mDescription.actor[0] = mActorA->getNxActor();
if(mActorB){
mDescription.actor[1] = mActorB->getNxActor();
}
else{
mDescription.actor[1] = NULL;
}
mDescription.setGlobalAxis(toNxVec3(axis));
mDescription.userData = this;
mNxJoint = mScene->getNxScene()->createJoint(mDescription);
mPrismaticJoint = static_cast<NxPrismaticJoint*>(mPrismaticJoint);
}
}; //End of NxOgre namespace.
betajaen
26-05-2007 18:21:42
ghiboz
31-05-2007 14:52:45
Pottej
01-06-2007 14:01:43
NxOgre::FixedJoint* joint = new NxOgre::SphericalJoint(a,b);
ghiboz
01-06-2007 15:33:35
Just use the constructor:
NxOgre::FixedJoint* joint = new NxOgre::SphericalJoint(a,b);
Does it not work? I have got spherical joints working in my application.
Caphalor
12-08-2007 15:33:30
SphericalJoint* Scene::createSphericalJoint(NxOgre::Actor *a, NxOgre::Actor *b, const Ogre::Vector3 &anchor)
{
SphericalJoint* j = new SphericalJoint(a, b, anchor);
NxString jid = NxCreateID(mJoints.count(), "Joint");
mJoints.insert(jid, j);
mJoints.lock(jid, true);
return j;
};
betajaen
12-08-2007 15:40:08
Caphalor
12-08-2007 16:01:00
mBody->setSolverIterationCount(100);
betajaen
12-08-2007 16:15:30
Caphalor
12-08-2007 16:52:49
betajaen
12-08-2007 17:25:32
Caphalor
12-08-2007 18:27:51
Caphalor
15-08-2007 13:03:39
betajaen
15-08-2007 13:08:48
Caphalor
15-08-2007 13:18:12
betajaen
15-08-2007 14:13:54
Caphalor
18-12-2007 22:02:43
Just create a free standing joint then. The static actor will never move anyway.
betajaen
18-12-2007 22:09:58