44 :
joint(0), part1(part1), part2(part2), anchor(anchor),
feedback(0) {
45 assert(part1 && part2);
56 bool withVisual =
true,
double visualSize = 0.2,
57 bool ignoreColl =
true);
62 virtual void setParam(
int parameter,
double value) = 0;
64 virtual double getParam(
int parameter)
const = 0;
79 virtual std::list<double>
getPositions()
const {
return std::list<double>(); }
111 :
Joint(part1, part2, anchor), axis1(axis1) {}
117 virtual void addForce1(
double force) = 0;
132 :
OneAxisJoint(part1, part2, anchor, axis1), axis2(axis2) {}
138 virtual void addForce2(
double force) = 0;
168 bool withVisual =
true,
double visualSize = 0.2,
169 bool ignoreColl =
true);
172 virtual void setParam(
int parameter,
double value);
173 virtual double getParam(
int parameter)
const;
194 bool withVisual =
true,
double visualSize = 0.2,
195 bool ignoreColl =
true);
202 virtual void setParam(
int parameter,
double value);
203 virtual double getParam(
int parameter)
const;
222 bool withVisual =
true,
double visualSize = 0.2,
223 bool ignoreColl =
true);
234 virtual void setParam(
int parameter,
double value);
235 virtual double getParam(
int parameter)
const;
254 bool withVisual =
true,
double visualSize = 0.2,
255 bool ignoreColl =
true);
267 virtual void setParam(
int parameter,
double value);
268 virtual double getParam(
int parameter)
const;
287 bool withVisual =
true,
double visualSize = 0.2,
288 bool ignoreColl =
true);
294 virtual void setParam(
int parameter,
double value);
295 virtual double getParam(
int parameter)
const;
316 bool withVisual =
true,
double visualSize = 0.1,
317 bool ignoreColl =
true);
324 virtual void setParam(
int parameter,
double value);
325 virtual double getParam(
int parameter)
const;
OSGPrimitive * visual2
Definition: joint.h:272
virtual void addForce2(double force)=0
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:521
dJointFeedback * feedback
Definition: joint.h:103
virtual int getNumberAxes() const
returns the number of Axes
Definition: joint.h:143
virtual std::list< double > getPositionRates() const
returns the position rates of all Axes
Definition: joint.cpp:97
virtual ~Hinge2Joint()
Definition: joint.cpp:255
virtual void addForce1(double force)=0
SliderJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis &axis1)
Definition: joint.cpp:456
virtual bool getForceFeedback(Pos &f1, Pos &f2) const
force applied to body 1 and body 2
Definition: joint.cpp:83
Data structure for accessing the ODE.
Definition: odehandle.h:44
virtual bool getTorqueFeedback(Pos &t1, Pos &t2) const
torque applied to body 1 and body 2
Definition: joint.cpp:76
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:171
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:526
UniversalJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis &axis1, const Axis &axis2)
Definition: joint.cpp:330
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:449
Axis axis2
Definition: joint.h:150
virtual void addForce2(double t2)
add torque to axis 1
Definition: joint.cpp:297
Matrixd Matrix
Definition: osgforwarddecl.h:47
virtual ~BallJoint()
Definition: joint.cpp:418
virtual double getPosition1() const =0
Interface class for graphic primitives like spheres, boxes, and meshes, which can be drawn by OSG...
Definition: osgprimitive.h:62
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:177
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:447
dJointID joint
Definition: joint.h:98
virtual double getPosition1() const
Definition: joint.cpp:387
virtual std::list< double > getPositions() const
returns the positions of all Axes
Definition: joint.cpp:103
Primitive * getPart2()
Definition: joint.h:70
virtual ~FixedJoint()
Definition: joint.cpp:150
OdeHandle odeHandle
Definition: joint.h:105
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.1, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:465
virtual int getNumberAxes() const
returns the number of Axes
Definition: joint.h:175
Data structure for accessing the OpenSceneGraph.
Definition: osghandle.h:79
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:323
virtual void addForce1(double t1)
adds torques to axis 1 and 2
Definition: joint.cpp:293
virtual double getPosition2Rate() const
Definition: joint.cpp:314
OSGPrimitive * visual
Definition: joint.h:328
virtual double getPosition1Rate() const
Definition: joint.cpp:234
virtual void addForce1(double t)
Definition: joint.cpp:226
virtual double getPosition1() const
Definition: joint.cpp:230
TwoAxisJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis axis1, const Axis axis2)
Definition: joint.h:130
FixedJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor=osg::Vec3(0, 0, 0))
the anchor is only required for drawing.
Definition: joint.cpp:141
virtual std::list< double > getPositionRates() const
returns the position rates of all Axes
Definition: joint.h:81
virtual double getPosition2Rate() const
Definition: joint.cpp:399
double visualSize
Definition: joint.h:329
virtual ~Joint()
Definition: joint.cpp:44
virtual double getPosition2() const =0
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:407
Vec3f Vec3
Definition: osgforwarddecl.h:42
virtual double getParam(int parameter) const =0
return the ODE joint parameter (see ODE manual)
virtual ~SliderJoint()
Definition: joint.cpp:461
Hinge2Joint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis &axis1, const Axis &axis2)
Definition: joint.cpp:250
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:422
virtual ~HingeJoint()
Definition: joint.cpp:191
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:487
virtual void addForce1(double t)
Definition: joint.cpp:509
OSGPrimitive * visual1
Definition: joint.h:271
void addForces(double force1, double force2)
Definition: joint.h:139
Interface class for primitives represented in the physical and graphical world.
Definition: primitive.h:80
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:360
virtual ~UniversalJoint()
Definition: joint.cpp:335
Primitive * part2
Definition: joint.h:100
osg::Vec3 anchor
Definition: joint.h:101
virtual double getPosition1Rate() const
Definition: joint.cpp:517
virtual int getNumberAxes() const
returns the number of Axes
Definition: joint.h:292
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:435
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:403
const Primitive * getPart2() const
Definition: joint.h:69
virtual void update()=0
should syncronise the Ode stuff and the OSG notes (if any)
OSGPrimitive * visual
Definition: joint.h:298
virtual double getPosition1() const
Definition: joint.cpp:513
Primitive * part1
Definition: joint.h:99
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:195
virtual double getPosition1Rate() const
This is not supported by the joint!
Definition: joint.cpp:310
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:211
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:156
OSGPrimitive * visual
Definition: joint.h:177
Primitive * getPart1()
Definition: joint.h:68
virtual std::list< double > getPositions() const
returns the positions of all Axes
Definition: joint.cpp:92
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:52
virtual int getPositionRates(double *sensorarray) const
stores the position rates of all Axes into sensorarray and returns the number of written entries ...
Definition: joint.h:87
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:340
virtual double getPosition1Rate() const
Definition: joint.cpp:395
virtual void init(const OdeHandle &odeHandle, const OsgHandle &osgHandle, bool withVisual=true, double visualSize=0.2, bool ignoreColl=true)
initialises (and creates) the joint.
Definition: joint.cpp:259
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:243
virtual double getPosition2() const
Definition: joint.cpp:391
virtual void update()
should syncronise the Ode stuff and the OSG notes (if any)
Definition: joint.cpp:276
virtual void setParam(int parameter, double value)=0
sets the ODE joint parameter (see ODE manual)
virtual double getPosition1Rate() const =0
const Primitive * getPart1() const
Definition: joint.h:67
Axis axis1
Definition: joint.h:125
BallJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor)
Definition: joint.cpp:413
virtual void addForce1(double t1)
adds torques to axis 1 and 2
Definition: joint.cpp:380
OneAxisJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis axis1)
Definition: joint.h:110
int t
Definition: hexapod.cpp:55
const osg::Vec3 getAnchor() const
Definition: joint.h:71
Joint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor)
Definition: joint.h:43
virtual int getNumberAxes() const
returns the number of Axes
Definition: joint.h:119
virtual int getNumberAxes() const =0
returns the number of Axes
virtual double getParam(int parameter) const
return the ODE joint parameter (see ODE manual)
Definition: joint.cpp:180
OsgHandle osgHandle
Definition: joint.h:330
virtual Axis getAxis(int n) const
returns the n'th axis of the joint (starting with 0)
Definition: joint.h:76
virtual std::list< double > getPositionRates() const
returns the position rates of all Axes
Definition: joint.cpp:109
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:238
virtual int getPositions(double *sensorarray) const
stores the positions of all Axes into sensorarray and returns the number of written entries ...
Definition: joint.h:83
virtual Axis getAxis1() const
Definition: joint.h:113
virtual void addForce2(double t2)
Definition: joint.cpp:383
HingeJoint(Primitive *part1, Primitive *part2, const osg::Vec3 &anchor, const Axis &axis1)
Definition: joint.cpp:186
virtual Axis getAxis(int n) const
returns the n'th axis of the joint (starting with 0)
Definition: joint.h:112
virtual double getPosition1() const
Definition: joint.cpp:301
virtual double getPosition2Rate() const =0
virtual Axis getAxis(int n) const
returns the n'th axis of the joint (starting with 0)
Definition: joint.h:133
virtual void setFeedBackMode(bool mode)
enable or disable the feedback mode
Definition: joint.cpp:62
virtual double getPosition2() const
Definition: joint.cpp:305
virtual std::list< double > getPositions() const
returns the positions of all Axes
Definition: joint.h:79
OSGPrimitive * visual
Definition: joint.h:238
static osg::Matrix anchorAxisPose(const osg::Vec3 &anchor, const Axis &axis)
Definition: joint.cpp:40
virtual Axis getAxis2() const
Definition: joint.h:134
virtual void setParam(int parameter, double value)
sets the ODE joint parameter (see ODE manual)
Definition: joint.cpp:318
OSGPrimitive * visual
Definition: joint.h:206
dJointID getJoint() const
Definition: joint.h:66