CCPhysics3DConstraint.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591
  1. /****************************************************************************
  2. Copyright (c) 2015-2017 Chukong Technologies Inc.
  3. http://www.cocos2d-x.org
  4. Permission is hereby granted, free of charge, to any person obtaining a copy
  5. of this software and associated documentation files (the "Software"), to deal
  6. in the Software without restriction, including without limitation the rights
  7. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. copies of the Software, and to permit persons to whom the Software is
  9. furnished to do so, subject to the following conditions:
  10. The above copyright notice and this permission notice shall be included in
  11. all copies or substantial portions of the Software.
  12. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  13. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  14. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  15. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  16. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  17. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  18. THE SOFTWARE.
  19. ****************************************************************************/
  20. #ifndef __PHYSICS_3D_CONSTRAINT_H__
  21. #define __PHYSICS_3D_CONSTRAINT_H__
  22. #include "math/CCMath.h"
  23. #include "base/CCRef.h"
  24. #include "base/ccConfig.h"
  25. #if CC_USE_3D_PHYSICS
  26. #if (CC_ENABLE_BULLET_INTEGRATION)
  27. class btTypedConstraint;
  28. NS_CC_BEGIN
  29. /**
  30. * @addtogroup _3d
  31. * @{
  32. */
  33. class Physics3DRigidBody;
  34. /** @brief Physics3DConstraint: Constraint affects the movement of physics object, it usually connect one or two physics object. There are some types of physics constraints. */
  35. class CC_DLL Physics3DConstraint : public Ref
  36. {
  37. public:
  38. enum class ConstraintType
  39. {
  40. UNKNOWN,
  41. POINT_TO_POINT,
  42. HINGE,
  43. SLIDER,
  44. CONE_TWIST,
  45. SIX_DOF,
  46. };
  47. /**
  48. * get the impulse that break the constraint
  49. */
  50. float getBreakingImpulse() const;
  51. /**
  52. * set the impulse that break the constraint
  53. */
  54. void setBreakingImpulse(float impulse);
  55. /**
  56. * is it enabled
  57. */
  58. bool isEnabled() const;
  59. /**
  60. * set enable or not
  61. */
  62. void setEnabled(bool enabled);
  63. /**
  64. * get rigid body a
  65. */
  66. Physics3DRigidBody* getBodyA() const { return _bodyA; }
  67. /**
  68. * get rigid body b
  69. */
  70. Physics3DRigidBody* getBodyB() const { return _bodyB; }
  71. /**
  72. * get constraint type
  73. */
  74. ConstraintType getConstraintType() const { return _type; }
  75. /**
  76. * get user data
  77. */
  78. void setUserData(void* userData) { _userData = userData; }
  79. /**
  80. * get user data
  81. */
  82. void* getUserData() const { return _userData; }
  83. /**
  84. * get override number of solver iterations
  85. */
  86. int getOverrideNumSolverIterations() const;
  87. /**
  88. * override the number of constraint solver iterations used to solve this constraint, -1 will use the default number of iterations, as specified in SolverInfo.m_numIterations
  89. */
  90. void setOverrideNumSolverIterations(int overrideNumIterations);
  91. #if (CC_ENABLE_BULLET_INTEGRATION)
  92. btTypedConstraint* getbtContraint() { return _constraint; }
  93. #endif
  94. protected:
  95. Physics3DConstraint();
  96. virtual ~Physics3DConstraint();
  97. btTypedConstraint* _constraint;
  98. Physics3DRigidBody* _bodyA;
  99. Physics3DRigidBody* _bodyB;
  100. ConstraintType _type;
  101. void* _userData;
  102. };
  103. /**
  104. * Point to point constraint limits the translation so that the local pivot points of 2 rigidbodies match in worldspace.
  105. */
  106. class CC_DLL Physics3DPointToPointConstraint : public Physics3DConstraint
  107. {
  108. public:
  109. /**
  110. * create point to point constraint, limits the translation of local pivot point of rigid body A
  111. * @param rbA The rigid body going to be fixed
  112. * @param pivotPointInA local pivot point in A's local space
  113. * @return created constraint
  114. */
  115. static Physics3DPointToPointConstraint* create(Physics3DRigidBody* rbA, const cocos2d::Vec3& pivotPointInA);
  116. /**
  117. * create point to point constraint, make the local pivot points of 2 rigid bodies match in worldspace.
  118. * @param rbA The rigid body A going to be fixed
  119. * @param rbB The rigid body B going to be fixed
  120. * @param pivotPointInA local pivot point in A's local space
  121. * @param pivotPointInB local pivot point in B's local space
  122. * @return created constraint
  123. */
  124. static Physics3DPointToPointConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Vec3& pivotPointInA, const cocos2d::Vec3& pivotPointInB);
  125. /**
  126. * set pivot point in A's local space
  127. */
  128. void setPivotPointInA(const cocos2d::Vec3& pivotA);
  129. /**
  130. * set pivot point in B's local space
  131. */
  132. void setPivotPointInB(const cocos2d::Vec3& pivotB);
  133. /**
  134. * get pivot point in A's local space
  135. */
  136. cocos2d::Vec3 getPivotPointInA() const;
  137. /**
  138. * get pivot point in B's local space
  139. */
  140. cocos2d::Vec3 getPivotPointInB() const;
  141. CC_CONSTRUCTOR_ACCESS:
  142. Physics3DPointToPointConstraint();
  143. virtual ~Physics3DPointToPointConstraint();
  144. bool init(Physics3DRigidBody* rbA, const cocos2d::Vec3& pivotPointInA);
  145. bool init(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Vec3& pivotPointInA, const cocos2d::Vec3& pivotPointInB);
  146. };
  147. /**
  148. * Hinge constraint restricts two additional angular degrees of freedom, so the body can only rotate around one axis, the hinge axis. This can be useful to represent doors or wheels rotating around one axis.
  149. * hinge constraint between two rigidbodies each with a pivotpoint that describes the axis location in local space
  150. */
  151. class CC_DLL Physics3DHingeConstraint : public Physics3DConstraint
  152. {
  153. public:
  154. /**
  155. * create hinge constraint
  156. * @param rbA rigid body A
  157. * @param rbAFrame rigid body A's frame
  158. * @param useReferenceFrameA use frame A as reference
  159. */
  160. static Physics3DHingeConstraint* create(Physics3DRigidBody* rbA, const cocos2d::Mat4& rbAFrame, bool useReferenceFrameA = false);
  161. /**
  162. * create hinge constraint
  163. * @param rbA rigid body A
  164. * @param pivotInA pivot in rigid body A's local space
  165. * @param axisInA axis in rigid body A's local space
  166. * @param useReferenceFrameA use frame A as reference
  167. */
  168. static Physics3DHingeConstraint* create(Physics3DRigidBody* rbA, const cocos2d::Vec3& pivotInA, const cocos2d::Vec3& axisInA, bool useReferenceFrameA = false);
  169. /**
  170. * create hinge constraint
  171. * @param rbA rigid body A
  172. * @param rbB rigid body B
  173. * @param pivotInA pivot point in A's local space
  174. * @param pivotInB pivot point in B's local space
  175. * @param axisInA axis in A's local space
  176. * @param axisInB axis in B's local space
  177. * @param useReferenceFrameA use frame A as reference
  178. */
  179. static Physics3DHingeConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Vec3& pivotInA,const cocos2d::Vec3& pivotInB, cocos2d::Vec3& axisInA, cocos2d::Vec3& axisInB, bool useReferenceFrameA = false);
  180. /**
  181. * create hinge constraint
  182. * @param rbA rigid body A
  183. * @param rbB rigid body B
  184. * @param rbAFrame rigid body A's frame
  185. * @param rbBFrame rigid body B's frame
  186. * @param useReferenceFrameA use frame A as reference
  187. */
  188. static Physics3DHingeConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Mat4& rbAFrame, const cocos2d::Mat4& rbBFrame, bool useReferenceFrameA = false);
  189. /**
  190. * get rigid body A's frame offset
  191. */
  192. cocos2d::Mat4 getFrameOffsetA() const;
  193. /**
  194. * get rigid body B's frame offset
  195. */
  196. cocos2d::Mat4 getFrameOffsetB() const;
  197. /**
  198. * set frames for rigid body A and B
  199. */
  200. void setFrames(const cocos2d::Mat4& frameA, const cocos2d::Mat4& frameB);
  201. /**
  202. * set angular only
  203. */
  204. void setAngularOnly(bool angularOnly);
  205. /** enable angular motor */
  206. void enableAngularMotor(bool enableMotor, float targetVelocity, float maxMotorImpulse);
  207. // extra motor API, including ability to set a target rotation (as opposed to angular velocity)
  208. // note: setMotorTarget sets angular velocity under the hood, so you must call it every tick to
  209. // maintain a given angular target.
  210. void enableMotor(bool enableMotor);
  211. /** set max motor impulse */
  212. void setMaxMotorImpulse(float maxMotorImpulse);
  213. /**
  214. * set motor target
  215. */
  216. void setMotorTarget(const cocos2d::Quaternion& qAinB, float dt);
  217. /** set motor target */
  218. void setMotorTarget(float targetAngle, float dt);
  219. /** set limit */
  220. void setLimit(float low, float high, float _softness = 0.9f, float _biasFactor = 0.3f, float _relaxationFactor = 1.0f);
  221. /**set axis*/
  222. void setAxis(const cocos2d::Vec3& axisInA);
  223. /**get lower limit*/
  224. float getLowerLimit() const;
  225. /**get upper limit*/
  226. float getUpperLimit() const;
  227. /**get hinge angle*/
  228. float getHingeAngle() const;
  229. /**get hinge angle*/
  230. float getHingeAngle(const cocos2d::Mat4& transA, const cocos2d::Mat4& transB);
  231. /**get A's frame */
  232. cocos2d::Mat4 getAFrame() const;
  233. /**get B's frame*/
  234. cocos2d::Mat4 getBFrame() const;
  235. /**get angular only*/
  236. bool getAngularOnly() const;
  237. /**get enable angular motor*/
  238. bool getEnableAngularMotor() const;
  239. /**get motor target velocity*/
  240. float getMotorTargetVelosity() const;
  241. /**get max motor impulse*/
  242. float getMaxMotorImpulse() const;
  243. /** access for UseFrameOffset*/
  244. bool getUseFrameOffset() const;
  245. /**set use frame offset*/
  246. void setUseFrameOffset(bool frameOffsetOnOff);
  247. CC_CONSTRUCTOR_ACCESS:
  248. Physics3DHingeConstraint()
  249. {
  250. _type = ConstraintType::HINGE;
  251. }
  252. virtual ~Physics3DHingeConstraint(){}
  253. };
  254. /**
  255. * It allows the body to rotate around x axis and translate along this axis.
  256. * softness, restitution and damping for different cases
  257. * DirLin - moving inside linear limits
  258. * LimLin - hitting linear limit
  259. * DirAng - moving inside angular limits
  260. * LimAng - hitting angular limit
  261. * OrthoLin, OrthoAng - against constraint axis
  262. */
  263. class CC_DLL Physics3DSliderConstraint : public Physics3DConstraint
  264. {
  265. public:
  266. /**
  267. * create slider constraint
  268. * @param rbA rigid body A
  269. * @param rbB rigid body B
  270. * @param frameInA frame in A's local space
  271. * @param frameInB frame in B's local space
  272. * @param useLinearReferenceFrameA use fixed frame A for linear limits
  273. */
  274. static Physics3DSliderConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Mat4& frameInA, const cocos2d::Mat4& frameInB ,bool useLinearReferenceFrameA);
  275. /**get A's frame offset*/
  276. cocos2d::Mat4 getFrameOffsetA() const;
  277. /**get B's frame offset*/
  278. cocos2d::Mat4 getFrameOffsetB() const;
  279. /**get lower linear limit*/
  280. float getLowerLinLimit() const;
  281. /**set lower linear limit*/
  282. void setLowerLinLimit(float lowerLimit);
  283. /**get upper linear limit*/
  284. float getUpperLinLimit() const;
  285. /**set upper linear limit*/
  286. void setUpperLinLimit(float upperLimit);
  287. /**get lower angular limit*/
  288. float getLowerAngLimit() const;
  289. /**set lower angular limit*/
  290. void setLowerAngLimit(float lowerLimit);
  291. /**get upper angular limit*/
  292. float getUpperAngLimit() const;
  293. /**set upper angular limit*/
  294. void setUpperAngLimit(float upperLimit);
  295. /**use A's frame as linear reference*/
  296. bool getUseLinearReferenceFrameA() const;
  297. float getSoftnessDirLin() const;
  298. float getRestitutionDirLin() const;
  299. float getDampingDirLin() const;
  300. float getSoftnessDirAng() const;
  301. float getRestitutionDirAng() const;
  302. float getDampingDirAng() const;
  303. float getSoftnessLimLin() const;
  304. float getRestitutionLimLin() const;
  305. float getDampingLimLin() const;
  306. float getSoftnessLimAng() const;
  307. float getRestitutionLimAng() const;
  308. float getDampingLimAng() const;
  309. float getSoftnessOrthoLin() const;
  310. float getRestitutionOrthoLin() const;
  311. float getDampingOrthoLin() const;
  312. float getSoftnessOrthoAng() const;
  313. float getRestitutionOrthoAng() const;
  314. float getDampingOrthoAng() const;
  315. void setSoftnessDirLin(float softnessDirLin);
  316. void setRestitutionDirLin(float restitutionDirLin);
  317. void setDampingDirLin(float dampingDirLin);
  318. void setSoftnessDirAng(float softnessDirAng);
  319. void setRestitutionDirAng(float restitutionDirAng);
  320. void setDampingDirAng(float dampingDirAng);
  321. void setSoftnessLimLin(float softnessLimLin);
  322. void setRestitutionLimLin(float restitutionLimLin);
  323. void setDampingLimLin(float dampingLimLin);
  324. void setSoftnessLimAng(float softnessLimAng);
  325. void setRestitutionLimAng(float restitutionLimAng);
  326. void setDampingLimAng(float dampingLimAng);
  327. void setSoftnessOrthoLin(float softnessOrthoLin);
  328. void setRestitutionOrthoLin(float restitutionOrthoLin);
  329. void setDampingOrthoLin(float dampingOrthoLin);
  330. void setSoftnessOrthoAng(float softnessOrthoAng);
  331. void setRestitutionOrthoAng(float restitutionOrthoAng);
  332. void setDampingOrthoAng(float dampingOrthoAng);
  333. void setPoweredLinMotor(bool onOff);
  334. bool getPoweredLinMotor() const;
  335. void setTargetLinMotorVelocity(float targetLinMotorVelocity);
  336. float getTargetLinMotorVelocity() const;
  337. void setMaxLinMotorForce(float maxLinMotorForce);
  338. float getMaxLinMotorForce() const;
  339. void setPoweredAngMotor(bool onOff);
  340. bool getPoweredAngMotor() const;
  341. void setTargetAngMotorVelocity(float targetAngMotorVelocity);
  342. float getTargetAngMotorVelocity() const;
  343. void setMaxAngMotorForce(float maxAngMotorForce);
  344. float getMaxAngMotorForce() const;
  345. float getLinearPos() const;
  346. float getAngularPos() const;
  347. /** access for UseFrameOffset*/
  348. bool getUseFrameOffset() const;
  349. /**set use frame offset*/
  350. void setUseFrameOffset(bool frameOffsetOnOff);
  351. /**set frames for rigid body A and B*/
  352. void setFrames(const cocos2d::Mat4& frameA, const cocos2d::Mat4& frameB);
  353. CC_CONSTRUCTOR_ACCESS:
  354. Physics3DSliderConstraint()
  355. {
  356. _type = ConstraintType::SLIDER;
  357. }
  358. virtual ~Physics3DSliderConstraint(){}
  359. };
  360. /**
  361. * It is a special point to point constraint that adds cone and twist axis limits. The x-axis serves as twist axis.
  362. */
  363. class CC_DLL Physics3DConeTwistConstraint : public Physics3DConstraint
  364. {
  365. public:
  366. /**
  367. * create cone twist constraint
  368. * rbA rigid body A
  369. * frameA A's local frame
  370. */
  371. static Physics3DConeTwistConstraint* create(Physics3DRigidBody* rbA, const cocos2d::Mat4& frameA);
  372. /**
  373. * create cone twist constraint
  374. * rbA rigid body A
  375. * rbB rigid body B
  376. * frameA rigid body A's local frame
  377. * frameB rigid body B's local frame
  378. */
  379. static Physics3DConeTwistConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Mat4& frameA, const cocos2d::Mat4& frameB);
  380. /**
  381. * set limits
  382. * @param swingSpan1 swing span1
  383. * @param swingSpan2 swing span2
  384. * @param twistSpan twist span
  385. * @param softness 0->1, recommend ~0.8->1. Describes % of limits where movement is free. Beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
  386. * @param biasFactor 0->1?, recommend 0.3 +/-0.3 or so. Strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
  387. * @param relaxationFactor 0->1, recommend to stay near 1. the lower the value, the less the constraint will fight velocities which violate the angular limits.
  388. */
  389. void setLimit(float swingSpan1,float swingSpan2,float twistSpan, float softness = 1.f, float biasFactor = 0.3f, float relaxationFactor = 1.0f);
  390. /**get A's frame*/
  391. cocos2d::Mat4 getAFrame() const;
  392. /**get B's frame*/
  393. cocos2d::Mat4 getBFrame() const;
  394. /**get swing span1*/
  395. float getSwingSpan1() const;
  396. /**get swing span2*/
  397. float getSwingSpan2() const;
  398. /**get twist span*/
  399. float getTwistSpan() const;
  400. /**get twist angle*/
  401. float getTwistAngle() const;
  402. /**set damping*/
  403. void setDamping(float damping);
  404. /**enable motor*/
  405. void enableMotor(bool b);
  406. /**set max motor impulse*/
  407. void setMaxMotorImpulse(float maxMotorImpulse);
  408. /**set max motor impulse normalize*/
  409. void setMaxMotorImpulseNormalized(float maxMotorImpulse);
  410. /**get fix thresh*/
  411. float getFixThresh() const;
  412. /**set fix thresh*/
  413. void setFixThresh(float fixThresh);
  414. /**
  415. * setMotorTarget
  416. * @param q the desired rotation of bodyA wrt bodyB. Note: if q violates the joint limits, the internal target is clamped to avoid conflicting impulses (very bad for stability), also don't forget to enableMotor()
  417. */
  418. void setMotorTarget(const btQuaternion &q);
  419. /** setMotorTarget, q is the desired rotation of frameA wrt frameB in constraint space*/
  420. void setMotorTargetInConstraintSpace(const btQuaternion &q);
  421. /**get point for angle*/
  422. cocos2d::Vec3 GetPointForAngle(float fAngleInRadians, float fLength) const;
  423. /**set A and B's frame*/
  424. virtual void setFrames(const cocos2d::Mat4& frameA, const cocos2d::Mat4& frameB);
  425. /**get A's frame offset*/
  426. cocos2d::Mat4 getFrameOffsetA() const;
  427. /**get B's frame offset*/
  428. cocos2d::Mat4 getFrameOffsetB() const;
  429. CC_CONSTRUCTOR_ACCESS:
  430. Physics3DConeTwistConstraint()
  431. {
  432. _type = ConstraintType::CONE_TWIST;
  433. }
  434. virtual ~Physics3DConeTwistConstraint(){}
  435. };
  436. /**
  437. * This generic constraint can emulate a variety of standard constraints, by configuring each of the 6 degrees of freedom (dof).
  438. * The first 3 dof axis are linear axis, which represent translation of rigidbodies, and the latter 3 dof axis represent the angular motion.
  439. * Each axis can be either locked, free or limited. All axis are locked by default.
  440. * For each axis:
  441. * Lowerlimit == Upperlimit -> axis is locked.
  442. * Lowerlimit > Upperlimit -> axis is free
  443. * Lowerlimit < Upperlimit -> axis it limited in that range
  444. */
  445. class CC_DLL Physics3D6DofConstraint : public Physics3DConstraint
  446. {
  447. public:
  448. /**
  449. * create 6 dof constraint
  450. * @param rbA rigid body A
  451. * @param rbB rigid body B
  452. * @param frameInA frame in A's local space
  453. * @param frameInB frame in B's local space
  454. * @param useLinearReferenceFrameA use fixed frame A for linear limits
  455. */
  456. static Physics3D6DofConstraint* create(Physics3DRigidBody* rbA, Physics3DRigidBody* rbB, const cocos2d::Mat4& frameInA, const cocos2d::Mat4& frameInB, bool useLinearReferenceFrameA);
  457. /**
  458. * create 6 dof constraint
  459. * @param rbB rigid body B
  460. * @param frameInB frame in B's local space
  461. * @param useLinearReferenceFrameB use fixed frame B for linear limits
  462. */
  463. static Physics3D6DofConstraint* create(Physics3DRigidBody* rbB, const cocos2d::Mat4& frameInB, bool useLinearReferenceFrameB);
  464. /**set linear lower limit*/
  465. void setLinearLowerLimit(const cocos2d::Vec3& linearLower);
  466. /**get linear lower limit*/
  467. cocos2d::Vec3 getLinearLowerLimit() const;
  468. /**set linear upper limit*/
  469. void setLinearUpperLimit(const cocos2d::Vec3& linearUpper);
  470. /**get linear upper limit*/
  471. cocos2d::Vec3 getLinearUpperLimit() const;
  472. /**set angular lower limit*/
  473. void setAngularLowerLimit(const cocos2d::Vec3& angularLower);
  474. /**get angular lower limit*/
  475. cocos2d::Vec3 getAngularLowerLimit() const;
  476. /**set angular upper limit*/
  477. void setAngularUpperLimit(const cocos2d::Vec3& angularUpper);
  478. /**get angular upper limit*/
  479. cocos2d::Vec3 getAngularUpperLimit() const;
  480. /**
  481. * is limited?
  482. * @param limitIndex first 3 are linear, next 3 are angular
  483. */
  484. bool isLimited(int limitIndex) const;
  485. /** access for UseFrameOffset*/
  486. bool getUseFrameOffset() const;
  487. /**set use frame offset*/
  488. void setUseFrameOffset(bool frameOffsetOnOff) const;
  489. CC_CONSTRUCTOR_ACCESS:
  490. Physics3D6DofConstraint()
  491. {
  492. _type = ConstraintType::SIX_DOF;
  493. }
  494. virtual ~Physics3D6DofConstraint(){}
  495. };
  496. // end of 3d group
  497. /// @}
  498. NS_CC_END
  499. #endif // CC_ENABLE_BULLET_INTEGRATION
  500. #endif // CC_USE_3D_PHYSICS
  501. #endif // __PHYSICS_3D_CONSTRAINT_H__