diff options
author | Robert Adams | 2012-09-23 18:39:46 -0700 |
---|---|---|
committer | Robert Adams | 2012-09-27 22:01:37 -0700 |
commit | d016051fa028a485b09fac47b3fa3d8fd08e207a (patch) | |
tree | 8f483976bb64b1328439b76754675126b09943b0 /OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |
parent | BulletSim: fix regression that caused cylindar shapes to have a box collision... (diff) | |
download | opensim-SC-d016051fa028a485b09fac47b3fa3d8fd08e207a.zip opensim-SC-d016051fa028a485b09fac47b3fa3d8fd08e207a.tar.gz opensim-SC-d016051fa028a485b09fac47b3fa3d8fd08e207a.tar.bz2 opensim-SC-d016051fa028a485b09fac47b3fa3d8fd08e207a.tar.xz |
BulletSim: renamed members of BulletShape, BulletSim and BulletBody
so the members case is consistant. Caused modifications everywhere.
New logic in BSShapeCollection to track use and sharing of shapes.
I just reslized, though, that shapes cannot be shared because the
shape's UserPointer is the localID of the prim and is required
for tracking collisions. More changes coming.
Added DuplicateCollisionShape2() to API and changed BuildNativeShape2
to take a ShapeData structure so don't have to pass so many parameters.
This matches the latest version of BulletSim.dll.
Additions and removal of DetailLog() statements for debugging.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 70a10b1..6a9fe50 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -1,4 +1,4 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) Contributors, http://opensimulator.org/ | 2 | * Copyright (c) Contributors, http://opensimulator.org/ |
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | 3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. |
4 | * | 4 | * |
@@ -121,8 +121,8 @@ public abstract class BSPhysObject : PhysicsActor | |||
121 | // if someone has subscribed for collision events.... | 121 | // if someone has subscribed for collision events.... |
122 | if (SubscribedEvents()) { | 122 | if (SubscribedEvents()) { |
123 | CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 123 | CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
124 | // DetailLog("{0},{1}.Collison.AddCollider,call,with={2},point={3},normal={4},depth={5}", | 124 | DetailLog("{0},{1}.Collison.AddCollider,call,with={2},point={3},normal={4},depth={5}", |
125 | // LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth); | 125 | LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth); |
126 | ret = true; | 126 | ret = true; |
127 | } | 127 | } |
128 | return ret; | 128 | return ret; |
@@ -147,7 +147,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
147 | if (CollisionCollection.Count == 0) | 147 | if (CollisionCollection.Count == 0) |
148 | PhysicsScene.ObjectsWithNoMoreCollisions.Add(this); | 148 | PhysicsScene.ObjectsWithNoMoreCollisions.Add(this); |
149 | 149 | ||
150 | // DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); | 150 | DetailLog("{0},{1}.SendCollisionUpdate,call,numCollisions={2}", LocalID, TypeName, CollisionCollection.Count); |
151 | base.SendCollisionUpdate(CollisionCollection); | 151 | base.SendCollisionUpdate(CollisionCollection); |
152 | 152 | ||
153 | // The collisionCollection structure is passed around in the simulator. | 153 | // The collisionCollection structure is passed around in the simulator. |
@@ -158,7 +158,8 @@ public abstract class BSPhysObject : PhysicsActor | |||
158 | 158 | ||
159 | // Subscribe for collision events. | 159 | // Subscribe for collision events. |
160 | // Parameter is the millisecond rate the caller wishes collision events to occur. | 160 | // Parameter is the millisecond rate the caller wishes collision events to occur. |
161 | public override void SubscribeEvents(int ms) { | 161 | public override void SubscribeEvents(int ms) { |
162 | DetailLog("{0},BSScene.SubscribeEvents,subscribing,ms={1}", BSScene.DetailLogZero, ms); | ||
162 | SubscribedEventsMs = ms; | 163 | SubscribedEventsMs = ms; |
163 | if (ms > 0) | 164 | if (ms > 0) |
164 | { | 165 | { |
@@ -167,7 +168,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
167 | 168 | ||
168 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() | 169 | PhysicsScene.TaintedObject(TypeName+".SubscribeEvents", delegate() |
169 | { | 170 | { |
170 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(BSBody.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 171 | CurrentCollisionFlags = BulletSimAPI.AddToCollisionFlags2(BSBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
171 | }); | 172 | }); |
172 | } | 173 | } |
173 | else | 174 | else |
@@ -177,10 +178,11 @@ public abstract class BSPhysObject : PhysicsActor | |||
177 | } | 178 | } |
178 | } | 179 | } |
179 | public override void UnSubscribeEvents() { | 180 | public override void UnSubscribeEvents() { |
181 | DetailLog("{0},BSScene.UnSubscribeEvents,unsubscribing", BSScene.DetailLogZero); | ||
180 | SubscribedEventsMs = 0; | 182 | SubscribedEventsMs = 0; |
181 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() | 183 | PhysicsScene.TaintedObject(TypeName+".UnSubscribeEvents", delegate() |
182 | { | 184 | { |
183 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(BSBody.Ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 185 | CurrentCollisionFlags = BulletSimAPI.RemoveFromCollisionFlags2(BSBody.ptr, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
184 | }); | 186 | }); |
185 | } | 187 | } |
186 | // Return 'true' if the simulator wants collision events | 188 | // Return 'true' if the simulator wants collision events |