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/BSShapes.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/BSShapes.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs index c7885c6..cdaa869 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSShapes.cs | |||
@@ -126,7 +126,8 @@ public class BSShapeNative : BSShape | |||
126 | BSPhysicsShapeType shapeType, FixedShapeKey shapeKey) | 126 | BSPhysicsShapeType shapeType, FixedShapeKey shapeKey) |
127 | { | 127 | { |
128 | // Native shapes are not shared and are always built anew. | 128 | // Native shapes are not shared and are always built anew. |
129 | return new BSShapeNative(physicsScene, prim, shapeType, shapeKey); | 129 | //return new BSShapeNative(physicsScene, prim, shapeType, shapeKey); |
130 | return null; | ||
130 | } | 131 | } |
131 | 132 | ||
132 | private BSShapeNative(BSScene physicsScene, BSPhysObject prim, | 133 | private BSShapeNative(BSScene physicsScene, BSPhysObject prim, |
@@ -141,6 +142,7 @@ public class BSShapeNative : BSShape | |||
141 | nativeShapeData.HullKey = (ulong)shapeKey; | 142 | nativeShapeData.HullKey = (ulong)shapeKey; |
142 | 143 | ||
143 | 144 | ||
145 | /* | ||
144 | if (shapeType == BSPhysicsShapeType.SHAPE_CAPSULE) | 146 | if (shapeType == BSPhysicsShapeType.SHAPE_CAPSULE) |
145 | { | 147 | { |
146 | ptr = BulletSimAPI.BuildCapsuleShape2(physicsScene.World.ptr, 1f, 1f, prim.Scale); | 148 | ptr = BulletSimAPI.BuildCapsuleShape2(physicsScene.World.ptr, 1f, 1f, prim.Scale); |
@@ -157,15 +159,18 @@ public class BSShapeNative : BSShape | |||
157 | } | 159 | } |
158 | type = shapeType; | 160 | type = shapeType; |
159 | key = (UInt64)shapeKey; | 161 | key = (UInt64)shapeKey; |
162 | */ | ||
160 | } | 163 | } |
161 | // Make this reference to the physical shape go away since native shapes are not shared. | 164 | // Make this reference to the physical shape go away since native shapes are not shared. |
162 | public override void Dereference(BSScene physicsScene) | 165 | public override void Dereference(BSScene physicsScene) |
163 | { | 166 | { |
167 | /* | ||
164 | // Native shapes are not tracked and are released immediately | 168 | // Native shapes are not tracked and are released immediately |
165 | physicsScene.DetailLog("{0},BSShapeCollection.DereferenceShape,deleteNativeShape,shape={1}", BSScene.DetailLogZero, this); | 169 | physicsScene.DetailLog("{0},BSShapeCollection.DereferenceShape,deleteNativeShape,shape={1}", BSScene.DetailLogZero, this); |
166 | BulletSimAPI.DeleteCollisionShape2(physicsScene.World.ptr, ptr); | 170 | BulletSimAPI.DeleteCollisionShape2(physicsScene.World.ptr, ptr); |
167 | ptr = IntPtr.Zero; | 171 | ptr = IntPtr.Zero; |
168 | // Garbage collection will free up this instance. | 172 | // Garbage collection will free up this instance. |
173 | */ | ||
169 | } | 174 | } |
170 | } | 175 | } |
171 | 176 | ||