bullet2.h 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053
  1. /* Copyright (C) 2011 Erwin Coumans & Charlie C
  2. *
  3. * This software is provided 'as-is', without any express or implied
  4. * warranty. In no event will the authors be held liable for any damages
  5. * arising from the use of this software.
  6. *
  7. * Permission is granted to anyone to use this software for any purpose,
  8. * including commercial applications, and to alter it and redistribute it
  9. * freely, subject to the following restrictions:
  10. *
  11. * 1. The origin of this software must not be misrepresented; you must not
  12. * claim that you wrote the original software. If you use this software
  13. * in a product, an acknowledgment in the product documentation would be
  14. * appreciated but is not required.
  15. * 2. Altered source versions must be plainly marked as such, and must not be
  16. * misrepresented as being the original software.
  17. * 3. This notice may not be removed or altered from any source distribution.
  18. */
  19. // Auto generated from Bullet/Extras/HeaderGenerator/bulletGenerate.py
  20. #ifndef __BULLET_H__
  21. #define __BULLET_H__
  22. namespace Bullet3SerializeBullet2 {
  23. // put an empty struct in the case
  24. typedef struct bInvalidHandle {
  25. int unused;
  26. }bInvalidHandle;
  27. class PointerArray;
  28. class b3PhysicsSystem;
  29. class ListBase;
  30. class b3Vector3FloatData;
  31. class b3Vector3DoubleData;
  32. class b3Matrix3x3FloatData;
  33. class b3Matrix3x3DoubleData;
  34. class b3TransformFloatData;
  35. class b3TransformDoubleData;
  36. class b3BvhSubtreeInfoData;
  37. class b3OptimizedBvhNodeFloatData;
  38. class b3OptimizedBvhNodeDoubleData;
  39. class b3QuantizedBvhNodeData;
  40. class b3QuantizedBvhFloatData;
  41. class b3QuantizedBvhDoubleData;
  42. class b3CollisionShapeData;
  43. class b3StaticPlaneShapeData;
  44. class b3ConvexInternalShapeData;
  45. class b3PositionAndRadius;
  46. class b3MultiSphereShapeData;
  47. class b3IntIndexData;
  48. class b3ShortIntIndexData;
  49. class b3ShortIntIndexTripletData;
  50. class b3CharIndexTripletData;
  51. class b3MeshPartData;
  52. class b3StridingMeshInterfaceData;
  53. class b3TriangleMeshShapeData;
  54. class b3ScaledTriangleMeshShapeData;
  55. class b3CompoundShapeChildData;
  56. class b3CompoundShapeData;
  57. class b3CylinderShapeData;
  58. class b3CapsuleShapeData;
  59. class b3TriangleInfoData;
  60. class b3TriangleInfoMapData;
  61. class b3GImpactMeshShapeData;
  62. class b3ConvexHullShapeData;
  63. class b3CollisionObjectDoubleData;
  64. class b3CollisionObjectFloatData;
  65. class b3DynamicsWorldDoubleData;
  66. class b3DynamicsWorldFloatData;
  67. class b3RigidBodyFloatData;
  68. class b3RigidBodyDoubleData;
  69. class b3ConstraintInfo1;
  70. class b3TypedConstraintData;
  71. class b3Point2PointConstraintFloatData;
  72. class b3Point2PointConstraintDoubleData;
  73. class b3HingeConstraintDoubleData;
  74. class b3HingeConstraintFloatData;
  75. class b3ConeTwistConstraintData;
  76. class b3Generic6DofConstraintData;
  77. class b3Generic6DofSpringConstraintData;
  78. class b3SliderConstraintData;
  79. class b3ContactSolverInfoDoubleData;
  80. class b3ContactSolverInfoFloatData;
  81. class SoftBodyMaterialData;
  82. class SoftBodyNodeData;
  83. class SoftBodyLinkData;
  84. class SoftBodyFaceData;
  85. class SoftBodyTetraData;
  86. class SoftRigidAnchorData;
  87. class SoftBodyConfigData;
  88. class SoftBodyPoseData;
  89. class SoftBodyClusterData;
  90. class b3SoftBodyJointData;
  91. class b3SoftBodyFloatData;
  92. // -------------------------------------------------- //
  93. class PointerArray
  94. {
  95. public:
  96. int m_size;
  97. int m_capacity;
  98. void *m_data;
  99. };
  100. // -------------------------------------------------- //
  101. class b3PhysicsSystem
  102. {
  103. public:
  104. PointerArray m_collisionShapes;
  105. PointerArray m_collisionObjects;
  106. PointerArray m_constraints;
  107. };
  108. // -------------------------------------------------- //
  109. class ListBase
  110. {
  111. public:
  112. void *first;
  113. void *last;
  114. };
  115. // -------------------------------------------------- //
  116. class b3Vector3FloatData
  117. {
  118. public:
  119. float m_floats[4];
  120. };
  121. // -------------------------------------------------- //
  122. class b3Vector3DoubleData
  123. {
  124. public:
  125. double m_floats[4];
  126. };
  127. // -------------------------------------------------- //
  128. class b3Matrix3x3FloatData
  129. {
  130. public:
  131. b3Vector3FloatData m_el[3];
  132. };
  133. // -------------------------------------------------- //
  134. class b3Matrix3x3DoubleData
  135. {
  136. public:
  137. b3Vector3DoubleData m_el[3];
  138. };
  139. // -------------------------------------------------- //
  140. class b3TransformFloatData
  141. {
  142. public:
  143. b3Matrix3x3FloatData m_basis;
  144. b3Vector3FloatData m_origin;
  145. };
  146. // -------------------------------------------------- //
  147. class b3TransformDoubleData
  148. {
  149. public:
  150. b3Matrix3x3DoubleData m_basis;
  151. b3Vector3DoubleData m_origin;
  152. };
  153. // -------------------------------------------------- //
  154. class b3BvhSubtreeInfoData
  155. {
  156. public:
  157. int m_rootNodeIndex;
  158. int m_subtreeSize;
  159. short m_quantizedAabbMin[3];
  160. short m_quantizedAabbMax[3];
  161. };
  162. // -------------------------------------------------- //
  163. class b3OptimizedBvhNodeFloatData
  164. {
  165. public:
  166. b3Vector3FloatData m_aabbMinOrg;
  167. b3Vector3FloatData m_aabbMaxOrg;
  168. int m_escapeIndex;
  169. int m_subPart;
  170. int m_triangleIndex;
  171. char m_pad[4];
  172. };
  173. // -------------------------------------------------- //
  174. class b3OptimizedBvhNodeDoubleData
  175. {
  176. public:
  177. b3Vector3DoubleData m_aabbMinOrg;
  178. b3Vector3DoubleData m_aabbMaxOrg;
  179. int m_escapeIndex;
  180. int m_subPart;
  181. int m_triangleIndex;
  182. char m_pad[4];
  183. };
  184. // -------------------------------------------------- //
  185. class b3QuantizedBvhNodeData
  186. {
  187. public:
  188. short m_quantizedAabbMin[3];
  189. short m_quantizedAabbMax[3];
  190. int m_escapeIndexOrTriangleIndex;
  191. };
  192. // -------------------------------------------------- //
  193. class b3QuantizedBvhFloatData
  194. {
  195. public:
  196. b3Vector3FloatData m_bvhAabbMin;
  197. b3Vector3FloatData m_bvhAabbMax;
  198. b3Vector3FloatData m_bvhQuantization;
  199. int m_curNodeIndex;
  200. int m_useQuantization;
  201. int m_numContiguousLeafNodes;
  202. int m_numQuantizedContiguousNodes;
  203. b3OptimizedBvhNodeFloatData *m_contiguousNodesPtr;
  204. b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
  205. b3BvhSubtreeInfoData *m_subTreeInfoPtr;
  206. int m_traversalMode;
  207. int m_numSubtreeHeaders;
  208. };
  209. // -------------------------------------------------- //
  210. class b3QuantizedBvhDoubleData
  211. {
  212. public:
  213. b3Vector3DoubleData m_bvhAabbMin;
  214. b3Vector3DoubleData m_bvhAabbMax;
  215. b3Vector3DoubleData m_bvhQuantization;
  216. int m_curNodeIndex;
  217. int m_useQuantization;
  218. int m_numContiguousLeafNodes;
  219. int m_numQuantizedContiguousNodes;
  220. b3OptimizedBvhNodeDoubleData *m_contiguousNodesPtr;
  221. b3QuantizedBvhNodeData *m_quantizedContiguousNodesPtr;
  222. int m_traversalMode;
  223. int m_numSubtreeHeaders;
  224. b3BvhSubtreeInfoData *m_subTreeInfoPtr;
  225. };
  226. // -------------------------------------------------- //
  227. class b3CollisionShapeData
  228. {
  229. public:
  230. char *m_name;
  231. int m_shapeType;
  232. char m_padding[4];
  233. };
  234. // -------------------------------------------------- //
  235. class b3StaticPlaneShapeData
  236. {
  237. public:
  238. b3CollisionShapeData m_collisionShapeData;
  239. b3Vector3FloatData m_localScaling;
  240. b3Vector3FloatData m_planeNormal;
  241. float m_planeConstant;
  242. char m_pad[4];
  243. };
  244. // -------------------------------------------------- //
  245. class b3ConvexInternalShapeData
  246. {
  247. public:
  248. b3CollisionShapeData m_collisionShapeData;
  249. b3Vector3FloatData m_localScaling;
  250. b3Vector3FloatData m_implicitShapeDimensions;
  251. float m_collisionMargin;
  252. int m_padding;
  253. };
  254. // -------------------------------------------------- //
  255. class b3PositionAndRadius
  256. {
  257. public:
  258. b3Vector3FloatData m_pos;
  259. float m_radius;
  260. };
  261. // -------------------------------------------------- //
  262. class b3MultiSphereShapeData
  263. {
  264. public:
  265. b3ConvexInternalShapeData m_convexInternalShapeData;
  266. b3PositionAndRadius *m_localPositionArrayPtr;
  267. int m_localPositionArraySize;
  268. char m_padding[4];
  269. };
  270. // -------------------------------------------------- //
  271. class b3IntIndexData
  272. {
  273. public:
  274. int m_value;
  275. };
  276. // -------------------------------------------------- //
  277. class b3ShortIntIndexData
  278. {
  279. public:
  280. short m_value;
  281. char m_pad[2];
  282. };
  283. // -------------------------------------------------- //
  284. class b3ShortIntIndexTripletData
  285. {
  286. public:
  287. short m_values[3];
  288. char m_pad[2];
  289. };
  290. // -------------------------------------------------- //
  291. class b3CharIndexTripletData
  292. {
  293. public:
  294. char m_values[3];
  295. char m_pad;
  296. };
  297. // -------------------------------------------------- //
  298. class b3MeshPartData
  299. {
  300. public:
  301. b3Vector3FloatData *m_vertices3f;
  302. b3Vector3DoubleData *m_vertices3d;
  303. b3IntIndexData *m_indices32;
  304. b3ShortIntIndexTripletData *m_3indices16;
  305. b3CharIndexTripletData *m_3indices8;
  306. b3ShortIntIndexData *m_indices16;
  307. int m_numTriangles;
  308. int m_numVertices;
  309. };
  310. // -------------------------------------------------- //
  311. class b3StridingMeshInterfaceData
  312. {
  313. public:
  314. b3MeshPartData *m_meshPartsPtr;
  315. b3Vector3FloatData m_scaling;
  316. int m_numMeshParts;
  317. char m_padding[4];
  318. };
  319. // -------------------------------------------------- //
  320. class b3TriangleMeshShapeData
  321. {
  322. public:
  323. b3CollisionShapeData m_collisionShapeData;
  324. b3StridingMeshInterfaceData m_meshInterface;
  325. b3QuantizedBvhFloatData *m_quantizedFloatBvh;
  326. b3QuantizedBvhDoubleData *m_quantizedDoubleBvh;
  327. b3TriangleInfoMapData *m_triangleInfoMap;
  328. float m_collisionMargin;
  329. char m_pad3[4];
  330. };
  331. // -------------------------------------------------- //
  332. class b3ScaledTriangleMeshShapeData
  333. {
  334. public:
  335. b3TriangleMeshShapeData m_trimeshShapeData;
  336. b3Vector3FloatData m_localScaling;
  337. };
  338. // -------------------------------------------------- //
  339. class b3CompoundShapeChildData
  340. {
  341. public:
  342. b3TransformFloatData m_transform;
  343. b3CollisionShapeData *m_childShape;
  344. int m_childShapeType;
  345. float m_childMargin;
  346. };
  347. // -------------------------------------------------- //
  348. class b3CompoundShapeData
  349. {
  350. public:
  351. b3CollisionShapeData m_collisionShapeData;
  352. b3CompoundShapeChildData *m_childShapePtr;
  353. int m_numChildShapes;
  354. float m_collisionMargin;
  355. };
  356. // -------------------------------------------------- //
  357. class b3CylinderShapeData
  358. {
  359. public:
  360. b3ConvexInternalShapeData m_convexInternalShapeData;
  361. int m_upAxis;
  362. char m_padding[4];
  363. };
  364. // -------------------------------------------------- //
  365. class b3CapsuleShapeData
  366. {
  367. public:
  368. b3ConvexInternalShapeData m_convexInternalShapeData;
  369. int m_upAxis;
  370. char m_padding[4];
  371. };
  372. // -------------------------------------------------- //
  373. class b3TriangleInfoData
  374. {
  375. public:
  376. int m_flags;
  377. float m_edgeV0V1Angle;
  378. float m_edgeV1V2Angle;
  379. float m_edgeV2V0Angle;
  380. };
  381. // -------------------------------------------------- //
  382. class b3TriangleInfoMapData
  383. {
  384. public:
  385. int *m_hashTablePtr;
  386. int *m_nextPtr;
  387. b3TriangleInfoData *m_valueArrayPtr;
  388. int *m_keyArrayPtr;
  389. float m_convexEpsilon;
  390. float m_planarEpsilon;
  391. float m_equalVertexThreshold;
  392. float m_edgeDistanceThreshold;
  393. float m_zeroAreaThreshold;
  394. int m_nextSize;
  395. int m_hashTableSize;
  396. int m_numValues;
  397. int m_numKeys;
  398. char m_padding[4];
  399. };
  400. // -------------------------------------------------- //
  401. class b3GImpactMeshShapeData
  402. {
  403. public:
  404. b3CollisionShapeData m_collisionShapeData;
  405. b3StridingMeshInterfaceData m_meshInterface;
  406. b3Vector3FloatData m_localScaling;
  407. float m_collisionMargin;
  408. int m_gimpactSubType;
  409. };
  410. // -------------------------------------------------- //
  411. class b3ConvexHullShapeData
  412. {
  413. public:
  414. b3ConvexInternalShapeData m_convexInternalShapeData;
  415. b3Vector3FloatData *m_unscaledPointsFloatPtr;
  416. b3Vector3DoubleData *m_unscaledPointsDoublePtr;
  417. int m_numUnscaledPoints;
  418. char m_padding3[4];
  419. };
  420. // -------------------------------------------------- //
  421. class b3CollisionObjectDoubleData
  422. {
  423. public:
  424. void *m_broadphaseHandle;
  425. void *m_collisionShape;
  426. b3CollisionShapeData *m_rootCollisionShape;
  427. char *m_name;
  428. b3TransformDoubleData m_worldTransform;
  429. b3TransformDoubleData m_interpolationWorldTransform;
  430. b3Vector3DoubleData m_interpolationLinearVelocity;
  431. b3Vector3DoubleData m_interpolationAngularVelocity;
  432. b3Vector3DoubleData m_anisotropicFriction;
  433. double m_contactProcessingThreshold;
  434. double m_deactivationTime;
  435. double m_friction;
  436. double m_rollingFriction;
  437. double m_restitution;
  438. double m_hitFraction;
  439. double m_ccdSweptSphereRadius;
  440. double m_ccdMotionThreshold;
  441. int m_hasAnisotropicFriction;
  442. int m_collisionFlags;
  443. int m_islandTag1;
  444. int m_companionId;
  445. int m_activationState1;
  446. int m_internalType;
  447. int m_checkCollideWith;
  448. char m_padding[4];
  449. };
  450. // -------------------------------------------------- //
  451. class b3CollisionObjectFloatData
  452. {
  453. public:
  454. void *m_broadphaseHandle;
  455. void *m_collisionShape;
  456. b3CollisionShapeData *m_rootCollisionShape;
  457. char *m_name;
  458. b3TransformFloatData m_worldTransform;
  459. b3TransformFloatData m_interpolationWorldTransform;
  460. b3Vector3FloatData m_interpolationLinearVelocity;
  461. b3Vector3FloatData m_interpolationAngularVelocity;
  462. b3Vector3FloatData m_anisotropicFriction;
  463. float m_contactProcessingThreshold;
  464. float m_deactivationTime;
  465. float m_friction;
  466. float m_rollingFriction;
  467. float m_restitution;
  468. float m_hitFraction;
  469. float m_ccdSweptSphereRadius;
  470. float m_ccdMotionThreshold;
  471. int m_hasAnisotropicFriction;
  472. int m_collisionFlags;
  473. int m_islandTag1;
  474. int m_companionId;
  475. int m_activationState1;
  476. int m_internalType;
  477. int m_checkCollideWith;
  478. char m_padding[4];
  479. };
  480. // -------------------------------------------------- //
  481. class b3RigidBodyFloatData
  482. {
  483. public:
  484. b3CollisionObjectFloatData m_collisionObjectData;
  485. b3Matrix3x3FloatData m_invInertiaTensorWorld;
  486. b3Vector3FloatData m_linearVelocity;
  487. b3Vector3FloatData m_angularVelocity;
  488. b3Vector3FloatData m_angularFactor;
  489. b3Vector3FloatData m_linearFactor;
  490. b3Vector3FloatData m_gravity;
  491. b3Vector3FloatData m_gravity_acceleration;
  492. b3Vector3FloatData m_invInertiaLocal;
  493. b3Vector3FloatData m_totalForce;
  494. b3Vector3FloatData m_totalTorque;
  495. float m_inverseMass;
  496. float m_linearDamping;
  497. float m_angularDamping;
  498. float m_additionalDampingFactor;
  499. float m_additionalLinearDampingThresholdSqr;
  500. float m_additionalAngularDampingThresholdSqr;
  501. float m_additionalAngularDampingFactor;
  502. float m_linearSleepingThreshold;
  503. float m_angularSleepingThreshold;
  504. int m_additionalDamping;
  505. };
  506. // -------------------------------------------------- //
  507. class b3RigidBodyDoubleData
  508. {
  509. public:
  510. b3CollisionObjectDoubleData m_collisionObjectData;
  511. b3Matrix3x3DoubleData m_invInertiaTensorWorld;
  512. b3Vector3DoubleData m_linearVelocity;
  513. b3Vector3DoubleData m_angularVelocity;
  514. b3Vector3DoubleData m_angularFactor;
  515. b3Vector3DoubleData m_linearFactor;
  516. b3Vector3DoubleData m_gravity;
  517. b3Vector3DoubleData m_gravity_acceleration;
  518. b3Vector3DoubleData m_invInertiaLocal;
  519. b3Vector3DoubleData m_totalForce;
  520. b3Vector3DoubleData m_totalTorque;
  521. double m_inverseMass;
  522. double m_linearDamping;
  523. double m_angularDamping;
  524. double m_additionalDampingFactor;
  525. double m_additionalLinearDampingThresholdSqr;
  526. double m_additionalAngularDampingThresholdSqr;
  527. double m_additionalAngularDampingFactor;
  528. double m_linearSleepingThreshold;
  529. double m_angularSleepingThreshold;
  530. int m_additionalDamping;
  531. char m_padding[4];
  532. };
  533. // -------------------------------------------------- //
  534. class b3ConstraintInfo1
  535. {
  536. public:
  537. int m_numConstraintRows;
  538. int nub;
  539. };
  540. // -------------------------------------------------- //
  541. class b3TypedConstraintData
  542. {
  543. public:
  544. bInvalidHandle *m_rbA;
  545. bInvalidHandle *m_rbB;
  546. char *m_name;
  547. int m_objectType;
  548. int m_userConstraintType;
  549. int m_userConstraintId;
  550. int m_needsFeedback;
  551. float m_appliedImpulse;
  552. float m_dbgDrawSize;
  553. int m_disableCollisionsBetweenLinkedBodies;
  554. int m_overrideNumSolverIterations;
  555. float m_breakingImpulseThreshold;
  556. int m_isEnabled;
  557. };
  558. // -------------------------------------------------- //
  559. class b3Point2PointConstraintFloatData
  560. {
  561. public:
  562. b3TypedConstraintData m_typeConstraintData;
  563. b3Vector3FloatData m_pivotInA;
  564. b3Vector3FloatData m_pivotInB;
  565. };
  566. // -------------------------------------------------- //
  567. class b3Point2PointConstraintDoubleData
  568. {
  569. public:
  570. b3TypedConstraintData m_typeConstraintData;
  571. b3Vector3DoubleData m_pivotInA;
  572. b3Vector3DoubleData m_pivotInB;
  573. };
  574. // -------------------------------------------------- //
  575. class b3HingeConstraintDoubleData
  576. {
  577. public:
  578. b3TypedConstraintData m_typeConstraintData;
  579. b3TransformDoubleData m_rbAFrame;
  580. b3TransformDoubleData m_rbBFrame;
  581. int m_useReferenceFrameA;
  582. int m_angularOnly;
  583. int m_enableAngularMotor;
  584. float m_motorTargetVelocity;
  585. float m_maxMotorImpulse;
  586. float m_lowerLimit;
  587. float m_upperLimit;
  588. float m_limitSoftness;
  589. float m_biasFactor;
  590. float m_relaxationFactor;
  591. };
  592. // -------------------------------------------------- //
  593. class b3HingeConstraintFloatData
  594. {
  595. public:
  596. b3TypedConstraintData m_typeConstraintData;
  597. b3TransformFloatData m_rbAFrame;
  598. b3TransformFloatData m_rbBFrame;
  599. int m_useReferenceFrameA;
  600. int m_angularOnly;
  601. int m_enableAngularMotor;
  602. float m_motorTargetVelocity;
  603. float m_maxMotorImpulse;
  604. float m_lowerLimit;
  605. float m_upperLimit;
  606. float m_limitSoftness;
  607. float m_biasFactor;
  608. float m_relaxationFactor;
  609. };
  610. // -------------------------------------------------- //
  611. class b3ConeTwistConstraintData
  612. {
  613. public:
  614. b3TypedConstraintData m_typeConstraintData;
  615. b3TransformFloatData m_rbAFrame;
  616. b3TransformFloatData m_rbBFrame;
  617. float m_swingSpan1;
  618. float m_swingSpan2;
  619. float m_twistSpan;
  620. float m_limitSoftness;
  621. float m_biasFactor;
  622. float m_relaxationFactor;
  623. float m_damping;
  624. char m_pad[4];
  625. };
  626. // -------------------------------------------------- //
  627. class b3Generic6DofConstraintData
  628. {
  629. public:
  630. b3TypedConstraintData m_typeConstraintData;
  631. b3TransformFloatData m_rbAFrame;
  632. b3TransformFloatData m_rbBFrame;
  633. b3Vector3FloatData m_linearUpperLimit;
  634. b3Vector3FloatData m_linearLowerLimit;
  635. b3Vector3FloatData m_angularUpperLimit;
  636. b3Vector3FloatData m_angularLowerLimit;
  637. int m_useLinearReferenceFrameA;
  638. int m_useOffsetForConstraintFrame;
  639. };
  640. // -------------------------------------------------- //
  641. class b3Generic6DofSpringConstraintData
  642. {
  643. public:
  644. b3Generic6DofConstraintData m_6dofData;
  645. int m_springEnabled[6];
  646. float m_equilibriumPoint[6];
  647. float m_springStiffness[6];
  648. float m_springDamping[6];
  649. };
  650. // -------------------------------------------------- //
  651. class b3SliderConstraintData
  652. {
  653. public:
  654. b3TypedConstraintData m_typeConstraintData;
  655. b3TransformFloatData m_rbAFrame;
  656. b3TransformFloatData m_rbBFrame;
  657. float m_linearUpperLimit;
  658. float m_linearLowerLimit;
  659. float m_angularUpperLimit;
  660. float m_angularLowerLimit;
  661. int m_useLinearReferenceFrameA;
  662. int m_useOffsetForConstraintFrame;
  663. };
  664. // -------------------------------------------------- //
  665. class b3ContactSolverInfoDoubleData
  666. {
  667. public:
  668. double m_tau;
  669. double m_damping;
  670. double m_friction;
  671. double m_timeStep;
  672. double m_restitution;
  673. double m_maxErrorReduction;
  674. double m_sor;
  675. double m_erp;
  676. double m_erp2;
  677. double m_globalCfm;
  678. double m_splitImpulsePenetrationThreshold;
  679. double m_splitImpulseTurnErp;
  680. double m_linearSlop;
  681. double m_warmstartingFactor;
  682. double m_maxGyroscopicForce;
  683. double m_singleAxisRollingFrictionThreshold;
  684. int m_numIterations;
  685. int m_solverMode;
  686. int m_restingContactRestitutionThreshold;
  687. int m_minimumSolverBatchSize;
  688. int m_splitImpulse;
  689. char m_padding[4];
  690. };
  691. // -------------------------------------------------- //
  692. class b3ContactSolverInfoFloatData
  693. {
  694. public:
  695. float m_tau;
  696. float m_damping;
  697. float m_friction;
  698. float m_timeStep;
  699. float m_restitution;
  700. float m_maxErrorReduction;
  701. float m_sor;
  702. float m_erp;
  703. float m_erp2;
  704. float m_globalCfm;
  705. float m_splitImpulsePenetrationThreshold;
  706. float m_splitImpulseTurnErp;
  707. float m_linearSlop;
  708. float m_warmstartingFactor;
  709. float m_maxGyroscopicForce;
  710. float m_singleAxisRollingFrictionThreshold;
  711. int m_numIterations;
  712. int m_solverMode;
  713. int m_restingContactRestitutionThreshold;
  714. int m_minimumSolverBatchSize;
  715. int m_splitImpulse;
  716. char m_padding[4];
  717. };
  718. // -------------------------------------------------- //
  719. class b3DynamicsWorldDoubleData
  720. {
  721. public:
  722. b3ContactSolverInfoDoubleData m_solverInfo;
  723. b3Vector3DoubleData m_gravity;
  724. };
  725. // -------------------------------------------------- //
  726. class b3DynamicsWorldFloatData
  727. {
  728. public:
  729. b3ContactSolverInfoFloatData m_solverInfo;
  730. b3Vector3FloatData m_gravity;
  731. };
  732. // -------------------------------------------------- //
  733. class SoftBodyMaterialData
  734. {
  735. public:
  736. float m_linearStiffness;
  737. float m_angularStiffness;
  738. float m_volumeStiffness;
  739. int m_flags;
  740. };
  741. // -------------------------------------------------- //
  742. class SoftBodyNodeData
  743. {
  744. public:
  745. SoftBodyMaterialData *m_material;
  746. b3Vector3FloatData m_position;
  747. b3Vector3FloatData m_previousPosition;
  748. b3Vector3FloatData m_velocity;
  749. b3Vector3FloatData m_accumulatedForce;
  750. b3Vector3FloatData m_normal;
  751. float m_inverseMass;
  752. float m_area;
  753. int m_attach;
  754. int m_pad;
  755. };
  756. // -------------------------------------------------- //
  757. class SoftBodyLinkData
  758. {
  759. public:
  760. SoftBodyMaterialData *m_material;
  761. int m_nodeIndices[2];
  762. float m_restLength;
  763. int m_bbending;
  764. };
  765. // -------------------------------------------------- //
  766. class SoftBodyFaceData
  767. {
  768. public:
  769. b3Vector3FloatData m_normal;
  770. SoftBodyMaterialData *m_material;
  771. int m_nodeIndices[3];
  772. float m_restArea;
  773. };
  774. // -------------------------------------------------- //
  775. class SoftBodyTetraData
  776. {
  777. public:
  778. b3Vector3FloatData m_c0[4];
  779. SoftBodyMaterialData *m_material;
  780. int m_nodeIndices[4];
  781. float m_restVolume;
  782. float m_c1;
  783. float m_c2;
  784. int m_pad;
  785. };
  786. // -------------------------------------------------- //
  787. class SoftRigidAnchorData
  788. {
  789. public:
  790. b3Matrix3x3FloatData m_c0;
  791. b3Vector3FloatData m_c1;
  792. b3Vector3FloatData m_localFrame;
  793. bInvalidHandle *m_rigidBody;
  794. int m_nodeIndex;
  795. float m_c2;
  796. };
  797. // -------------------------------------------------- //
  798. class SoftBodyConfigData
  799. {
  800. public:
  801. int m_aeroModel;
  802. float m_baumgarte;
  803. float m_damping;
  804. float m_drag;
  805. float m_lift;
  806. float m_pressure;
  807. float m_volume;
  808. float m_dynamicFriction;
  809. float m_poseMatch;
  810. float m_rigidContactHardness;
  811. float m_kineticContactHardness;
  812. float m_softContactHardness;
  813. float m_anchorHardness;
  814. float m_softRigidClusterHardness;
  815. float m_softKineticClusterHardness;
  816. float m_softSoftClusterHardness;
  817. float m_softRigidClusterImpulseSplit;
  818. float m_softKineticClusterImpulseSplit;
  819. float m_softSoftClusterImpulseSplit;
  820. float m_maxVolume;
  821. float m_timeScale;
  822. int m_velocityIterations;
  823. int m_positionIterations;
  824. int m_driftIterations;
  825. int m_clusterIterations;
  826. int m_collisionFlags;
  827. };
  828. // -------------------------------------------------- //
  829. class SoftBodyPoseData
  830. {
  831. public:
  832. b3Matrix3x3FloatData m_rot;
  833. b3Matrix3x3FloatData m_scale;
  834. b3Matrix3x3FloatData m_aqq;
  835. b3Vector3FloatData m_com;
  836. b3Vector3FloatData *m_positions;
  837. float *m_weights;
  838. int m_numPositions;
  839. int m_numWeigts;
  840. int m_bvolume;
  841. int m_bframe;
  842. float m_restVolume;
  843. int m_pad;
  844. };
  845. // -------------------------------------------------- //
  846. class SoftBodyClusterData
  847. {
  848. public:
  849. b3TransformFloatData m_framexform;
  850. b3Matrix3x3FloatData m_locii;
  851. b3Matrix3x3FloatData m_invwi;
  852. b3Vector3FloatData m_com;
  853. b3Vector3FloatData m_vimpulses[2];
  854. b3Vector3FloatData m_dimpulses[2];
  855. b3Vector3FloatData m_lv;
  856. b3Vector3FloatData m_av;
  857. b3Vector3FloatData *m_framerefs;
  858. int *m_nodeIndices;
  859. float *m_masses;
  860. int m_numFrameRefs;
  861. int m_numNodes;
  862. int m_numMasses;
  863. float m_idmass;
  864. float m_imass;
  865. int m_nvimpulses;
  866. int m_ndimpulses;
  867. float m_ndamping;
  868. float m_ldamping;
  869. float m_adamping;
  870. float m_matching;
  871. float m_maxSelfCollisionImpulse;
  872. float m_selfCollisionImpulseFactor;
  873. int m_containsAnchor;
  874. int m_collide;
  875. int m_clusterIndex;
  876. };
  877. // -------------------------------------------------- //
  878. class b3SoftBodyJointData
  879. {
  880. public:
  881. void *m_bodyA;
  882. void *m_bodyB;
  883. b3Vector3FloatData m_refs[2];
  884. float m_cfm;
  885. float m_erp;
  886. float m_split;
  887. int m_delete;
  888. b3Vector3FloatData m_relPosition[2];
  889. int m_bodyAtype;
  890. int m_bodyBtype;
  891. int m_jointType;
  892. int m_pad;
  893. };
  894. // -------------------------------------------------- //
  895. class b3SoftBodyFloatData
  896. {
  897. public:
  898. b3CollisionObjectFloatData m_collisionObjectData;
  899. SoftBodyPoseData *m_pose;
  900. SoftBodyMaterialData **m_materials;
  901. SoftBodyNodeData *m_nodes;
  902. SoftBodyLinkData *m_links;
  903. SoftBodyFaceData *m_faces;
  904. SoftBodyTetraData *m_tetrahedra;
  905. SoftRigidAnchorData *m_anchors;
  906. SoftBodyClusterData *m_clusters;
  907. b3SoftBodyJointData *m_joints;
  908. int m_numMaterials;
  909. int m_numNodes;
  910. int m_numLinks;
  911. int m_numFaces;
  912. int m_numTetrahedra;
  913. int m_numAnchors;
  914. int m_numClusters;
  915. int m_numJoints;
  916. SoftBodyConfigData m_config;
  917. };
  918. }
  919. #endif//__BULLET_H__