00001
00002 #include "PhysicsJointBall.h"
00003 #include "PhysicsManager.h"
00004 #include "random_utils/LogManager.h"
00005
00006 namespace vrsode
00007 {
00008
00009 PhysicsJointBall::PhysicsJointBall(VRS::SO<PhysicsBody> p_bodyOne,
00010 VRS::SO<PhysicsBody> p_bodyTwo,
00011 VRS::Vector p_position)
00012 : PhysicsJoint(p_bodyOne, p_bodyTwo)
00013 {
00014 dBodyID bodyOne;
00015 dBodyID bodyTwo;
00016 p_bodyOne != 0 ? bodyOne = p_bodyOne->bodyId() : bodyOne = 0;
00017 p_bodyTwo != 0 ? bodyTwo = p_bodyTwo->bodyId() : bodyTwo = 0;
00018
00019 setJointId(dJointCreateBall(PhysicsManager::get()->worldId(), 0));
00020 dJointAttach(jointId(), bodyOne, bodyTwo);
00021 dJointSetBallAnchor(jointId(), p_position[0], p_position[1], p_position[2]);
00022 dJointSetData(jointId(), this);
00023 }
00024
00025 PhysicsJointBall::~PhysicsJointBall()
00026 {
00027 dJointDestroy(jointId());
00028 }
00029
00030 void
00031 PhysicsJointBall::setLowStop(double p_lowStop)
00032 {
00033 rWrn("setLowStop has no effect on ball joints. Nothing done.");
00034 }
00035
00036 void
00037 PhysicsJointBall::setHighStop(double p_highStop)
00038 {
00039 rWrn("setHighStop has no effect on ball joints. Nothing done.");
00040 }
00041
00042 void
00043 PhysicsJointBall::setMotorVelocity(double p_velocity)
00044 {
00045 rWrn("setMotorVelocity has no effect on ball joints. Nothing done.");
00046 }
00047
00048 void
00049 PhysicsJointBall::setMotorMaxForce(double p_maxForce)
00050 {
00051 rWrn("setMotorMaxForce has no effect on ball joints. Nothing done.");
00052 }
00053
00054 void
00055 PhysicsJointBall::setStopBounce(double p_bounce)
00056 {
00057 rWrn("setStopBounce has no effect on ball joints. Nothing done.");
00058 }
00059
00060 void
00061 PhysicsJointBall::setCFM(double p_cfm)
00062 {
00063 rWrn("setCFM has no effect on ball joints. Nothing done.");
00064 }
00065
00066 }