diff options
author | Robert Adams | 2013-01-03 19:35:38 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-04 17:06:49 -0800 |
commit | 44492b3a4995651cd1d0d508b879d24e4d8f5707 (patch) | |
tree | 049f9197d7034e67280a15cce2a9afb8abe731ee /OpenSim/Region/Physics/BulletSPlugin | |
parent | BulletSim: fix problem where pre-step actions would not replaced (diff) | |
download | opensim-SC_OLD-44492b3a4995651cd1d0d508b879d24e4d8f5707.zip opensim-SC_OLD-44492b3a4995651cd1d0d508b879d24e4d8f5707.tar.gz opensim-SC_OLD-44492b3a4995651cd1d0d508b879d24e4d8f5707.tar.bz2 opensim-SC_OLD-44492b3a4995651cd1d0d508b879d24e4d8f5707.tar.xz |
BulletSim: add comments to force and impulse setting functions
so it is clear what Bullet is actually doing with the set values.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs index 45ecf56..14de2eb 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSAPIUnman.cs | |||
@@ -921,6 +921,7 @@ public override void SetCenterOfMassByPosRot(BulletBody obj, Vector3 pos, Quater | |||
921 | } | 921 | } |
922 | 922 | ||
923 | // Add a force to the object as if its mass is one. | 923 | // Add a force to the object as if its mass is one. |
924 | // Deep down in Bullet: m_totalForce += force*m_linearFactor; | ||
924 | public override void ApplyCentralForce(BulletBody obj, Vector3 force) | 925 | public override void ApplyCentralForce(BulletBody obj, Vector3 force) |
925 | { | 926 | { |
926 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 927 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
@@ -964,6 +965,7 @@ public override void SetSleepingThresholds(BulletBody obj, float lin_threshold, | |||
964 | BSAPICPP.SetSleepingThresholds2(bodyu.ptr, lin_threshold, ang_threshold); | 965 | BSAPICPP.SetSleepingThresholds2(bodyu.ptr, lin_threshold, ang_threshold); |
965 | } | 966 | } |
966 | 967 | ||
968 | // Deep down in Bullet: m_totalTorque += torque*m_angularFactor; | ||
967 | public override void ApplyTorque(BulletBody obj, Vector3 torque) | 969 | public override void ApplyTorque(BulletBody obj, Vector3 torque) |
968 | { | 970 | { |
969 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 971 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
@@ -971,6 +973,8 @@ public override void ApplyTorque(BulletBody obj, Vector3 torque) | |||
971 | } | 973 | } |
972 | 974 | ||
973 | // Apply force at the given point. Will add torque to the object. | 975 | // Apply force at the given point. Will add torque to the object. |
976 | // Deep down in Bullet: applyCentralForce(force); | ||
977 | // applyTorque(rel_pos.cross(force*m_linearFactor)); | ||
974 | public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos) | 978 | public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos) |
975 | { | 979 | { |
976 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 980 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
@@ -978,6 +982,7 @@ public override void ApplyForce(BulletBody obj, Vector3 force, Vector3 pos) | |||
978 | } | 982 | } |
979 | 983 | ||
980 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. | 984 | // Apply impulse to the object. Same as "ApplycentralForce" but force scaled by object's mass. |
985 | // Deep down in Bullet: m_linearVelocity += impulse *m_linearFactor * m_inverseMass; | ||
981 | public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp) | 986 | public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp) |
982 | { | 987 | { |
983 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 988 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
@@ -985,6 +990,7 @@ public override void ApplyCentralImpulse(BulletBody obj, Vector3 imp) | |||
985 | } | 990 | } |
986 | 991 | ||
987 | // Apply impulse to the object's torque. Force is scaled by object's mass. | 992 | // Apply impulse to the object's torque. Force is scaled by object's mass. |
993 | // Deep down in Bullet: m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor; | ||
988 | public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp) | 994 | public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp) |
989 | { | 995 | { |
990 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 996 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |
@@ -992,6 +998,8 @@ public override void ApplyTorqueImpulse(BulletBody obj, Vector3 imp) | |||
992 | } | 998 | } |
993 | 999 | ||
994 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. | 1000 | // Apply impulse at the point given. For is scaled by object's mass and effects both linear and angular forces. |
1001 | // Deep down in Bullet: applyCentralImpulse(impulse); | ||
1002 | // applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor)); | ||
995 | public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos) | 1003 | public override void ApplyImpulse(BulletBody obj, Vector3 imp, Vector3 pos) |
996 | { | 1004 | { |
997 | BulletBodyUnman bodyu = obj as BulletBodyUnman; | 1005 | BulletBodyUnman bodyu = obj as BulletBodyUnman; |