diff options
author | Robert Adams | 2012-12-29 21:43:43 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-31 19:57:21 -0800 |
commit | 48f718f39fcd61501262878a8bcfbd98efed29d2 (patch) | |
tree | aa67dbaf54d75152f01302921bbc42226daaec8b /OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |
parent | BulletSim: change physical data structures to classes. Add default (diff) | |
download | opensim-SC_OLD-48f718f39fcd61501262878a8bcfbd98efed29d2.zip opensim-SC_OLD-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.gz opensim-SC_OLD-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.bz2 opensim-SC_OLD-48f718f39fcd61501262878a8bcfbd98efed29d2.tar.xz |
BulletSim: first round of conversion from direct BulletSimAPI interfacing by BulletSim core to using the BulletSimAPITemplate. Physical object creation and destruction first.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 947 |
1 files changed, 169 insertions, 778 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index b361498..6b76151 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -292,985 +292,376 @@ public enum ConstraintParamAxis : int | |||
292 | 292 | ||
293 | public abstract class BulletSimAPITemplate | 293 | public abstract class BulletSimAPITemplate |
294 | { | 294 | { |
295 | /* | ||
295 | // Initialization and simulation | 296 | // Initialization and simulation |
296 | public abstract BulletWorld Initialize2(Vector3 maxPosition, IntPtr parms, | 297 | public abstract BulletWorld Initialize(Vector3 maxPosition, IntPtr parms, |
297 | int maxCollisions, IntPtr collisionArray, | 298 | int maxCollisions, IntPtr collisionArray, |
298 | int maxUpdates, IntPtr updateArray | 299 | int maxUpdates, IntPtr updateArray |
299 | ); | 300 | ); |
300 | 301 | ||
301 | public abstract bool UpdateParameter2(BulletWorld world, uint localID, String parm, float value); | 302 | public abstract bool UpdateParameter(BulletWorld world, uint localID, String parm, float value); |
302 | 303 | ||
303 | public abstract void SetHeightMap2(BulletWorld world, float[] heightmap); | 304 | public abstract void SetHeightMap(BulletWorld world, float[] heightmap); |
304 | 305 | ||
305 | public abstract void Shutdown2(BulletWorld sim); | 306 | public abstract void Shutdown(BulletWorld sim); |
306 | 307 | ||
307 | public abstract int PhysicsStep2(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, | 308 | public abstract int PhysicsStep(BulletWorld world, float timeStep, int maxSubSteps, float fixedTimeStep, |
308 | out int updatedEntityCount, | 309 | out int updatedEntityCount, |
309 | out IntPtr updatedEntitiesPtr, | 310 | out IntPtr updatedEntitiesPtr, |
310 | out int collidersCount, | 311 | out int collidersCount, |
311 | out IntPtr collidersPtr); | 312 | out IntPtr collidersPtr); |
312 | 313 | ||
313 | public abstract bool PushUpdate2(BulletBody obj); | 314 | public abstract bool PushUpdate(BulletBody obj); |
315 | */ | ||
314 | 316 | ||
315 | // ===================================================================================== | 317 | // ===================================================================================== |
316 | // Mesh, hull, shape and body creation helper routines | 318 | // Mesh, hull, shape and body creation helper routines |
317 | public abstract BulletShape CreateMeshShape2(BulletWorld world, | 319 | public abstract BulletShape CreateMeshShape(BulletWorld world, |
318 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | 320 | int indicesCount, int[] indices, |
319 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | 321 | int verticesCount, float[] vertices ); |
320 | 322 | ||
321 | public abstract BulletShape CreateHullShape2(BulletWorld world, | 323 | public abstract BulletShape CreateHullShape(BulletWorld world, |
322 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | 324 | int hullCount, float[] hulls); |
323 | 325 | ||
324 | public abstract BulletShape BuildHullShapeFromMesh2(BulletWorld world, BulletShape meshShape); | 326 | public abstract BulletShape BuildHullShapeFromMesh(BulletWorld world, BulletShape meshShape); |
325 | 327 | ||
326 | public abstract BulletShape BuildNativeShape2(BulletWorld world, ShapeData shapeData); | 328 | public abstract BulletShape BuildNativeShape(BulletWorld world, ShapeData shapeData); |
327 | 329 | ||
328 | public abstract bool IsNativeShape2(BulletShape shape); | 330 | public abstract bool IsNativeShape(BulletShape shape); |
329 | 331 | ||
330 | public abstract void SetShapeCollisionMargin(BulletShape shape, float margin); | 332 | public abstract void SetShapeCollisionMargin(BulletShape shape, float margin); |
331 | 333 | ||
332 | public abstract BulletShape BuildCapsuleShape2(BulletWorld world, float radius, float height, Vector3 scale); | 334 | public abstract BulletShape BuildCapsuleShape(BulletWorld world, float radius, float height, Vector3 scale); |
333 | |||
334 | public abstract BulletShape CreateCompoundShape2(BulletWorld sim, bool enableDynamicAabbTree); | ||
335 | |||
336 | public abstract int GetNumberOfCompoundChildren2(BulletShape cShape); | ||
337 | |||
338 | public abstract void AddChildShapeToCompoundShape2(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot); | ||
339 | |||
340 | public abstract BulletShape GetChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
341 | |||
342 | public abstract BulletShape RemoveChildShapeFromCompoundShapeIndex2(BulletShape cShape, int indx); | ||
343 | |||
344 | public abstract void RemoveChildShapeFromCompoundShape2(BulletShape cShape, BulletShape removeShape); | ||
345 | |||
346 | public abstract void RecalculateCompoundShapeLocalAabb2(BulletShape cShape); | ||
347 | |||
348 | public abstract BulletShape DuplicateCollisionShape2(BulletWorld sim, BulletShape srcShape, uint id); | ||
349 | |||
350 | public abstract BulletBody CreateBodyFromShapeAndInfo2(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo); | ||
351 | |||
352 | public abstract bool DeleteCollisionShape2(BulletWorld world, BulletShape shape); | ||
353 | |||
354 | public abstract int GetBodyType2(BulletBody obj); | ||
355 | |||
356 | public abstract BulletBody CreateBodyFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
357 | |||
358 | public abstract BulletBody CreateBodyWithDefaultMotionState2(BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
359 | |||
360 | public abstract BulletBody CreateGhostFromShape2(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); | ||
361 | |||
362 | public abstract IntPtr AllocateBodyInfo2(BulletBody obj); | ||
363 | |||
364 | public abstract void ReleaseBodyInfo2(IntPtr obj); | ||
365 | |||
366 | public abstract void DestroyObject2(BulletWorld sim, BulletBody obj); | ||
367 | |||
368 | // ===================================================================================== | ||
369 | // Terrain creation and helper routines | ||
370 | public abstract IntPtr CreateHeightMapInfo2(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
371 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
372 | |||
373 | public abstract IntPtr FillHeightMapInfo2(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | ||
374 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
375 | |||
376 | public abstract bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | ||
377 | |||
378 | public abstract BulletBody CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | ||
379 | |||
380 | public abstract BulletBody CreateTerrainShape2(IntPtr mapInfo); | ||
381 | |||
382 | // ===================================================================================== | ||
383 | // Constraint creation and helper routines | ||
384 | public abstract BulletConstraint Create6DofConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
385 | Vector3 frame1loc, Quaternion frame1rot, | ||
386 | Vector3 frame2loc, Quaternion frame2rot, | ||
387 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
388 | |||
389 | public abstract BulletConstraint Create6DofConstraintToPoint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
390 | Vector3 joinPoint, | ||
391 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
392 | |||
393 | public abstract BulletConstraint CreateHingeConstraint2(BulletWorld world, BulletBody obj1, BulletBody obj2, | ||
394 | Vector3 pivotinA, Vector3 pivotinB, | ||
395 | Vector3 axisInA, Vector3 axisInB, | ||
396 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | ||
397 | |||
398 | public abstract void SetConstraintEnable2(BulletConstraint constrain, float numericTrueFalse); | ||
399 | |||
400 | public abstract void SetConstraintNumSolverIterations2(BulletConstraint constrain, float iterations); | ||
401 | |||
402 | public abstract bool SetFrames2(BulletConstraint constrain, | ||
403 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); | ||
404 | |||
405 | public abstract bool SetLinearLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
406 | |||
407 | public abstract bool SetAngularLimits2(BulletConstraint constrain, Vector3 low, Vector3 hi); | ||
408 | |||
409 | public abstract bool UseFrameOffset2(BulletConstraint constrain, float enable); | ||
410 | |||
411 | public abstract bool TranslationalLimitMotor2(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce); | ||
412 | |||
413 | public abstract bool SetBreakingImpulseThreshold2(BulletConstraint constrain, float threshold); | ||
414 | |||
415 | public abstract bool CalculateTransforms2(BulletConstraint constrain); | ||
416 | |||
417 | public abstract bool SetConstraintParam2(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | ||
418 | |||
419 | public abstract bool DestroyConstraint2(BulletWorld world, BulletConstraint constrain); | ||
420 | |||
421 | // ===================================================================================== | ||
422 | // btCollisionWorld entries | ||
423 | public abstract void UpdateSingleAabb2(BulletWorld world, BulletBody obj); | ||
424 | |||
425 | public abstract void UpdateAabbs2(BulletWorld world); | ||
426 | |||
427 | public abstract bool GetForceUpdateAllAabbs2(BulletWorld world); | ||
428 | |||
429 | public abstract void SetForceUpdateAllAabbs2(BulletWorld world, bool force); | ||
430 | |||
431 | // ===================================================================================== | ||
432 | // btDynamicsWorld entries | ||
433 | public abstract bool AddObjectToWorld2(BulletWorld world, BulletBody obj); | ||
434 | |||
435 | public abstract bool RemoveObjectFromWorld2(BulletWorld world, BulletBody obj); | ||
436 | |||
437 | public abstract bool AddConstraintToWorld2(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); | ||
438 | |||
439 | public abstract bool RemoveConstraintFromWorld2(BulletWorld world, BulletConstraint constrain); | ||
440 | // ===================================================================================== | ||
441 | // btCollisionObject entries | ||
442 | public abstract Vector3 GetAnisotripicFriction2(BulletConstraint constrain); | ||
443 | |||
444 | public abstract Vector3 SetAnisotripicFriction2(BulletConstraint constrain, Vector3 frict); | ||
445 | |||
446 | public abstract bool HasAnisotripicFriction2(BulletConstraint constrain); | ||
447 | |||
448 | public abstract void SetContactProcessingThreshold2(BulletBody obj, float val); | ||
449 | |||
450 | public abstract float GetContactProcessingThreshold2(BulletBody obj); | ||
451 | |||
452 | public abstract bool IsStaticObject2(BulletBody obj); | ||
453 | |||
454 | public abstract bool IsKinematicObject2(BulletBody obj); | ||
455 | |||
456 | public abstract bool IsStaticOrKinematicObject2(BulletBody obj); | ||
457 | |||
458 | public abstract bool HasContactResponse2(BulletBody obj); | ||
459 | |||
460 | public abstract void SetCollisionShape2(BulletWorld sim, BulletBody obj, BulletBody shape); | ||
461 | |||
462 | public abstract BulletShape GetCollisionShape2(BulletBody obj); | ||
463 | |||
464 | public abstract int GetActivationState2(BulletBody obj); | ||
465 | |||
466 | public abstract void SetActivationState2(BulletBody obj, int state); | ||
467 | |||
468 | public abstract void SetDeactivationTime2(BulletBody obj, float dtime); | ||
469 | |||
470 | public abstract float GetDeactivationTime2(BulletBody obj); | ||
471 | |||
472 | public abstract void ForceActivationState2(BulletBody obj, ActivationState state); | ||
473 | |||
474 | public abstract void Activate2(BulletBody obj, bool forceActivation); | ||
475 | |||
476 | public abstract bool IsActive2(BulletBody obj); | ||
477 | |||
478 | public abstract void SetRestitution2(BulletBody obj, float val); | ||
479 | |||
480 | public abstract float GetRestitution2(BulletBody obj); | ||
481 | |||
482 | public abstract void SetFriction2(BulletBody obj, float val); | ||
483 | |||
484 | public abstract float GetFriction2(BulletBody obj); | ||
485 | |||
486 | /* Haven't defined the type 'Transform' | ||
487 | public abstract Transform GetWorldTransform2(BulletBody obj); | ||
488 | |||
489 | public abstract void setWorldTransform2(BulletBody obj, Transform trans); | ||
490 | */ | ||
491 | |||
492 | public abstract Vector3 GetPosition2(BulletBody obj); | ||
493 | |||
494 | public abstract Quaternion GetOrientation2(BulletBody obj); | ||
495 | |||
496 | public abstract void SetTranslation2(BulletBody obj, Vector3 position, Quaternion rotation); | ||
497 | |||
498 | public abstract IntPtr GetBroadphaseHandle2(BulletBody obj); | ||
499 | |||
500 | public abstract void SetBroadphaseHandle2(BulletBody obj, IntPtr handle); | ||
501 | |||
502 | /* | ||
503 | public abstract Transform GetInterpolationWorldTransform2(IntPtr obj); | ||
504 | |||
505 | public abstract void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | ||
506 | */ | ||
507 | |||
508 | public abstract void SetInterpolationLinearVelocity2(BulletBody obj, Vector3 vel); | ||
509 | |||
510 | public abstract void SetInterpolationAngularVelocity2(BulletBody obj, Vector3 vel); | ||
511 | |||
512 | public abstract void SetInterpolationVelocity2(BulletBody obj, Vector3 linearVel, Vector3 angularVel); | ||
513 | |||
514 | public abstract float GetHitFraction2(BulletBody obj); | ||
515 | |||
516 | public abstract void SetHitFraction2(BulletBody obj, float val); | ||
517 | |||
518 | public abstract CollisionFlags GetCollisionFlags2(BulletBody obj); | ||
519 | |||
520 | public abstract CollisionFlags SetCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
521 | |||
522 | public abstract CollisionFlags AddToCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
523 | |||
524 | public abstract CollisionFlags RemoveFromCollisionFlags2(BulletBody obj, CollisionFlags flags); | ||
525 | |||
526 | public abstract float GetCcdMotionThreshold2(BulletBody obj); | ||
527 | |||
528 | public abstract void SetCcdMotionThreshold2(BulletBody obj, float val); | ||
529 | |||
530 | public abstract float GetCcdSweptSphereRadius2(BulletBody obj); | ||
531 | |||
532 | public abstract void SetCcdSweptSphereRadius2(BulletBody obj, float val); | ||
533 | |||
534 | public abstract IntPtr GetUserPointer2(BulletBody obj); | ||
535 | |||
536 | public abstract void SetUserPointer2(BulletBody obj, IntPtr val); | ||
537 | |||
538 | // ===================================================================================== | ||
539 | // btRigidBody entries | ||
540 | public abstract void ApplyGravity2(BulletBody obj); | ||
541 | |||
542 | public abstract void SetGravity2(BulletBody obj, Vector3 val); | ||
543 | |||
544 | public abstract Vector3 GetGravity2(BulletBody obj); | ||
545 | |||
546 | public abstract void SetDamping2(BulletBody obj, float lin_damping, float ang_damping); | ||
547 | |||
548 | public abstract void SetLinearDamping2(BulletBody obj, float lin_damping); | ||
549 | |||
550 | public abstract void SetAngularDamping2(BulletBody obj, float ang_damping); | ||
551 | |||
552 | public abstract float GetLinearDamping2(BulletBody obj); | ||
553 | 335 | ||
554 | public abstract float GetAngularDamping2(BulletBody obj); | 336 | public abstract BulletShape CreateCompoundShape(BulletWorld sim, bool enableDynamicAabbTree); |
555 | 337 | ||
556 | public abstract float GetLinearSleepingThreshold2(BulletBody obj); | 338 | public abstract int GetNumberOfCompoundChildren(BulletShape cShape); |
557 | 339 | ||
340 | public abstract void AddChildShapeToCompoundShape(BulletShape cShape, BulletShape addShape, Vector3 pos, Quaternion rot); | ||
558 | 341 | ||
559 | public abstract void ApplyDamping2(BulletBody obj, float timeStep); | 342 | public abstract BulletShape GetChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx); |
560 | 343 | ||
561 | public abstract void SetMassProps2(BulletBody obj, float mass, Vector3 inertia); | 344 | public abstract BulletShape RemoveChildShapeFromCompoundShapeIndex(BulletShape cShape, int indx); |
562 | 345 | ||
563 | public abstract Vector3 GetLinearFactor2(BulletBody obj); | 346 | public abstract void RemoveChildShapeFromCompoundShape(BulletShape cShape, BulletShape removeShape); |
564 | 347 | ||
565 | public abstract void SetLinearFactor2(BulletBody obj, Vector3 factor); | 348 | public abstract void RecalculateCompoundShapeLocalAabb(BulletShape cShape); |
566 | 349 | ||
567 | /* | 350 | public abstract BulletShape DuplicateCollisionShape(BulletWorld sim, BulletShape srcShape, uint id); |
568 | public abstract void SetCenterOfMassTransform2(BulletBody obj, Transform trans); | ||
569 | */ | ||
570 | |||
571 | public abstract void SetCenterOfMassByPosRot2(BulletBody obj, Vector3 pos, Quaternion rot); | ||
572 | |||
573 | // Add a force to the object as if its mass is one. | ||
574 | public abstract void ApplyCentralForce2(BulletBody obj, Vector3 force); | ||
575 | |||
576 | // Set the force being applied to the object as if its mass is one. | ||
577 | public abstract void SetObjectForce2(BulletBody obj, Vector3 force); | ||
578 | |||
579 | public abstract Vector3 GetTotalForce2(BulletBody obj); | ||
580 | 351 | ||
581 | public abstract Vector3 GetTotalTorque2(BulletBody obj); | 352 | public abstract BulletBody CreateBodyFromShapeAndInfo(BulletWorld sim, BulletShape shape, uint id, IntPtr constructionInfo); |
582 | 353 | ||
583 | public abstract Vector3 GetInvInertiaDiagLocal2(BulletBody obj); | 354 | public abstract bool DeleteCollisionShape(BulletWorld world, BulletShape shape); |
584 | 355 | ||
585 | public abstract void SetInvInertiaDiagLocal2(BulletBody obj, Vector3 inert); | 356 | public abstract int GetBodyType(BulletBody obj); |
586 | 357 | ||
587 | public abstract void SetSleepingThresholds2(BulletBody obj, float lin_threshold, float ang_threshold); | 358 | public abstract BulletBody CreateBodyFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); |
588 | 359 | ||
589 | public abstract void ApplyTorque2(BulletBody obj, Vector3 torque); | 360 | public abstract BulletBody CreateBodyWithDefaultMotionState(BulletShape shape, uint id, Vector3 pos, Quaternion rot); |
590 | |||
591 | // Apply force at the given point. Will add torque to the object. | ||
592 | public abstract void ApplyForce2(BulletBody obj, Vector3 force, Vector3 pos); | ||
593 | |||
594 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | ||
595 | public abstract void ApplyCentralImpulse2(BulletBody obj, Vector3 imp); | ||
596 | |||
597 | // Apply impulse to the object's torque. Force is scaled by object's mass. | ||
598 | public abstract void ApplyTorqueImpulse2(BulletBody obj, Vector3 imp); | ||
599 | |||
600 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | ||
601 | public abstract void ApplyImpulse2(BulletBody obj, Vector3 imp, Vector3 pos); | ||
602 | 361 | ||
603 | public abstract void ClearForces2(BulletBody obj); | 362 | public abstract BulletBody CreateGhostFromShape(BulletWorld sim, BulletShape shape, uint id, Vector3 pos, Quaternion rot); |
604 | 363 | ||
605 | public abstract void ClearAllForces2(BulletBody obj); | 364 | public abstract IntPtr AllocateBodyInfo(BulletBody obj); |
606 | 365 | ||
607 | public abstract void UpdateInertiaTensor2(BulletBody obj); | 366 | public abstract void ReleaseBodyInfo(IntPtr obj); |
608 | 367 | ||
368 | public abstract void DestroyObject(BulletWorld sim, BulletBody obj); | ||
609 | 369 | ||
610 | /* | 370 | /* |
611 | public abstract Transform GetCenterOfMassTransform2(BulletBody obj); | ||
612 | */ | ||
613 | |||
614 | public abstract Vector3 GetLinearVelocity2(BulletBody obj); | ||
615 | |||
616 | public abstract Vector3 GetAngularVelocity2(BulletBody obj); | ||
617 | |||
618 | public abstract void SetLinearVelocity2(BulletBody obj, Vector3 val); | ||
619 | |||
620 | public abstract void SetAngularVelocity2(BulletBody obj, Vector3 angularVelocity); | ||
621 | |||
622 | public abstract Vector3 GetVelocityInLocalPoint2(BulletBody obj, Vector3 pos); | ||
623 | |||
624 | public abstract void Translate2(BulletBody obj, Vector3 trans); | ||
625 | |||
626 | public abstract void UpdateDeactivation2(BulletBody obj, float timeStep); | ||
627 | |||
628 | public abstract bool WantsSleeping2(BulletBody obj); | ||
629 | |||
630 | public abstract void SetAngularFactor2(BulletBody obj, float factor); | ||
631 | |||
632 | public abstract void SetAngularFactorV2(BulletBody obj, Vector3 factor); | ||
633 | |||
634 | public abstract Vector3 GetAngularFactor2(BulletBody obj); | ||
635 | |||
636 | public abstract bool IsInWorld2(BulletBody obj); | ||
637 | |||
638 | public abstract void AddConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
639 | |||
640 | public abstract void RemoveConstraintRef2(BulletBody obj, BulletConstraint constrain); | ||
641 | |||
642 | public abstract BulletConstraint GetConstraintRef2(BulletBody obj, int index); | ||
643 | |||
644 | public abstract int GetNumConstraintRefs2(BulletBody obj); | ||
645 | |||
646 | public abstract bool SetCollisionGroupMask2(BulletBody body, uint filter, uint mask); | ||
647 | |||
648 | // ===================================================================================== | ||
649 | // btCollisionShape entries | ||
650 | |||
651 | public abstract float GetAngularMotionDisc2(BulletShape shape); | ||
652 | |||
653 | public abstract float GetContactBreakingThreshold2(BulletShape shape, float defaultFactor); | ||
654 | |||
655 | public abstract bool IsPolyhedral2(BulletShape shape); | ||
656 | |||
657 | public abstract bool IsConvex2d2(BulletShape shape); | ||
658 | |||
659 | public abstract bool IsConvex2(BulletShape shape); | ||
660 | |||
661 | public abstract bool IsNonMoving2(BulletShape shape); | ||
662 | |||
663 | public abstract bool IsConcave2(BulletShape shape); | ||
664 | |||
665 | public abstract bool IsCompound2(BulletShape shape); | ||
666 | |||
667 | public abstract bool IsSoftBody2(BulletShape shape); | ||
668 | |||
669 | public abstract bool IsInfinite2(BulletShape shape); | ||
670 | |||
671 | public abstract void SetLocalScaling2(BulletShape shape, Vector3 scale); | ||
672 | |||
673 | public abstract Vector3 GetLocalScaling2(BulletShape shape); | ||
674 | |||
675 | public abstract Vector3 CalculateLocalInertia2(BulletShape shape, float mass); | ||
676 | |||
677 | public abstract int GetShapeType2(BulletShape shape); | ||
678 | |||
679 | public abstract void SetMargin2(BulletShape shape, float val); | ||
680 | |||
681 | public abstract float GetMargin2(BulletShape shape); | ||
682 | |||
683 | }; | ||
684 | |||
685 | // =============================================================================== | ||
686 | static class BulletSimAPI { | ||
687 | // =============================================================================== | ||
688 | // Link back to the managed code for outputting log messages | ||
689 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
690 | public delegate void DebugLogCallback([MarshalAs(UnmanagedType.LPStr)]string msg); | ||
691 | |||
692 | // =============================================================================== | ||
693 | // Initialization and simulation | ||
694 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
695 | public static extern IntPtr Initialize2(Vector3 maxPosition, IntPtr parms, | ||
696 | int maxCollisions, IntPtr collisionArray, | ||
697 | int maxUpdates, IntPtr updateArray, | ||
698 | DebugLogCallback logRoutine); | ||
699 | |||
700 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
701 | public static extern bool UpdateParameter2(IntPtr world, uint localID, String parm, float value); | ||
702 | |||
703 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
704 | public static extern void SetHeightMap2(IntPtr world, float[] heightmap); | ||
705 | |||
706 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
707 | public static extern void Shutdown2(IntPtr sim); | ||
708 | |||
709 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
710 | public static extern int PhysicsStep2(IntPtr world, float timeStep, int maxSubSteps, float fixedTimeStep, | ||
711 | out int updatedEntityCount, | ||
712 | out IntPtr updatedEntitiesPtr, | ||
713 | out int collidersCount, | ||
714 | out IntPtr collidersPtr); | ||
715 | |||
716 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
717 | public static extern bool PushUpdate2(IntPtr obj); | ||
718 | |||
719 | // ===================================================================================== | ||
720 | // Mesh, hull, shape and body creation helper routines | ||
721 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
722 | public static extern IntPtr CreateMeshShape2(IntPtr world, | ||
723 | int indicesCount, [MarshalAs(UnmanagedType.LPArray)] int[] indices, | ||
724 | int verticesCount, [MarshalAs(UnmanagedType.LPArray)] float[] vertices ); | ||
725 | |||
726 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
727 | public static extern IntPtr CreateHullShape2(IntPtr world, | ||
728 | int hullCount, [MarshalAs(UnmanagedType.LPArray)] float[] hulls); | ||
729 | |||
730 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
731 | public static extern IntPtr BuildHullShapeFromMesh2(IntPtr world, IntPtr meshShape); | ||
732 | |||
733 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
734 | public static extern IntPtr BuildNativeShape2(IntPtr world, ShapeData shapeData); | ||
735 | |||
736 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
737 | public static extern bool IsNativeShape2(IntPtr shape); | ||
738 | |||
739 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
740 | public static extern void SetShapeCollisionMargin(IntPtr shape, float margin); | ||
741 | |||
742 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
743 | public static extern IntPtr BuildCapsuleShape2(IntPtr world, float radius, float height, Vector3 scale); | ||
744 | |||
745 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
746 | public static extern IntPtr CreateCompoundShape2(IntPtr sim, bool enableDynamicAabbTree); | ||
747 | |||
748 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
749 | public static extern int GetNumberOfCompoundChildren2(IntPtr cShape); | ||
750 | |||
751 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
752 | public static extern void AddChildShapeToCompoundShape2(IntPtr cShape, IntPtr addShape, Vector3 pos, Quaternion rot); | ||
753 | |||
754 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
755 | public static extern IntPtr GetChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
756 | |||
757 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
758 | public static extern IntPtr RemoveChildShapeFromCompoundShapeIndex2(IntPtr cShape, int indx); | ||
759 | |||
760 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
761 | public static extern void RemoveChildShapeFromCompoundShape2(IntPtr cShape, IntPtr removeShape); | ||
762 | |||
763 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
764 | public static extern void RecalculateCompoundShapeLocalAabb2(IntPtr cShape); | ||
765 | |||
766 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
767 | public static extern IntPtr DuplicateCollisionShape2(IntPtr sim, IntPtr srcShape, uint id); | ||
768 | |||
769 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
770 | public static extern IntPtr CreateBodyFromShapeAndInfo2(IntPtr sim, IntPtr shape, uint id, IntPtr constructionInfo); | ||
771 | |||
772 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
773 | public static extern bool DeleteCollisionShape2(IntPtr world, IntPtr shape); | ||
774 | |||
775 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
776 | public static extern int GetBodyType2(IntPtr obj); | ||
777 | |||
778 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
779 | public static extern IntPtr CreateBodyFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
780 | |||
781 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
782 | public static extern IntPtr CreateBodyWithDefaultMotionState2(IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
783 | |||
784 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
785 | public static extern IntPtr CreateGhostFromShape2(IntPtr sim, IntPtr shape, uint id, Vector3 pos, Quaternion rot); | ||
786 | |||
787 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
788 | public static extern IntPtr AllocateBodyInfo2(IntPtr obj); | ||
789 | |||
790 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
791 | public static extern void ReleaseBodyInfo2(IntPtr obj); | ||
792 | |||
793 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
794 | public static extern void DestroyObject2(IntPtr sim, IntPtr obj); | ||
795 | |||
796 | // ===================================================================================== | 371 | // ===================================================================================== |
797 | // Terrain creation and helper routines | 372 | // Terrain creation and helper routines |
798 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 373 | public abstract IntPtr CreateHeightMapInfo(BulletWorld sim, uint id, Vector3 minCoords, Vector3 maxCoords, |
799 | public static extern IntPtr CreateHeightMapInfo2(IntPtr sim, uint id, Vector3 minCoords, Vector3 maxCoords, | 374 | float[] heightMap, float collisionMargin); |
800 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
801 | 375 | ||
802 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 376 | public abstract IntPtr FillHeightMapInfo(BulletWorld sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, |
803 | public static extern IntPtr FillHeightMapInfo2(IntPtr sim, IntPtr mapInfo, uint id, Vector3 minCoords, Vector3 maxCoords, | 377 | float[] heightMap, float collisionMargin); |
804 | [MarshalAs(UnmanagedType.LPArray)] float[] heightMap, float collisionMargin); | ||
805 | 378 | ||
806 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 379 | public abstract bool ReleaseHeightMapInfo(IntPtr heightMapInfo); |
807 | public static extern bool ReleaseHeightMapInfo2(IntPtr heightMapInfo); | ||
808 | 380 | ||
809 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 381 | public abstract BulletBody CreateGroundPlaneShape(uint id, float height, float collisionMargin); |
810 | public static extern IntPtr CreateGroundPlaneShape2(uint id, float height, float collisionMargin); | ||
811 | 382 | ||
812 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 383 | public abstract BulletBody CreateTerrainShape(IntPtr mapInfo); |
813 | public static extern IntPtr CreateTerrainShape2(IntPtr mapInfo); | ||
814 | 384 | ||
815 | // ===================================================================================== | 385 | // ===================================================================================== |
816 | // Constraint creation and helper routines | 386 | // Constraint creation and helper routines |
817 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 387 | public abstract BulletConstraint Create6DofConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
818 | public static extern IntPtr Create6DofConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
819 | Vector3 frame1loc, Quaternion frame1rot, | 388 | Vector3 frame1loc, Quaternion frame1rot, |
820 | Vector3 frame2loc, Quaternion frame2rot, | 389 | Vector3 frame2loc, Quaternion frame2rot, |
821 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 390 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); |
822 | 391 | ||
823 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 392 | public abstract BulletConstraint Create6DofConstraintToPoint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
824 | public static extern IntPtr Create6DofConstraintToPoint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
825 | Vector3 joinPoint, | 393 | Vector3 joinPoint, |
826 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 394 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); |
827 | 395 | ||
828 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 396 | public abstract BulletConstraint CreateHingeConstraint(BulletWorld world, BulletBody obj1, BulletBody obj2, |
829 | public static extern IntPtr CreateHingeConstraint2(IntPtr world, IntPtr obj1, IntPtr obj2, | ||
830 | Vector3 pivotinA, Vector3 pivotinB, | 397 | Vector3 pivotinA, Vector3 pivotinB, |
831 | Vector3 axisInA, Vector3 axisInB, | 398 | Vector3 axisInA, Vector3 axisInB, |
832 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); | 399 | bool useLinearReferenceFrameA, bool disableCollisionsBetweenLinkedBodies); |
833 | 400 | ||
834 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 401 | public abstract void SetConstraintEnable(BulletConstraint constrain, float numericTrueFalse); |
835 | public static extern void SetConstraintEnable2(IntPtr constrain, float numericTrueFalse); | ||
836 | 402 | ||
837 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 403 | public abstract void SetConstraintNumSolverIterations(BulletConstraint constrain, float iterations); |
838 | public static extern void SetConstraintNumSolverIterations2(IntPtr constrain, float iterations); | ||
839 | 404 | ||
840 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 405 | public abstract bool SetFrames(BulletConstraint constrain, |
841 | public static extern bool SetFrames2(IntPtr constrain, | ||
842 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); | 406 | Vector3 frameA, Quaternion frameArot, Vector3 frameB, Quaternion frameBrot); |
843 | 407 | ||
844 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 408 | public abstract bool SetLinearLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); |
845 | public static extern bool SetLinearLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | ||
846 | 409 | ||
847 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 410 | public abstract bool SetAngularLimits(BulletConstraint constrain, Vector3 low, Vector3 hi); |
848 | public static extern bool SetAngularLimits2(IntPtr constrain, Vector3 low, Vector3 hi); | ||
849 | 411 | ||
850 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 412 | public abstract bool UseFrameOffset(BulletConstraint constrain, float enable); |
851 | public static extern bool UseFrameOffset2(IntPtr constrain, float enable); | ||
852 | 413 | ||
853 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 414 | public abstract bool TranslationalLimitMotor(BulletConstraint constrain, float enable, float targetVel, float maxMotorForce); |
854 | public static extern bool TranslationalLimitMotor2(IntPtr constrain, float enable, float targetVel, float maxMotorForce); | ||
855 | 415 | ||
856 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 416 | public abstract bool SetBreakingImpulseThreshold(BulletConstraint constrain, float threshold); |
857 | public static extern bool SetBreakingImpulseThreshold2(IntPtr constrain, float threshold); | ||
858 | 417 | ||
859 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 418 | public abstract bool CalculateTransforms(BulletConstraint constrain); |
860 | public static extern bool CalculateTransforms2(IntPtr constrain); | ||
861 | 419 | ||
862 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 420 | public abstract bool SetConstraintParam(BulletConstraint constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); |
863 | public static extern bool SetConstraintParam2(IntPtr constrain, ConstraintParams paramIndex, float value, ConstraintParamAxis axis); | ||
864 | 421 | ||
865 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 422 | public abstract bool DestroyConstraint(BulletWorld world, BulletConstraint constrain); |
866 | public static extern bool DestroyConstraint2(IntPtr world, IntPtr constrain); | ||
867 | 423 | ||
868 | // ===================================================================================== | 424 | // ===================================================================================== |
869 | // btCollisionWorld entries | 425 | // btCollisionWorld entries |
870 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 426 | public abstract void UpdateSingleAabb(BulletWorld world, BulletBody obj); |
871 | public static extern void UpdateSingleAabb2(IntPtr world, IntPtr obj); | ||
872 | 427 | ||
873 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 428 | public abstract void UpdateAabbs(BulletWorld world); |
874 | public static extern void UpdateAabbs2(IntPtr world); | ||
875 | 429 | ||
876 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 430 | public abstract bool GetForceUpdateAllAabbs(BulletWorld world); |
877 | public static extern bool GetForceUpdateAllAabbs2(IntPtr world); | ||
878 | 431 | ||
879 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 432 | public abstract void SetForceUpdateAllAabbs(BulletWorld world, bool force); |
880 | public static extern void SetForceUpdateAllAabbs2(IntPtr world, bool force); | ||
881 | 433 | ||
882 | // ===================================================================================== | 434 | // ===================================================================================== |
883 | // btDynamicsWorld entries | 435 | // btDynamicsWorld entries |
884 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 436 | public abstract bool AddObjectToWorld(BulletWorld world, BulletBody obj); |
885 | public static extern bool AddObjectToWorld2(IntPtr world, IntPtr obj); | ||
886 | 437 | ||
887 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 438 | public abstract bool RemoveObjectFromWorld(BulletWorld world, BulletBody obj); |
888 | public static extern bool RemoveObjectFromWorld2(IntPtr world, IntPtr obj); | ||
889 | 439 | ||
890 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 440 | public abstract bool AddConstraintToWorld(BulletWorld world, BulletConstraint constrain, bool disableCollisionsBetweenLinkedObjects); |
891 | public static extern bool AddConstraintToWorld2(IntPtr world, IntPtr constrain, bool disableCollisionsBetweenLinkedObjects); | ||
892 | 441 | ||
893 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 442 | public abstract bool RemoveConstraintFromWorld(BulletWorld world, BulletConstraint constrain); |
894 | public static extern bool RemoveConstraintFromWorld2(IntPtr world, IntPtr constrain); | ||
895 | // ===================================================================================== | 443 | // ===================================================================================== |
896 | // btCollisionObject entries | 444 | // btCollisionObject entries |
897 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 445 | public abstract Vector3 GetAnisotripicFriction(BulletConstraint constrain); |
898 | public static extern Vector3 GetAnisotripicFriction2(IntPtr constrain); | ||
899 | 446 | ||
900 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 447 | public abstract Vector3 SetAnisotripicFriction(BulletConstraint constrain, Vector3 frict); |
901 | public static extern Vector3 SetAnisotripicFriction2(IntPtr constrain, Vector3 frict); | ||
902 | 448 | ||
903 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 449 | public abstract bool HasAnisotripicFriction(BulletConstraint constrain); |
904 | public static extern bool HasAnisotripicFriction2(IntPtr constrain); | ||
905 | 450 | ||
906 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 451 | public abstract void SetContactProcessingThreshold(BulletBody obj, float val); |
907 | public static extern void SetContactProcessingThreshold2(IntPtr obj, float val); | ||
908 | 452 | ||
909 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 453 | public abstract float GetContactProcessingThreshold(BulletBody obj); |
910 | public static extern float GetContactProcessingThreshold2(IntPtr obj); | ||
911 | 454 | ||
912 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 455 | public abstract bool IsStaticObject(BulletBody obj); |
913 | public static extern bool IsStaticObject2(IntPtr obj); | ||
914 | 456 | ||
915 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 457 | public abstract bool IsKinematicObject(BulletBody obj); |
916 | public static extern bool IsKinematicObject2(IntPtr obj); | ||
917 | 458 | ||
918 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 459 | public abstract bool IsStaticOrKinematicObject(BulletBody obj); |
919 | public static extern bool IsStaticOrKinematicObject2(IntPtr obj); | ||
920 | 460 | ||
921 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 461 | public abstract bool HasContactResponse(BulletBody obj); |
922 | public static extern bool HasContactResponse2(IntPtr obj); | ||
923 | 462 | ||
924 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 463 | public abstract void SetCollisionShape(BulletWorld sim, BulletBody obj, BulletBody shape); |
925 | public static extern void SetCollisionShape2(IntPtr sim, IntPtr obj, IntPtr shape); | ||
926 | 464 | ||
927 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 465 | public abstract BulletShape GetCollisionShape(BulletBody obj); |
928 | public static extern IntPtr GetCollisionShape2(IntPtr obj); | ||
929 | 466 | ||
930 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 467 | public abstract int GetActivationState(BulletBody obj); |
931 | public static extern int GetActivationState2(IntPtr obj); | ||
932 | 468 | ||
933 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 469 | public abstract void SetActivationState(BulletBody obj, int state); |
934 | public static extern void SetActivationState2(IntPtr obj, int state); | ||
935 | 470 | ||
936 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 471 | public abstract void SetDeactivationTime(BulletBody obj, float dtime); |
937 | public static extern void SetDeactivationTime2(IntPtr obj, float dtime); | ||
938 | 472 | ||
939 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 473 | public abstract float GetDeactivationTime(BulletBody obj); |
940 | public static extern float GetDeactivationTime2(IntPtr obj); | ||
941 | 474 | ||
942 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 475 | public abstract void ForceActivationState(BulletBody obj, ActivationState state); |
943 | public static extern void ForceActivationState2(IntPtr obj, ActivationState state); | ||
944 | 476 | ||
945 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 477 | public abstract void Activate(BulletBody obj, bool forceActivation); |
946 | public static extern void Activate2(IntPtr obj, bool forceActivation); | ||
947 | 478 | ||
948 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 479 | public abstract bool IsActive(BulletBody obj); |
949 | public static extern bool IsActive2(IntPtr obj); | ||
950 | 480 | ||
951 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 481 | public abstract void SetRestitution(BulletBody obj, float val); |
952 | public static extern void SetRestitution2(IntPtr obj, float val); | ||
953 | 482 | ||
954 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 483 | public abstract float GetRestitution(BulletBody obj); |
955 | public static extern float GetRestitution2(IntPtr obj); | ||
956 | 484 | ||
957 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 485 | public abstract void SetFriction(BulletBody obj, float val); |
958 | public static extern void SetFriction2(IntPtr obj, float val); | ||
959 | 486 | ||
960 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 487 | public abstract float GetFriction(BulletBody obj); |
961 | public static extern float GetFriction2(IntPtr obj); | ||
962 | 488 | ||
963 | /* Haven't defined the type 'Transform' | 489 | public abstract Vector3 GetPosition(BulletBody obj); |
964 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
965 | public static extern Transform GetWorldTransform2(IntPtr obj); | ||
966 | 490 | ||
967 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 491 | public abstract Quaternion GetOrientation(BulletBody obj); |
968 | public static extern void setWorldTransform2(IntPtr obj, Transform trans); | ||
969 | */ | ||
970 | 492 | ||
971 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 493 | public abstract void SetTranslation(BulletBody obj, Vector3 position, Quaternion rotation); |
972 | public static extern Vector3 GetPosition2(IntPtr obj); | ||
973 | 494 | ||
974 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 495 | public abstract IntPtr GetBroadphaseHandle(BulletBody obj); |
975 | public static extern Quaternion GetOrientation2(IntPtr obj); | ||
976 | 496 | ||
977 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 497 | public abstract void SetBroadphaseHandle(BulletBody obj, IntPtr handle); |
978 | public static extern void SetTranslation2(IntPtr obj, Vector3 position, Quaternion rotation); | ||
979 | 498 | ||
980 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 499 | public abstract void SetInterpolationLinearVelocity(BulletBody obj, Vector3 vel); |
981 | public static extern IntPtr GetBroadphaseHandle2(IntPtr obj); | ||
982 | 500 | ||
983 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 501 | public abstract void SetInterpolationAngularVelocity(BulletBody obj, Vector3 vel); |
984 | public static extern void SetBroadphaseHandle2(IntPtr obj, IntPtr handle); | ||
985 | 502 | ||
986 | /* | 503 | public abstract void SetInterpolationVelocity(BulletBody obj, Vector3 linearVel, Vector3 angularVel); |
987 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
988 | public static extern Transform GetInterpolationWorldTransform2(IntPtr obj); | ||
989 | 504 | ||
990 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 505 | public abstract float GetHitFraction(BulletBody obj); |
991 | public static extern void SetInterpolationWorldTransform2(IntPtr obj, Transform trans); | ||
992 | */ | ||
993 | |||
994 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
995 | public static extern void SetInterpolationLinearVelocity2(IntPtr obj, Vector3 vel); | ||
996 | |||
997 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
998 | public static extern void SetInterpolationAngularVelocity2(IntPtr obj, Vector3 vel); | ||
999 | |||
1000 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1001 | public static extern void SetInterpolationVelocity2(IntPtr obj, Vector3 linearVel, Vector3 angularVel); | ||
1002 | 506 | ||
1003 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 507 | public abstract void SetHitFraction(BulletBody obj, float val); |
1004 | public static extern float GetHitFraction2(IntPtr obj); | ||
1005 | 508 | ||
1006 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 509 | public abstract CollisionFlags GetCollisionFlags(BulletBody obj); |
1007 | public static extern void SetHitFraction2(IntPtr obj, float val); | ||
1008 | 510 | ||
1009 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 511 | public abstract CollisionFlags SetCollisionFlags(BulletBody obj, CollisionFlags flags); |
1010 | public static extern CollisionFlags GetCollisionFlags2(IntPtr obj); | ||
1011 | 512 | ||
1012 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 513 | public abstract CollisionFlags AddToCollisionFlags(BulletBody obj, CollisionFlags flags); |
1013 | public static extern CollisionFlags SetCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1014 | 514 | ||
1015 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 515 | public abstract CollisionFlags RemoveFromCollisionFlags(BulletBody obj, CollisionFlags flags); |
1016 | public static extern CollisionFlags AddToCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1017 | 516 | ||
1018 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 517 | public abstract float GetCcdMotionThreshold(BulletBody obj); |
1019 | public static extern CollisionFlags RemoveFromCollisionFlags2(IntPtr obj, CollisionFlags flags); | ||
1020 | 518 | ||
1021 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 519 | public abstract void SetCcdMotionThreshold(BulletBody obj, float val); |
1022 | public static extern float GetCcdMotionThreshold2(IntPtr obj); | ||
1023 | 520 | ||
1024 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 521 | public abstract float GetCcdSweptSphereRadius(BulletBody obj); |
1025 | public static extern void SetCcdMotionThreshold2(IntPtr obj, float val); | ||
1026 | 522 | ||
1027 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 523 | public abstract void SetCcdSweptSphereRadius(BulletBody obj, float val); |
1028 | public static extern float GetCcdSweptSphereRadius2(IntPtr obj); | ||
1029 | 524 | ||
1030 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 525 | public abstract IntPtr GetUserPointer(BulletBody obj); |
1031 | public static extern void SetCcdSweptSphereRadius2(IntPtr obj, float val); | ||
1032 | 526 | ||
1033 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 527 | public abstract void SetUserPointer(BulletBody obj, IntPtr val); |
1034 | public static extern IntPtr GetUserPointer2(IntPtr obj); | ||
1035 | |||
1036 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1037 | public static extern void SetUserPointer2(IntPtr obj, IntPtr val); | ||
1038 | 528 | ||
1039 | // ===================================================================================== | 529 | // ===================================================================================== |
1040 | // btRigidBody entries | 530 | // btRigidBody entries |
1041 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 531 | public abstract void ApplyGravity(BulletBody obj); |
1042 | public static extern void ApplyGravity2(IntPtr obj); | ||
1043 | |||
1044 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1045 | public static extern void SetGravity2(IntPtr obj, Vector3 val); | ||
1046 | 532 | ||
1047 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 533 | public abstract void SetGravity(BulletBody obj, Vector3 val); |
1048 | public static extern Vector3 GetGravity2(IntPtr obj); | ||
1049 | 534 | ||
1050 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 535 | public abstract Vector3 GetGravity(BulletBody obj); |
1051 | public static extern void SetDamping2(IntPtr obj, float lin_damping, float ang_damping); | ||
1052 | 536 | ||
1053 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 537 | public abstract void SetDamping(BulletBody obj, float lin_damping, float ang_damping); |
1054 | public static extern void SetLinearDamping2(IntPtr obj, float lin_damping); | ||
1055 | 538 | ||
1056 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 539 | public abstract void SetLinearDamping(BulletBody obj, float lin_damping); |
1057 | public static extern void SetAngularDamping2(IntPtr obj, float ang_damping); | ||
1058 | 540 | ||
1059 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 541 | public abstract void SetAngularDamping(BulletBody obj, float ang_damping); |
1060 | public static extern float GetLinearDamping2(IntPtr obj); | ||
1061 | 542 | ||
1062 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 543 | public abstract float GetLinearDamping(BulletBody obj); |
1063 | public static extern float GetAngularDamping2(IntPtr obj); | ||
1064 | 544 | ||
1065 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 545 | public abstract float GetAngularDamping(BulletBody obj); |
1066 | public static extern float GetLinearSleepingThreshold2(IntPtr obj); | ||
1067 | 546 | ||
1068 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 547 | public abstract float GetLinearSleepingThreshold(BulletBody obj); |
1069 | public static extern float GetAngularSleepingThreshold2(IntPtr obj); | ||
1070 | 548 | ||
1071 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1072 | public static extern void ApplyDamping2(IntPtr obj, float timeStep); | ||
1073 | 549 | ||
1074 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 550 | public abstract void ApplyDamping(BulletBody obj, float timeStep); |
1075 | public static extern void SetMassProps2(IntPtr obj, float mass, Vector3 inertia); | ||
1076 | 551 | ||
1077 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 552 | public abstract void SetMassProps(BulletBody obj, float mass, Vector3 inertia); |
1078 | public static extern Vector3 GetLinearFactor2(IntPtr obj); | ||
1079 | 553 | ||
1080 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 554 | public abstract Vector3 GetLinearFactor(BulletBody obj); |
1081 | public static extern void SetLinearFactor2(IntPtr obj, Vector3 factor); | ||
1082 | 555 | ||
1083 | /* | 556 | public abstract void SetLinearFactor(BulletBody obj, Vector3 factor); |
1084 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1085 | public static extern void SetCenterOfMassTransform2(IntPtr obj, Transform trans); | ||
1086 | */ | ||
1087 | 557 | ||
1088 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 558 | public abstract void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quaternion rot); |
1089 | public static extern void SetCenterOfMassByPosRot2(IntPtr obj, Vector3 pos, Quaternion rot); | ||
1090 | 559 | ||
1091 | // Add a force to the object as if its mass is one. | 560 | // Add a force to the object as if its mass is one. |
1092 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 561 | public abstract void ApplyCentralForce(BulletBody obj, Vector3 force); |
1093 | public static extern void ApplyCentralForce2(IntPtr obj, Vector3 force); | ||
1094 | 562 | ||
1095 | // Set the force being applied to the object as if its mass is one. | 563 | // Set the force being applied to the object as if its mass is one. |
1096 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 564 | public abstract void SetObjectForce(BulletBody obj, Vector3 force); |
1097 | public static extern void SetObjectForce2(IntPtr obj, Vector3 force); | ||
1098 | 565 | ||
1099 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 566 | public abstract Vector3 GetTotalForce(BulletBody obj); |
1100 | public static extern Vector3 GetTotalForce2(IntPtr obj); | ||
1101 | 567 | ||
1102 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 568 | public abstract Vector3 GetTotalTorque(BulletBody obj); |
1103 | public static extern Vector3 GetTotalTorque2(IntPtr obj); | ||
1104 | 569 | ||
1105 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 570 | public abstract Vector3 GetInvInertiaDiagLocal(BulletBody obj); |
1106 | public static extern Vector3 GetInvInertiaDiagLocal2(IntPtr obj); | ||
1107 | 571 | ||
1108 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 572 | public abstract void SetInvInertiaDiagLocal(BulletBody obj, Vector3 inert); |
1109 | public static extern void SetInvInertiaDiagLocal2(IntPtr obj, Vector3 inert); | ||
1110 | 573 | ||
1111 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 574 | public abstract void SetSleepingThresholds(BulletBody obj, float lin_threshold, float ang_threshold); |
1112 | public static extern void SetSleepingThresholds2(IntPtr obj, float lin_threshold, float ang_threshold); | ||
1113 | 575 | ||
1114 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 576 | public abstract void ApplyTorque(BulletBody obj, Vector3 torque); |
1115 | public static extern void ApplyTorque2(IntPtr obj, Vector3 torque); | ||
1116 | 577 | ||
1117 | // Apply force at the given point. Will add torque to the object. | 578 | // Apply force at the given point. Will add torque to the object. |
1118 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 579 | public abstract void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos); |
1119 | public static extern void ApplyForce2(IntPtr obj, Vector3 force, Vector3 pos); | ||
1120 | 580 | ||
1121 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | 581 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. |
1122 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 582 | public abstract void ApplyCentralImpulse(BulletBody obj, Vector3 imp); |
1123 | public static extern void ApplyCentralImpulse2(IntPtr obj, Vector3 imp); | ||
1124 | 583 | ||
1125 | // Apply impulse to the object's torque. Force is scaled by object's mass. | 584 | // Apply impulse to the object's torque. Force is scaled by object's mass. |
1126 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 585 | public abstract void ApplyTorqueImpulse(BulletBody obj, Vector3 imp); |
1127 | public static extern void ApplyTorqueImpulse2(IntPtr obj, Vector3 imp); | ||
1128 | 586 | ||
1129 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | 587 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. |
1130 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 588 | public abstract void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos); |
1131 | public static extern void ApplyImpulse2(IntPtr obj, Vector3 imp, Vector3 pos); | ||
1132 | |||
1133 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1134 | public static extern void ClearForces2(IntPtr obj); | ||
1135 | 589 | ||
1136 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 590 | public abstract void ClearForces(BulletBody obj); |
1137 | public static extern void ClearAllForces2(IntPtr obj); | ||
1138 | 591 | ||
1139 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 592 | public abstract void ClearAllForces(BulletBody obj); |
1140 | public static extern void UpdateInertiaTensor2(IntPtr obj); | ||
1141 | 593 | ||
1142 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 594 | public abstract void UpdateInertiaTensor(BulletBody obj); |
1143 | public static extern Vector3 GetCenterOfMassPosition2(IntPtr obj); | ||
1144 | |||
1145 | /* | ||
1146 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1147 | public static extern Transform GetCenterOfMassTransform2(IntPtr obj); | ||
1148 | */ | ||
1149 | 595 | ||
1150 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 596 | public abstract Vector3 GetLinearVelocity(BulletBody obj); |
1151 | public static extern Vector3 GetLinearVelocity2(IntPtr obj); | ||
1152 | 597 | ||
1153 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 598 | public abstract Vector3 GetAngularVelocity(BulletBody obj); |
1154 | public static extern Vector3 GetAngularVelocity2(IntPtr obj); | ||
1155 | 599 | ||
1156 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 600 | public abstract void SetLinearVelocity(BulletBody obj, Vector3 val); |
1157 | public static extern void SetLinearVelocity2(IntPtr obj, Vector3 val); | ||
1158 | 601 | ||
1159 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 602 | public abstract void SetAngularVelocity(BulletBody obj, Vector3 angularVelocity); |
1160 | public static extern void SetAngularVelocity2(IntPtr obj, Vector3 angularVelocity); | ||
1161 | 603 | ||
1162 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 604 | public abstract Vector3 GetVelocityInLocalPoint(BulletBody obj, Vector3 pos); |
1163 | public static extern Vector3 GetVelocityInLocalPoint2(IntPtr obj, Vector3 pos); | ||
1164 | 605 | ||
1165 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 606 | public abstract void Translate(BulletBody obj, Vector3 trans); |
1166 | public static extern void Translate2(IntPtr obj, Vector3 trans); | ||
1167 | 607 | ||
1168 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 608 | public abstract void UpdateDeactivation(BulletBody obj, float timeStep); |
1169 | public static extern void UpdateDeactivation2(IntPtr obj, float timeStep); | ||
1170 | 609 | ||
1171 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 610 | public abstract bool WantsSleeping(BulletBody obj); |
1172 | public static extern bool WantsSleeping2(IntPtr obj); | ||
1173 | 611 | ||
1174 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 612 | public abstract void SetAngularFactor(BulletBody obj, float factor); |
1175 | public static extern void SetAngularFactor2(IntPtr obj, float factor); | ||
1176 | 613 | ||
1177 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 614 | public abstract void SetAngularFactorV(BulletBody obj, Vector3 factor); |
1178 | public static extern void SetAngularFactorV2(IntPtr obj, Vector3 factor); | ||
1179 | 615 | ||
1180 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 616 | public abstract Vector3 GetAngularFactor(BulletBody obj); |
1181 | public static extern Vector3 GetAngularFactor2(IntPtr obj); | ||
1182 | 617 | ||
1183 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 618 | public abstract bool IsInWorld(BulletBody obj); |
1184 | public static extern bool IsInWorld2(IntPtr obj); | ||
1185 | 619 | ||
1186 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 620 | public abstract void AddConstraintRef(BulletBody obj, BulletConstraint constrain); |
1187 | public static extern void AddConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1188 | 621 | ||
1189 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 622 | public abstract void RemoveConstraintRef(BulletBody obj, BulletConstraint constrain); |
1190 | public static extern void RemoveConstraintRef2(IntPtr obj, IntPtr constrain); | ||
1191 | 623 | ||
1192 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 624 | public abstract BulletConstraint GetConstraintRef(BulletBody obj, int index); |
1193 | public static extern IntPtr GetConstraintRef2(IntPtr obj, int index); | ||
1194 | 625 | ||
1195 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 626 | public abstract int GetNumConstraintRefs(BulletBody obj); |
1196 | public static extern int GetNumConstraintRefs2(IntPtr obj); | ||
1197 | 627 | ||
1198 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 628 | public abstract bool SetCollisionGroupMask(BulletBody body, uint filter, uint mask); |
1199 | public static extern bool SetCollisionGroupMask2(IntPtr body, uint filter, uint mask); | ||
1200 | 629 | ||
1201 | // ===================================================================================== | 630 | // ===================================================================================== |
1202 | // btCollisionShape entries | 631 | // btCollisionShape entries |
1203 | 632 | ||
1204 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 633 | public abstract float GetAngularMotionDisc(BulletShape shape); |
1205 | public static extern float GetAngularMotionDisc2(IntPtr shape); | ||
1206 | |||
1207 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1208 | public static extern float GetContactBreakingThreshold2(IntPtr shape, float defaultFactor); | ||
1209 | 634 | ||
1210 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 635 | public abstract float GetContactBreakingThreshold(BulletShape shape, float defaultFactor); |
1211 | public static extern bool IsPolyhedral2(IntPtr shape); | ||
1212 | 636 | ||
1213 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 637 | public abstract bool IsPolyhedral(BulletShape shape); |
1214 | public static extern bool IsConvex2d2(IntPtr shape); | ||
1215 | 638 | ||
1216 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 639 | public abstract bool IsConvex2d(BulletShape shape); |
1217 | public static extern bool IsConvex2(IntPtr shape); | ||
1218 | 640 | ||
1219 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 641 | public abstract bool IsConvex(BulletShape shape); |
1220 | public static extern bool IsNonMoving2(IntPtr shape); | ||
1221 | 642 | ||
1222 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 643 | public abstract bool IsNonMoving(BulletShape shape); |
1223 | public static extern bool IsConcave2(IntPtr shape); | ||
1224 | 644 | ||
1225 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 645 | public abstract bool IsConcave(BulletShape shape); |
1226 | public static extern bool IsCompound2(IntPtr shape); | ||
1227 | 646 | ||
1228 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 647 | public abstract bool IsCompound(BulletShape shape); |
1229 | public static extern bool IsSoftBody2(IntPtr shape); | ||
1230 | 648 | ||
1231 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 649 | public abstract bool IsSoftBody(BulletShape shape); |
1232 | public static extern bool IsInfinite2(IntPtr shape); | ||
1233 | 650 | ||
1234 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 651 | public abstract bool IsInfinite(BulletShape shape); |
1235 | public static extern void SetLocalScaling2(IntPtr shape, Vector3 scale); | ||
1236 | 652 | ||
1237 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 653 | public abstract void SetLocalScaling(BulletShape shape, Vector3 scale); |
1238 | public static extern Vector3 GetLocalScaling2(IntPtr shape); | ||
1239 | 654 | ||
1240 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 655 | public abstract Vector3 GetLocalScaling(BulletShape shape); |
1241 | public static extern Vector3 CalculateLocalInertia2(IntPtr shape, float mass); | ||
1242 | 656 | ||
1243 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 657 | public abstract Vector3 CalculateLocalInertia(BulletShape shape, float mass); |
1244 | public static extern int GetShapeType2(IntPtr shape); | ||
1245 | 658 | ||
1246 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 659 | public abstract int GetShapeType(BulletShape shape); |
1247 | public static extern void SetMargin2(IntPtr shape, float val); | ||
1248 | 660 | ||
1249 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 661 | public abstract void SetMargin(BulletShape shape, float val); |
1250 | public static extern float GetMargin2(IntPtr shape); | ||
1251 | |||
1252 | // ===================================================================================== | ||
1253 | // Debugging | ||
1254 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1255 | public static extern void DumpRigidBody2(IntPtr sim, IntPtr collisionObject); | ||
1256 | 662 | ||
1257 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 663 | public abstract float GetMargin(BulletShape shape); |
1258 | public static extern void DumpCollisionShape2(IntPtr sim, IntPtr collisionShape); | 664 | */ |
1259 | 665 | ||
1260 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | 666 | }; |
1261 | public static extern void DumpMapInfo2(IntPtr sim, IntPtr manInfo); | ||
1262 | |||
1263 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1264 | public static extern void DumpConstraint2(IntPtr sim, IntPtr constrain); | ||
1265 | |||
1266 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1267 | public static extern void DumpActivationInfo2(IntPtr sim); | ||
1268 | |||
1269 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1270 | public static extern void DumpAllInfo2(IntPtr sim); | ||
1271 | |||
1272 | [DllImport("BulletSim", CallingConvention = CallingConvention.Cdecl), SuppressUnmanagedCodeSecurity] | ||
1273 | public static extern void DumpPhysicsStatistics2(IntPtr sim); | ||
1274 | |||
1275 | } | ||
1276 | } | 667 | } |