diff options
author | Robert Adams | 2012-12-10 15:35:53 -0800 |
---|---|---|
committer | Robert Adams | 2012-12-10 15:35:53 -0800 |
commit | 9df85eadf4b3719a898fda8769313ae023962c25 (patch) | |
tree | af055fb53368d75c236959bfde56d43f23e6f741 /OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |
parent | BulletSim: some comments about rebuilding linksets (having to recompute and r... (diff) | |
download | opensim-SC-9df85eadf4b3719a898fda8769313ae023962c25.zip opensim-SC-9df85eadf4b3719a898fda8769313ae023962c25.tar.gz opensim-SC-9df85eadf4b3719a898fda8769313ae023962c25.tar.bz2 opensim-SC-9df85eadf4b3719a898fda8769313ae023962c25.tar.xz |
BulletSim: Fix crash on the destruction of physical linksets.
While fixing the above, add methods to physical body and shape pointer
wrapper so routines won't have to know that IntPtr.Zero means no
physical instance.
Fix problem with physical linksets failing after a few sits and
unsits by properly restoring child prom positions for compound
linksets after multiple selection and deselections.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs index 2671995..1559025 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BulletSimAPI.cs | |||
@@ -53,6 +53,9 @@ public struct BulletSim | |||
53 | // An allocated Bullet btRigidBody | 53 | // An allocated Bullet btRigidBody |
54 | public struct BulletBody | 54 | public struct BulletBody |
55 | { | 55 | { |
56 | public BulletBody(uint id) : this(id, IntPtr.Zero) | ||
57 | { | ||
58 | } | ||
56 | public BulletBody(uint id, IntPtr xx) | 59 | public BulletBody(uint id, IntPtr xx) |
57 | { | 60 | { |
58 | ID = id; | 61 | ID = id; |
@@ -64,6 +67,13 @@ public struct BulletBody | |||
64 | public uint ID; | 67 | public uint ID; |
65 | public CollisionFilterGroups collisionGroup; | 68 | public CollisionFilterGroups collisionGroup; |
66 | public CollisionFilterGroups collisionMask; | 69 | public CollisionFilterGroups collisionMask; |
70 | |||
71 | public void Clear() | ||
72 | { | ||
73 | ptr = IntPtr.Zero; | ||
74 | } | ||
75 | public bool HasPhysicalBody { get { return ptr != IntPtr.Zero; } } | ||
76 | |||
67 | public override string ToString() | 77 | public override string ToString() |
68 | { | 78 | { |
69 | StringBuilder buff = new StringBuilder(); | 79 | StringBuilder buff = new StringBuilder(); |
@@ -103,6 +113,13 @@ public struct BulletShape | |||
103 | public BSPhysicsShapeType type; | 113 | public BSPhysicsShapeType type; |
104 | public System.UInt64 shapeKey; | 114 | public System.UInt64 shapeKey; |
105 | public bool isNativeShape; | 115 | public bool isNativeShape; |
116 | |||
117 | public void Clear() | ||
118 | { | ||
119 | ptr = IntPtr.Zero; | ||
120 | } | ||
121 | public bool HasPhysicalShape { get { return ptr != IntPtr.Zero; } } | ||
122 | |||
106 | public override string ToString() | 123 | public override string ToString() |
107 | { | 124 | { |
108 | StringBuilder buff = new StringBuilder(); | 125 | StringBuilder buff = new StringBuilder(); |
@@ -140,6 +157,12 @@ public struct BulletConstraint | |||
140 | ptr = xx; | 157 | ptr = xx; |
141 | } | 158 | } |
142 | public IntPtr ptr; | 159 | public IntPtr ptr; |
160 | |||
161 | public void Clear() | ||
162 | { | ||
163 | ptr = IntPtr.Zero; | ||
164 | } | ||
165 | public bool HasPhysicalConstraint { get { return ptr != IntPtr.Zero; } } | ||
143 | } | 166 | } |
144 | 167 | ||
145 | // An allocated HeightMapThing which holds various heightmap info. | 168 | // An allocated HeightMapThing which holds various heightmap info. |