bullet2.h 23 KB

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