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 Bullet { 23 24 // put an empty struct in the case 25 typedef struct bInvalidHandle { 26 int unused; 27 }bInvalidHandle; 28 29 class PointerArray; 30 class btPhysicsSystem; 31 class ListBase; 32 class btVector3FloatData; 33 class btVector3DoubleData; 34 class btQuaternionFloatData; 35 class btQuaternionDoubleData; 36 class btMatrix3x3FloatData; 37 class btMatrix3x3DoubleData; 38 class btTransformFloatData; 39 class btTransformDoubleData; 40 class btBvhSubtreeInfoData; 41 class btOptimizedBvhNodeFloatData; 42 class btOptimizedBvhNodeDoubleData; 43 class btQuantizedBvhNodeData; 44 class btQuantizedBvhFloatData; 45 class btQuantizedBvhDoubleData; 46 class btCollisionShapeData; 47 class btStaticPlaneShapeData; 48 class btConvexInternalShapeData; 49 class btPositionAndRadius; 50 class btMultiSphereShapeData; 51 class btIntIndexData; 52 class btShortIntIndexData; 53 class btShortIntIndexTripletData; 54 class btCharIndexTripletData; 55 class btMeshPartData; 56 class btStridingMeshInterfaceData; 57 class btTriangleMeshShapeData; 58 class btScaledTriangleMeshShapeData; 59 class btCompoundShapeChildData; 60 class btCompoundShapeData; 61 class btCylinderShapeData; 62 class btConeShapeData; 63 class btCapsuleShapeData; 64 class btTriangleInfoData; 65 class btTriangleInfoMapData; 66 class btGImpactMeshShapeData; 67 class btConvexHullShapeData; 68 class btCollisionObjectDoubleData; 69 class btCollisionObjectFloatData; 70 class btDynamicsWorldDoubleData; 71 class btDynamicsWorldFloatData; 72 class btRigidBodyFloatData; 73 class btRigidBodyDoubleData; 74 class btConstraintInfo1; 75 class btTypedConstraintFloatData; 76 class btTypedConstraintData; 77 class btTypedConstraintDoubleData; 78 class btPoint2PointConstraintFloatData; 79 class btPoint2PointConstraintDoubleData2; 80 class btPoint2PointConstraintDoubleData; 81 class btHingeConstraintDoubleData; 82 class btHingeConstraintFloatData; 83 class btHingeConstraintDoubleData2; 84 class btConeTwistConstraintDoubleData; 85 class btConeTwistConstraintData; 86 class btGeneric6DofConstraintData; 87 class btGeneric6DofConstraintDoubleData2; 88 class btGeneric6DofSpringConstraintData; 89 class btGeneric6DofSpringConstraintDoubleData2; 90 class btGeneric6DofSpring2ConstraintData; 91 class btGeneric6DofSpring2ConstraintDoubleData2; 92 class btSliderConstraintData; 93 class btSliderConstraintDoubleData; 94 class btGearConstraintFloatData; 95 class btGearConstraintDoubleData; 96 class btContactSolverInfoDoubleData; 97 class btContactSolverInfoFloatData; 98 class SoftBodyMaterialData; 99 class SoftBodyNodeData; 100 class SoftBodyLinkData; 101 class SoftBodyFaceData; 102 class SoftBodyTetraData; 103 class SoftRigidAnchorData; 104 class SoftBodyConfigData; 105 class SoftBodyPoseData; 106 class SoftBodyClusterData; 107 class btSoftBodyJointData; 108 class btSoftBodyFloatData; 109 class btMultiBodyLinkDoubleData; 110 class btMultiBodyLinkFloatData; 111 class btMultiBodyDoubleData; 112 class btMultiBodyFloatData; 113 // -------------------------------------------------- // 114 class PointerArray 115 { 116 public: 117 int m_size; 118 int m_capacity; 119 void *m_data; 120 }; 121 122 123 // -------------------------------------------------- // 124 class btPhysicsSystem 125 { 126 public: 127 PointerArray m_collisionShapes; 128 PointerArray m_collisionObjects; 129 PointerArray m_constraints; 130 }; 131 132 133 // -------------------------------------------------- // 134 class ListBase 135 { 136 public: 137 void *first; 138 void *last; 139 }; 140 141 142 // -------------------------------------------------- // 143 class btVector3FloatData 144 { 145 public: 146 float m_floats[4]; 147 }; 148 149 150 // -------------------------------------------------- // 151 class btVector3DoubleData 152 { 153 public: 154 double m_floats[4]; 155 }; 156 157 158 // -------------------------------------------------- // 159 class btQuaternionFloatData 160 { 161 public: 162 float m_floats[4]; 163 }; 164 165 166 // -------------------------------------------------- // 167 class btQuaternionDoubleData 168 { 169 public: 170 double m_floats[4]; 171 }; 172 173 174 // -------------------------------------------------- // 175 class btMatrix3x3FloatData 176 { 177 public: 178 btVector3FloatData m_el[3]; 179 }; 180 181 182 // -------------------------------------------------- // 183 class btMatrix3x3DoubleData 184 { 185 public: 186 btVector3DoubleData m_el[3]; 187 }; 188 189 190 // -------------------------------------------------- // 191 class btTransformFloatData 192 { 193 public: 194 btMatrix3x3FloatData m_basis; 195 btVector3FloatData m_origin; 196 }; 197 198 199 // -------------------------------------------------- // 200 class btTransformDoubleData 201 { 202 public: 203 btMatrix3x3DoubleData m_basis; 204 btVector3DoubleData m_origin; 205 }; 206 207 208 // -------------------------------------------------- // 209 class btBvhSubtreeInfoData 210 { 211 public: 212 int m_rootNodeIndex; 213 int m_subtreeSize; 214 short m_quantizedAabbMin[3]; 215 short m_quantizedAabbMax[3]; 216 }; 217 218 219 // -------------------------------------------------- // 220 class btOptimizedBvhNodeFloatData 221 { 222 public: 223 btVector3FloatData m_aabbMinOrg; 224 btVector3FloatData m_aabbMaxOrg; 225 int m_escapeIndex; 226 int m_subPart; 227 int m_triangleIndex; 228 char m_pad[4]; 229 }; 230 231 232 // -------------------------------------------------- // 233 class btOptimizedBvhNodeDoubleData 234 { 235 public: 236 btVector3DoubleData m_aabbMinOrg; 237 btVector3DoubleData m_aabbMaxOrg; 238 int m_escapeIndex; 239 int m_subPart; 240 int m_triangleIndex; 241 char m_pad[4]; 242 }; 243 244 245 // -------------------------------------------------- // 246 class btQuantizedBvhNodeData 247 { 248 public: 249 short m_quantizedAabbMin[3]; 250 short m_quantizedAabbMax[3]; 251 int m_escapeIndexOrTriangleIndex; 252 }; 253 254 255 // -------------------------------------------------- // 256 class btQuantizedBvhFloatData 257 { 258 public: 259 btVector3FloatData m_bvhAabbMin; 260 btVector3FloatData m_bvhAabbMax; 261 btVector3FloatData m_bvhQuantization; 262 int m_curNodeIndex; 263 int m_useQuantization; 264 int m_numContiguousLeafNodes; 265 int m_numQuantizedContiguousNodes; 266 btOptimizedBvhNodeFloatData *m_contiguousNodesPtr; 267 btQuantizedBvhNodeData *m_quantizedContiguousNodesPtr; 268 btBvhSubtreeInfoData *m_subTreeInfoPtr; 269 int m_traversalMode; 270 int m_numSubtreeHeaders; 271 }; 272 273 274 // -------------------------------------------------- // 275 class btQuantizedBvhDoubleData 276 { 277 public: 278 btVector3DoubleData m_bvhAabbMin; 279 btVector3DoubleData m_bvhAabbMax; 280 btVector3DoubleData m_bvhQuantization; 281 int m_curNodeIndex; 282 int m_useQuantization; 283 int m_numContiguousLeafNodes; 284 int m_numQuantizedContiguousNodes; 285 btOptimizedBvhNodeDoubleData *m_contiguousNodesPtr; 286 btQuantizedBvhNodeData *m_quantizedContiguousNodesPtr; 287 int m_traversalMode; 288 int m_numSubtreeHeaders; 289 btBvhSubtreeInfoData *m_subTreeInfoPtr; 290 }; 291 292 293 // -------------------------------------------------- // 294 class btCollisionShapeData 295 { 296 public: 297 char *m_name; 298 int m_shapeType; 299 char m_padding[4]; 300 }; 301 302 303 // -------------------------------------------------- // 304 class btStaticPlaneShapeData 305 { 306 public: 307 btCollisionShapeData m_collisionShapeData; 308 btVector3FloatData m_localScaling; 309 btVector3FloatData m_planeNormal; 310 float m_planeConstant; 311 char m_pad[4]; 312 }; 313 314 315 // -------------------------------------------------- // 316 class btConvexInternalShapeData 317 { 318 public: 319 btCollisionShapeData m_collisionShapeData; 320 btVector3FloatData m_localScaling; 321 btVector3FloatData m_implicitShapeDimensions; 322 float m_collisionMargin; 323 int m_padding; 324 }; 325 326 327 // -------------------------------------------------- // 328 class btPositionAndRadius 329 { 330 public: 331 btVector3FloatData m_pos; 332 float m_radius; 333 }; 334 335 336 // -------------------------------------------------- // 337 class btMultiSphereShapeData 338 { 339 public: 340 btConvexInternalShapeData m_convexInternalShapeData; 341 btPositionAndRadius *m_localPositionArrayPtr; 342 int m_localPositionArraySize; 343 char m_padding[4]; 344 }; 345 346 347 // -------------------------------------------------- // 348 class btIntIndexData 349 { 350 public: 351 int m_value; 352 }; 353 354 355 // -------------------------------------------------- // 356 class btShortIntIndexData 357 { 358 public: 359 short m_value; 360 char m_pad[2]; 361 }; 362 363 364 // -------------------------------------------------- // 365 class btShortIntIndexTripletData 366 { 367 public: 368 short m_values[3]; 369 char m_pad[2]; 370 }; 371 372 373 // -------------------------------------------------- // 374 class btCharIndexTripletData 375 { 376 public: 377 char m_values[3]; 378 char m_pad; 379 }; 380 381 382 // -------------------------------------------------- // 383 class btMeshPartData 384 { 385 public: 386 btVector3FloatData *m_vertices3f; 387 btVector3DoubleData *m_vertices3d; 388 btIntIndexData *m_indices32; 389 btShortIntIndexTripletData *m_3indices16; 390 btCharIndexTripletData *m_3indices8; 391 btShortIntIndexData *m_indices16; 392 int m_numTriangles; 393 int m_numVertices; 394 }; 395 396 397 // -------------------------------------------------- // 398 class btStridingMeshInterfaceData 399 { 400 public: 401 btMeshPartData *m_meshPartsPtr; 402 btVector3FloatData m_scaling; 403 int m_numMeshParts; 404 char m_padding[4]; 405 }; 406 407 408 // -------------------------------------------------- // 409 class btTriangleMeshShapeData 410 { 411 public: 412 btCollisionShapeData m_collisionShapeData; 413 btStridingMeshInterfaceData m_meshInterface; 414 btQuantizedBvhFloatData *m_quantizedFloatBvh; 415 btQuantizedBvhDoubleData *m_quantizedDoubleBvh; 416 btTriangleInfoMapData *m_triangleInfoMap; 417 float m_collisionMargin; 418 char m_pad3[4]; 419 }; 420 421 422 // -------------------------------------------------- // 423 class btScaledTriangleMeshShapeData 424 { 425 public: 426 btTriangleMeshShapeData m_trimeshShapeData; 427 btVector3FloatData m_localScaling; 428 }; 429 430 431 // -------------------------------------------------- // 432 class btCompoundShapeChildData 433 { 434 public: 435 btTransformFloatData m_transform; 436 btCollisionShapeData *m_childShape; 437 int m_childShapeType; 438 float m_childMargin; 439 }; 440 441 442 // -------------------------------------------------- // 443 class btCompoundShapeData 444 { 445 public: 446 btCollisionShapeData m_collisionShapeData; 447 btCompoundShapeChildData *m_childShapePtr; 448 int m_numChildShapes; 449 float m_collisionMargin; 450 }; 451 452 453 // -------------------------------------------------- // 454 class btCylinderShapeData 455 { 456 public: 457 btConvexInternalShapeData m_convexInternalShapeData; 458 int m_upAxis; 459 char m_padding[4]; 460 }; 461 462 463 // -------------------------------------------------- // 464 class btConeShapeData 465 { 466 public: 467 btConvexInternalShapeData m_convexInternalShapeData; 468 int m_upIndex; 469 char m_padding[4]; 470 }; 471 472 473 // -------------------------------------------------- // 474 class btCapsuleShapeData 475 { 476 public: 477 btConvexInternalShapeData m_convexInternalShapeData; 478 int m_upAxis; 479 char m_padding[4]; 480 }; 481 482 483 // -------------------------------------------------- // 484 class btTriangleInfoData 485 { 486 public: 487 int m_flags; 488 float m_edgeV0V1Angle; 489 float m_edgeV1V2Angle; 490 float m_edgeV2V0Angle; 491 }; 492 493 494 // -------------------------------------------------- // 495 class btTriangleInfoMapData 496 { 497 public: 498 int *m_hashTablePtr; 499 int *m_nextPtr; 500 btTriangleInfoData *m_valueArrayPtr; 501 int *m_keyArrayPtr; 502 float m_convexEpsilon; 503 float m_planarEpsilon; 504 float m_equalVertexThreshold; 505 float m_edgeDistanceThreshold; 506 float m_zeroAreaThreshold; 507 int m_nextSize; 508 int m_hashTableSize; 509 int m_numValues; 510 int m_numKeys; 511 char m_padding[4]; 512 }; 513 514 515 // -------------------------------------------------- // 516 class btGImpactMeshShapeData 517 { 518 public: 519 btCollisionShapeData m_collisionShapeData; 520 btStridingMeshInterfaceData m_meshInterface; 521 btVector3FloatData m_localScaling; 522 float m_collisionMargin; 523 int m_gimpactSubType; 524 }; 525 526 527 // -------------------------------------------------- // 528 class btConvexHullShapeData 529 { 530 public: 531 btConvexInternalShapeData m_convexInternalShapeData; 532 btVector3FloatData *m_unscaledPointsFloatPtr; 533 btVector3DoubleData *m_unscaledPointsDoublePtr; 534 int m_numUnscaledPoints; 535 char m_padding3[4]; 536 }; 537 538 539 // -------------------------------------------------- // 540 class btCollisionObjectDoubleData 541 { 542 public: 543 void *m_broadphaseHandle; 544 void *m_collisionShape; 545 btCollisionShapeData *m_rootCollisionShape; 546 char *m_name; 547 btTransformDoubleData m_worldTransform; 548 btTransformDoubleData m_interpolationWorldTransform; 549 btVector3DoubleData m_interpolationLinearVelocity; 550 btVector3DoubleData m_interpolationAngularVelocity; 551 btVector3DoubleData m_anisotropicFriction; 552 double m_contactProcessingThreshold; 553 double m_deactivationTime; 554 double m_friction; 555 double m_rollingFriction; 556 double m_restitution; 557 double m_hitFraction; 558 double m_ccdSweptSphereRadius; 559 double m_ccdMotionThreshold; 560 int m_hasAnisotropicFriction; 561 int m_collisionFlags; 562 int m_islandTag1; 563 int m_companionId; 564 int m_activationState1; 565 int m_internalType; 566 int m_checkCollideWith; 567 char m_padding[4]; 568 }; 569 570 571 // -------------------------------------------------- // 572 class btCollisionObjectFloatData 573 { 574 public: 575 void *m_broadphaseHandle; 576 void *m_collisionShape; 577 btCollisionShapeData *m_rootCollisionShape; 578 char *m_name; 579 btTransformFloatData m_worldTransform; 580 btTransformFloatData m_interpolationWorldTransform; 581 btVector3FloatData m_interpolationLinearVelocity; 582 btVector3FloatData m_interpolationAngularVelocity; 583 btVector3FloatData m_anisotropicFriction; 584 float m_contactProcessingThreshold; 585 float m_deactivationTime; 586 float m_friction; 587 float m_rollingFriction; 588 float m_restitution; 589 float m_hitFraction; 590 float m_ccdSweptSphereRadius; 591 float m_ccdMotionThreshold; 592 int m_hasAnisotropicFriction; 593 int m_collisionFlags; 594 int m_islandTag1; 595 int m_companionId; 596 int m_activationState1; 597 int m_internalType; 598 int m_checkCollideWith; 599 char m_padding[4]; 600 }; 601 602 603 604 // -------------------------------------------------- // 605 class btRigidBodyFloatData 606 { 607 public: 608 btCollisionObjectFloatData m_collisionObjectData; 609 btMatrix3x3FloatData m_invInertiaTensorWorld; 610 btVector3FloatData m_linearVelocity; 611 btVector3FloatData m_angularVelocity; 612 btVector3FloatData m_angularFactor; 613 btVector3FloatData m_linearFactor; 614 btVector3FloatData m_gravity; 615 btVector3FloatData m_gravity_acceleration; 616 btVector3FloatData m_invInertiaLocal; 617 btVector3FloatData m_totalForce; 618 btVector3FloatData m_totalTorque; 619 float m_inverseMass; 620 float m_linearDamping; 621 float m_angularDamping; 622 float m_additionalDampingFactor; 623 float m_additionalLinearDampingThresholdSqr; 624 float m_additionalAngularDampingThresholdSqr; 625 float m_additionalAngularDampingFactor; 626 float m_linearSleepingThreshold; 627 float m_angularSleepingThreshold; 628 int m_additionalDamping; 629 }; 630 631 632 // -------------------------------------------------- // 633 class btRigidBodyDoubleData 634 { 635 public: 636 btCollisionObjectDoubleData m_collisionObjectData; 637 btMatrix3x3DoubleData m_invInertiaTensorWorld; 638 btVector3DoubleData m_linearVelocity; 639 btVector3DoubleData m_angularVelocity; 640 btVector3DoubleData m_angularFactor; 641 btVector3DoubleData m_linearFactor; 642 btVector3DoubleData m_gravity; 643 btVector3DoubleData m_gravity_acceleration; 644 btVector3DoubleData m_invInertiaLocal; 645 btVector3DoubleData m_totalForce; 646 btVector3DoubleData m_totalTorque; 647 double m_inverseMass; 648 double m_linearDamping; 649 double m_angularDamping; 650 double m_additionalDampingFactor; 651 double m_additionalLinearDampingThresholdSqr; 652 double m_additionalAngularDampingThresholdSqr; 653 double m_additionalAngularDampingFactor; 654 double m_linearSleepingThreshold; 655 double m_angularSleepingThreshold; 656 int m_additionalDamping; 657 char m_padding[4]; 658 }; 659 660 661 // -------------------------------------------------- // 662 class btConstraintInfo1 663 { 664 public: 665 int m_numConstraintRows; 666 int nub; 667 }; 668 669 670 // -------------------------------------------------- // 671 class btTypedConstraintFloatData 672 { 673 public: 674 btRigidBodyFloatData *m_rbA; 675 btRigidBodyFloatData *m_rbB; 676 char *m_name; 677 int m_objectType; 678 int m_userConstraintType; 679 int m_userConstraintId; 680 int m_needsFeedback; 681 float m_appliedImpulse; 682 float m_dbgDrawSize; 683 int m_disableCollisionsBetweenLinkedBodies; 684 int m_overrideNumSolverIterations; 685 float m_breakingImpulseThreshold; 686 int m_isEnabled; 687 }; 688 689 690 // -------------------------------------------------- // 691 class btTypedConstraintData 692 { 693 public: 694 bInvalidHandle *m_rbA; 695 bInvalidHandle *m_rbB; 696 char *m_name; 697 int m_objectType; 698 int m_userConstraintType; 699 int m_userConstraintId; 700 int m_needsFeedback; 701 float m_appliedImpulse; 702 float m_dbgDrawSize; 703 int m_disableCollisionsBetweenLinkedBodies; 704 int m_overrideNumSolverIterations; 705 float m_breakingImpulseThreshold; 706 int m_isEnabled; 707 }; 708 709 710 // -------------------------------------------------- // 711 class btTypedConstraintDoubleData 712 { 713 public: 714 btRigidBodyDoubleData *m_rbA; 715 btRigidBodyDoubleData *m_rbB; 716 char *m_name; 717 int m_objectType; 718 int m_userConstraintType; 719 int m_userConstraintId; 720 int m_needsFeedback; 721 double m_appliedImpulse; 722 double m_dbgDrawSize; 723 int m_disableCollisionsBetweenLinkedBodies; 724 int m_overrideNumSolverIterations; 725 double m_breakingImpulseThreshold; 726 int m_isEnabled; 727 char padding[4]; 728 }; 729 730 731 // -------------------------------------------------- // 732 class btPoint2PointConstraintFloatData 733 { 734 public: 735 btTypedConstraintData m_typeConstraintData; 736 btVector3FloatData m_pivotInA; 737 btVector3FloatData m_pivotInB; 738 }; 739 740 741 // -------------------------------------------------- // 742 class btPoint2PointConstraintDoubleData2 743 { 744 public: 745 btTypedConstraintDoubleData m_typeConstraintData; 746 btVector3DoubleData m_pivotInA; 747 btVector3DoubleData m_pivotInB; 748 }; 749 750 751 // -------------------------------------------------- // 752 class btPoint2PointConstraintDoubleData 753 { 754 public: 755 btTypedConstraintData m_typeConstraintData; 756 btVector3DoubleData m_pivotInA; 757 btVector3DoubleData m_pivotInB; 758 }; 759 760 761 // -------------------------------------------------- // 762 class btHingeConstraintDoubleData 763 { 764 public: 765 btTypedConstraintData m_typeConstraintData; 766 btTransformDoubleData m_rbAFrame; 767 btTransformDoubleData m_rbBFrame; 768 int m_useReferenceFrameA; 769 int m_angularOnly; 770 int m_enableAngularMotor; 771 float m_motorTargetVelocity; 772 float m_maxMotorImpulse; 773 float m_lowerLimit; 774 float m_upperLimit; 775 float m_limitSoftness; 776 float m_biasFactor; 777 float m_relaxationFactor; 778 }; 779 780 781 // -------------------------------------------------- // 782 class btHingeConstraintFloatData 783 { 784 public: 785 btTypedConstraintData m_typeConstraintData; 786 btTransformFloatData m_rbAFrame; 787 btTransformFloatData m_rbBFrame; 788 int m_useReferenceFrameA; 789 int m_angularOnly; 790 int m_enableAngularMotor; 791 float m_motorTargetVelocity; 792 float m_maxMotorImpulse; 793 float m_lowerLimit; 794 float m_upperLimit; 795 float m_limitSoftness; 796 float m_biasFactor; 797 float m_relaxationFactor; 798 }; 799 800 801 // -------------------------------------------------- // 802 class btHingeConstraintDoubleData2 803 { 804 public: 805 btTypedConstraintDoubleData m_typeConstraintData; 806 btTransformDoubleData m_rbAFrame; 807 btTransformDoubleData m_rbBFrame; 808 int m_useReferenceFrameA; 809 int m_angularOnly; 810 int m_enableAngularMotor; 811 double m_motorTargetVelocity; 812 double m_maxMotorImpulse; 813 double m_lowerLimit; 814 double m_upperLimit; 815 double m_limitSoftness; 816 double m_biasFactor; 817 double m_relaxationFactor; 818 char m_padding1[4]; 819 }; 820 821 822 // -------------------------------------------------- // 823 class btConeTwistConstraintDoubleData 824 { 825 public: 826 btTypedConstraintDoubleData m_typeConstraintData; 827 btTransformDoubleData m_rbAFrame; 828 btTransformDoubleData m_rbBFrame; 829 double m_swingSpan1; 830 double m_swingSpan2; 831 double m_twistSpan; 832 double m_limitSoftness; 833 double m_biasFactor; 834 double m_relaxationFactor; 835 double m_damping; 836 }; 837 838 839 // -------------------------------------------------- // 840 class btConeTwistConstraintData 841 { 842 public: 843 btTypedConstraintData m_typeConstraintData; 844 btTransformFloatData m_rbAFrame; 845 btTransformFloatData m_rbBFrame; 846 float m_swingSpan1; 847 float m_swingSpan2; 848 float m_twistSpan; 849 float m_limitSoftness; 850 float m_biasFactor; 851 float m_relaxationFactor; 852 float m_damping; 853 char m_pad[4]; 854 }; 855 856 857 // -------------------------------------------------- // 858 class btGeneric6DofConstraintData 859 { 860 public: 861 btTypedConstraintData m_typeConstraintData; 862 btTransformFloatData m_rbAFrame; 863 btTransformFloatData m_rbBFrame; 864 btVector3FloatData m_linearUpperLimit; 865 btVector3FloatData m_linearLowerLimit; 866 btVector3FloatData m_angularUpperLimit; 867 btVector3FloatData m_angularLowerLimit; 868 int m_useLinearReferenceFrameA; 869 int m_useOffsetForConstraintFrame; 870 }; 871 872 873 // -------------------------------------------------- // 874 class btGeneric6DofConstraintDoubleData2 875 { 876 public: 877 btTypedConstraintDoubleData m_typeConstraintData; 878 btTransformDoubleData m_rbAFrame; 879 btTransformDoubleData m_rbBFrame; 880 btVector3DoubleData m_linearUpperLimit; 881 btVector3DoubleData m_linearLowerLimit; 882 btVector3DoubleData m_angularUpperLimit; 883 btVector3DoubleData m_angularLowerLimit; 884 int m_useLinearReferenceFrameA; 885 int m_useOffsetForConstraintFrame; 886 }; 887 888 889 // -------------------------------------------------- // 890 class btGeneric6DofSpringConstraintData 891 { 892 public: 893 btGeneric6DofConstraintData m_6dofData; 894 int m_springEnabled[6]; 895 float m_equilibriumPoint[6]; 896 float m_springStiffness[6]; 897 float m_springDamping[6]; 898 }; 899 900 901 // -------------------------------------------------- // 902 class btGeneric6DofSpringConstraintDoubleData2 903 { 904 public: 905 btGeneric6DofConstraintDoubleData2 m_6dofData; 906 int m_springEnabled[6]; 907 double m_equilibriumPoint[6]; 908 double m_springStiffness[6]; 909 double m_springDamping[6]; 910 }; 911 912 913 // -------------------------------------------------- // 914 class btGeneric6DofSpring2ConstraintData 915 { 916 public: 917 btTypedConstraintData m_typeConstraintData; 918 btTransformFloatData m_rbAFrame; 919 btTransformFloatData m_rbBFrame; 920 btVector3FloatData m_linearUpperLimit; 921 btVector3FloatData m_linearLowerLimit; 922 btVector3FloatData m_linearBounce; 923 btVector3FloatData m_linearStopERP; 924 btVector3FloatData m_linearStopCFM; 925 btVector3FloatData m_linearMotorERP; 926 btVector3FloatData m_linearMotorCFM; 927 btVector3FloatData m_linearTargetVelocity; 928 btVector3FloatData m_linearMaxMotorForce; 929 btVector3FloatData m_linearServoTarget; 930 btVector3FloatData m_linearSpringStiffness; 931 btVector3FloatData m_linearSpringDamping; 932 btVector3FloatData m_linearEquilibriumPoint; 933 char m_linearEnableMotor[4]; 934 char m_linearServoMotor[4]; 935 char m_linearEnableSpring[4]; 936 char m_linearSpringStiffnessLimited[4]; 937 char m_linearSpringDampingLimited[4]; 938 char m_padding1[4]; 939 btVector3FloatData m_angularUpperLimit; 940 btVector3FloatData m_angularLowerLimit; 941 btVector3FloatData m_angularBounce; 942 btVector3FloatData m_angularStopERP; 943 btVector3FloatData m_angularStopCFM; 944 btVector3FloatData m_angularMotorERP; 945 btVector3FloatData m_angularMotorCFM; 946 btVector3FloatData m_angularTargetVelocity; 947 btVector3FloatData m_angularMaxMotorForce; 948 btVector3FloatData m_angularServoTarget; 949 btVector3FloatData m_angularSpringStiffness; 950 btVector3FloatData m_angularSpringDamping; 951 btVector3FloatData m_angularEquilibriumPoint; 952 char m_angularEnableMotor[4]; 953 char m_angularServoMotor[4]; 954 char m_angularEnableSpring[4]; 955 char m_angularSpringStiffnessLimited[4]; 956 char m_angularSpringDampingLimited[4]; 957 int m_rotateOrder; 958 }; 959 960 961 // -------------------------------------------------- // 962 class btGeneric6DofSpring2ConstraintDoubleData2 963 { 964 public: 965 btTypedConstraintDoubleData m_typeConstraintData; 966 btTransformDoubleData m_rbAFrame; 967 btTransformDoubleData m_rbBFrame; 968 btVector3DoubleData m_linearUpperLimit; 969 btVector3DoubleData m_linearLowerLimit; 970 btVector3DoubleData m_linearBounce; 971 btVector3DoubleData m_linearStopERP; 972 btVector3DoubleData m_linearStopCFM; 973 btVector3DoubleData m_linearMotorERP; 974 btVector3DoubleData m_linearMotorCFM; 975 btVector3DoubleData m_linearTargetVelocity; 976 btVector3DoubleData m_linearMaxMotorForce; 977 btVector3DoubleData m_linearServoTarget; 978 btVector3DoubleData m_linearSpringStiffness; 979 btVector3DoubleData m_linearSpringDamping; 980 btVector3DoubleData m_linearEquilibriumPoint; 981 char m_linearEnableMotor[4]; 982 char m_linearServoMotor[4]; 983 char m_linearEnableSpring[4]; 984 char m_linearSpringStiffnessLimited[4]; 985 char m_linearSpringDampingLimited[4]; 986 char m_padding1[4]; 987 btVector3DoubleData m_angularUpperLimit; 988 btVector3DoubleData m_angularLowerLimit; 989 btVector3DoubleData m_angularBounce; 990 btVector3DoubleData m_angularStopERP; 991 btVector3DoubleData m_angularStopCFM; 992 btVector3DoubleData m_angularMotorERP; 993 btVector3DoubleData m_angularMotorCFM; 994 btVector3DoubleData m_angularTargetVelocity; 995 btVector3DoubleData m_angularMaxMotorForce; 996 btVector3DoubleData m_angularServoTarget; 997 btVector3DoubleData m_angularSpringStiffness; 998 btVector3DoubleData m_angularSpringDamping; 999 btVector3DoubleData m_angularEquilibriumPoint; 1000 char m_angularEnableMotor[4]; 1001 char m_angularServoMotor[4]; 1002 char m_angularEnableSpring[4]; 1003 char m_angularSpringStiffnessLimited[4]; 1004 char m_angularSpringDampingLimited[4]; 1005 int m_rotateOrder; 1006 }; 1007 1008 1009 // -------------------------------------------------- // 1010 class btSliderConstraintData 1011 { 1012 public: 1013 btTypedConstraintData m_typeConstraintData; 1014 btTransformFloatData m_rbAFrame; 1015 btTransformFloatData m_rbBFrame; 1016 float m_linearUpperLimit; 1017 float m_linearLowerLimit; 1018 float m_angularUpperLimit; 1019 float m_angularLowerLimit; 1020 int m_useLinearReferenceFrameA; 1021 int m_useOffsetForConstraintFrame; 1022 }; 1023 1024 1025 // -------------------------------------------------- // 1026 class btSliderConstraintDoubleData 1027 { 1028 public: 1029 btTypedConstraintDoubleData m_typeConstraintData; 1030 btTransformDoubleData m_rbAFrame; 1031 btTransformDoubleData m_rbBFrame; 1032 double m_linearUpperLimit; 1033 double m_linearLowerLimit; 1034 double m_angularUpperLimit; 1035 double m_angularLowerLimit; 1036 int m_useLinearReferenceFrameA; 1037 int m_useOffsetForConstraintFrame; 1038 }; 1039 1040 1041 // -------------------------------------------------- // 1042 class btGearConstraintFloatData 1043 { 1044 public: 1045 btTypedConstraintFloatData m_typeConstraintData; 1046 btVector3FloatData m_axisInA; 1047 btVector3FloatData m_axisInB; 1048 float m_ratio; 1049 char m_padding[4]; 1050 }; 1051 1052 1053 // -------------------------------------------------- // 1054 class btGearConstraintDoubleData 1055 { 1056 public: 1057 btTypedConstraintDoubleData m_typeConstraintData; 1058 btVector3DoubleData m_axisInA; 1059 btVector3DoubleData m_axisInB; 1060 double m_ratio; 1061 }; 1062 1063 1064 // -------------------------------------------------- // 1065 class btContactSolverInfoDoubleData 1066 { 1067 public: 1068 double m_tau; 1069 double m_damping; 1070 double m_friction; 1071 double m_timeStep; 1072 double m_restitution; 1073 double m_maxErrorReduction; 1074 double m_sor; 1075 double m_erp; 1076 double m_erp2; 1077 double m_globalCfm; 1078 double m_splitImpulsePenetrationThreshold; 1079 double m_splitImpulseTurnErp; 1080 double m_linearSlop; 1081 double m_warmstartingFactor; 1082 double m_maxGyroscopicForce; 1083 double m_singleAxisRollingFrictionThreshold; 1084 int m_numIterations; 1085 int m_solverMode; 1086 int m_restingContactRestitutionThreshold; 1087 int m_minimumSolverBatchSize; 1088 int m_splitImpulse; 1089 char m_padding[4]; 1090 }; 1091 1092 1093 // -------------------------------------------------- // 1094 class btContactSolverInfoFloatData 1095 { 1096 public: 1097 float m_tau; 1098 float m_damping; 1099 float m_friction; 1100 float m_timeStep; 1101 float m_restitution; 1102 float m_maxErrorReduction; 1103 float m_sor; 1104 float m_erp; 1105 float m_erp2; 1106 float m_globalCfm; 1107 float m_splitImpulsePenetrationThreshold; 1108 float m_splitImpulseTurnErp; 1109 float m_linearSlop; 1110 float m_warmstartingFactor; 1111 float m_maxGyroscopicForce; 1112 float m_singleAxisRollingFrictionThreshold; 1113 int m_numIterations; 1114 int m_solverMode; 1115 int m_restingContactRestitutionThreshold; 1116 int m_minimumSolverBatchSize; 1117 int m_splitImpulse; 1118 char m_padding[4]; 1119 }; 1120 1121 // -------------------------------------------------- // 1122 class btDynamicsWorldDoubleData 1123 { 1124 public: 1125 btContactSolverInfoDoubleData m_solverInfo; 1126 btVector3DoubleData m_gravity; 1127 }; 1128 1129 1130 // -------------------------------------------------- // 1131 class btDynamicsWorldFloatData 1132 { 1133 public: 1134 btContactSolverInfoFloatData m_solverInfo; 1135 btVector3FloatData m_gravity; 1136 }; 1137 1138 1139 1140 // -------------------------------------------------- // 1141 class SoftBodyMaterialData 1142 { 1143 public: 1144 float m_linearStiffness; 1145 float m_angularStiffness; 1146 float m_volumeStiffness; 1147 int m_flags; 1148 }; 1149 1150 1151 // -------------------------------------------------- // 1152 class SoftBodyNodeData 1153 { 1154 public: 1155 SoftBodyMaterialData *m_material; 1156 btVector3FloatData m_position; 1157 btVector3FloatData m_previousPosition; 1158 btVector3FloatData m_velocity; 1159 btVector3FloatData m_accumulatedForce; 1160 btVector3FloatData m_normal; 1161 float m_inverseMass; 1162 float m_area; 1163 int m_attach; 1164 int m_pad; 1165 }; 1166 1167 1168 // -------------------------------------------------- // 1169 class SoftBodyLinkData 1170 { 1171 public: 1172 SoftBodyMaterialData *m_material; 1173 int m_nodeIndices[2]; 1174 float m_restLength; 1175 int m_bbending; 1176 }; 1177 1178 1179 // -------------------------------------------------- // 1180 class SoftBodyFaceData 1181 { 1182 public: 1183 btVector3FloatData m_normal; 1184 SoftBodyMaterialData *m_material; 1185 int m_nodeIndices[3]; 1186 float m_restArea; 1187 }; 1188 1189 1190 // -------------------------------------------------- // 1191 class SoftBodyTetraData 1192 { 1193 public: 1194 btVector3FloatData m_c0[4]; 1195 SoftBodyMaterialData *m_material; 1196 int m_nodeIndices[4]; 1197 float m_restVolume; 1198 float m_c1; 1199 float m_c2; 1200 int m_pad; 1201 }; 1202 1203 1204 // -------------------------------------------------- // 1205 class SoftRigidAnchorData 1206 { 1207 public: 1208 btMatrix3x3FloatData m_c0; 1209 btVector3FloatData m_c1; 1210 btVector3FloatData m_localFrame; 1211 bInvalidHandle *m_rigidBody; 1212 int m_nodeIndex; 1213 float m_c2; 1214 }; 1215 1216 1217 // -------------------------------------------------- // 1218 class SoftBodyConfigData 1219 { 1220 public: 1221 int m_aeroModel; 1222 float m_baumgarte; 1223 float m_damping; 1224 float m_drag; 1225 float m_lift; 1226 float m_pressure; 1227 float m_volume; 1228 float m_dynamicFriction; 1229 float m_poseMatch; 1230 float m_rigidContactHardness; 1231 float m_kineticContactHardness; 1232 float m_softContactHardness; 1233 float m_anchorHardness; 1234 float m_softRigidClusterHardness; 1235 float m_softKineticClusterHardness; 1236 float m_softSoftClusterHardness; 1237 float m_softRigidClusterImpulseSplit; 1238 float m_softKineticClusterImpulseSplit; 1239 float m_softSoftClusterImpulseSplit; 1240 float m_maxVolume; 1241 float m_timeScale; 1242 int m_velocityIterations; 1243 int m_positionIterations; 1244 int m_driftIterations; 1245 int m_clusterIterations; 1246 int m_collisionFlags; 1247 }; 1248 1249 1250 // -------------------------------------------------- // 1251 class SoftBodyPoseData 1252 { 1253 public: 1254 btMatrix3x3FloatData m_rot; 1255 btMatrix3x3FloatData m_scale; 1256 btMatrix3x3FloatData m_aqq; 1257 btVector3FloatData m_com; 1258 btVector3FloatData *m_positions; 1259 float *m_weights; 1260 int m_numPositions; 1261 int m_numWeigts; 1262 int m_bvolume; 1263 int m_bframe; 1264 float m_restVolume; 1265 int m_pad; 1266 }; 1267 1268 1269 // -------------------------------------------------- // 1270 class SoftBodyClusterData 1271 { 1272 public: 1273 btTransformFloatData m_framexform; 1274 btMatrix3x3FloatData m_locii; 1275 btMatrix3x3FloatData m_invwi; 1276 btVector3FloatData m_com; 1277 btVector3FloatData m_vimpulses[2]; 1278 btVector3FloatData m_dimpulses[2]; 1279 btVector3FloatData m_lv; 1280 btVector3FloatData m_av; 1281 btVector3FloatData *m_framerefs; 1282 int *m_nodeIndices; 1283 float *m_masses; 1284 int m_numFrameRefs; 1285 int m_numNodes; 1286 int m_numMasses; 1287 float m_idmass; 1288 float m_imass; 1289 int m_nvimpulses; 1290 int m_ndimpulses; 1291 float m_ndamping; 1292 float m_ldamping; 1293 float m_adamping; 1294 float m_matching; 1295 float m_maxSelfCollisionImpulse; 1296 float m_selfCollisionImpulseFactor; 1297 int m_containsAnchor; 1298 int m_collide; 1299 int m_clusterIndex; 1300 }; 1301 1302 1303 // -------------------------------------------------- // 1304 class btSoftBodyJointData 1305 { 1306 public: 1307 void *m_bodyA; 1308 void *m_bodyB; 1309 btVector3FloatData m_refs[2]; 1310 float m_cfm; 1311 float m_erp; 1312 float m_split; 1313 int m_delete; 1314 btVector3FloatData m_relPosition[2]; 1315 int m_bodyAtype; 1316 int m_bodyBtype; 1317 int m_jointType; 1318 int m_pad; 1319 }; 1320 1321 1322 // -------------------------------------------------- // 1323 class btSoftBodyFloatData 1324 { 1325 public: 1326 btCollisionObjectFloatData m_collisionObjectData; 1327 SoftBodyPoseData *m_pose; 1328 SoftBodyMaterialData **m_materials; 1329 SoftBodyNodeData *m_nodes; 1330 SoftBodyLinkData *m_links; 1331 SoftBodyFaceData *m_faces; 1332 SoftBodyTetraData *m_tetrahedra; 1333 SoftRigidAnchorData *m_anchors; 1334 SoftBodyClusterData *m_clusters; 1335 btSoftBodyJointData *m_joints; 1336 int m_numMaterials; 1337 int m_numNodes; 1338 int m_numLinks; 1339 int m_numFaces; 1340 int m_numTetrahedra; 1341 int m_numAnchors; 1342 int m_numClusters; 1343 int m_numJoints; 1344 SoftBodyConfigData m_config; 1345 }; 1346 1347 1348 // -------------------------------------------------- // 1349 class btMultiBodyLinkDoubleData 1350 { 1351 public: 1352 btQuaternionDoubleData m_zeroRotParentToThis; 1353 btVector3DoubleData m_parentComToThisComOffset; 1354 btVector3DoubleData m_thisPivotToThisComOffset; 1355 btVector3DoubleData m_jointAxisTop[6]; 1356 btVector3DoubleData m_jointAxisBottom[6]; 1357 char *m_linkName; 1358 char *m_jointName; 1359 btCollisionObjectDoubleData *m_linkCollider; 1360 btVector3DoubleData m_linkInertia; 1361 double m_linkMass; 1362 int m_parentIndex; 1363 int m_jointType; 1364 int m_dofCount; 1365 int m_posVarCount; 1366 double m_jointPos[7]; 1367 double m_jointVel[6]; 1368 double m_jointTorque[6]; 1369 }; 1370 1371 1372 // -------------------------------------------------- // 1373 class btMultiBodyLinkFloatData 1374 { 1375 public: 1376 btQuaternionFloatData m_zeroRotParentToThis; 1377 btVector3FloatData m_parentComToThisComOffset; 1378 btVector3FloatData m_thisPivotToThisComOffset; 1379 btVector3FloatData m_jointAxisTop[6]; 1380 btVector3FloatData m_jointAxisBottom[6]; 1381 char *m_linkName; 1382 char *m_jointName; 1383 btCollisionObjectFloatData *m_linkCollider; 1384 btVector3FloatData m_linkInertia; 1385 int m_dofCount; 1386 float m_linkMass; 1387 int m_parentIndex; 1388 int m_jointType; 1389 float m_jointPos[7]; 1390 float m_jointVel[6]; 1391 float m_jointTorque[6]; 1392 int m_posVarCount; 1393 }; 1394 1395 1396 // -------------------------------------------------- // 1397 class btMultiBodyDoubleData 1398 { 1399 public: 1400 char *m_baseName; 1401 btMultiBodyLinkDoubleData *m_links; 1402 btCollisionObjectDoubleData *m_baseCollider; 1403 btTransformDoubleData m_baseWorldTransform; 1404 btVector3DoubleData m_baseInertia; 1405 int m_numLinks; 1406 double m_baseMass; 1407 char m_padding[4]; 1408 }; 1409 1410 1411 // -------------------------------------------------- // 1412 class btMultiBodyFloatData 1413 { 1414 public: 1415 char *m_baseName; 1416 btMultiBodyLinkFloatData *m_links; 1417 btCollisionObjectFloatData *m_baseCollider; 1418 btTransformFloatData m_baseWorldTransform; 1419 btVector3FloatData m_baseInertia; 1420 float m_baseMass; 1421 int m_numLinks; 1422 }; 1423 1424 1425 } 1426 #endif//__BULLET_H__