40 #ifndef _physicshingeconstraint_cpp
41 #define _physicshingeconstraint_cpp
43 #include "Physics/hingeconstraint.h"
44 #include "Physics/rigidproxy.h"
46 #include "stringtool.h"
49 #include <btBulletDynamicsCommon.h>
59 {
return this->
Hinge; }
113 {
return Vector3(this->
Hinge->getAFrame().getOrigin()); }
116 {
return Vector3(this->
Hinge->getBFrame().getOrigin()); }
131 { this->
Hinge->getAFrame() << TranA; }
134 { this->
Hinge->getBFrame() << TranB; }
146 { this->
Hinge->enableAngularMotor(EnableMotor, TargetVelocity, MaxMotorImpulse); }
149 { this->
Hinge->enableMotor(EnableMotor); }
152 {
return this->
Hinge->getEnableAngularMotor(); }
155 { this->
Hinge->setMaxMotorImpulse(MaxMotorImpulse); }
158 {
return this->
Hinge->getMaxMotorImpulse(); }
164 { this->
Hinge->setMotorTarget(TargetAngle, Dt); }
167 { this->
Hinge->setMotorTargetVelocity(TargetVelocity); }
170 {
return this->
Hinge->getMotorTargetVelosity(); }
176 { this->
Hinge->setLimit(Low, High, Softness, BiasFactor, RelaxationFactor); }
179 {
return this->
Hinge->getLowerLimit(); }
182 {
return this->
Hinge->getUpperLimit(); }
185 {
return this->
Hinge->getLimitSoftness(); }
188 {
return this->
Hinge->getLimitBiasFactor(); }
191 {
return this->
Hinge->getLimitRelaxationFactor(); }
199 this->
Hinge->setAxis(temp);
204 return this->
Hinge->getHingeAngle();
210 if(-1==Axis||5==Axis)
212 Results.push_back(Con_Stop_ERP);
214 Results.push_back(Con_Stop_CFM);
222 Results.push_back(-1);
229 Results.push_back(5);
236 if ( -1!=Axis && 5!=Axis )
238 return ( Con_Stop_ERP==Param && this->
Hinge->getFlags() & BT_HINGE_FLAGS_ERP_STOP ) ||
239 ( Con_Stop_CFM==Param && this->
Hinge->getFlags() & BT_HINGE_FLAGS_CFM_STOP ) ||
240 (
Con_CFM==Param && this->
Hinge->getFlags() & BT_HINGE_FLAGS_CFM_NORM ) ;
244 {
return this->
Hinge->getUseReferenceFrameA(); }
247 { this->
Hinge->setUseReferenceFrameA(UseReferenceFrameA); }
250 {
return this->
Hinge->getUseFrameOffset(); }
253 { this->
Hinge->setUseFrameOffset(FrameOffset); }
267 if( VerAttr && RefA && FrameOff )
283 if( MotEnabled && MotImpulse && MotTarget )
301 if( LimLow && LimHigh && LimSoft && LimBias && LimRelax )
357 {
return String(
"HingeConstraint"); }