diff options
Diffstat (limited to '')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 4bed535..73b5764 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -182,9 +182,40 @@ public abstract class BSPhysObject : PhysicsActor | |||
182 | protected long CollidingStep { get; set; } | 182 | protected long CollidingStep { get; set; } |
183 | // The simulation step that last had a collision with the ground | 183 | // The simulation step that last had a collision with the ground |
184 | protected long CollidingGroundStep { get; set; } | 184 | protected long CollidingGroundStep { get; set; } |
185 | // The simulation step that last collided with an object | ||
186 | protected long CollidingObjectStep { get; set; } | ||
185 | // The collision flags we think are set in Bullet | 187 | // The collision flags we think are set in Bullet |
186 | protected CollisionFlags CurrentCollisionFlags { get; set; } | 188 | protected CollisionFlags CurrentCollisionFlags { get; set; } |
187 | 189 | ||
190 | public override bool IsColliding { | ||
191 | get { return (CollidingStep == PhysicsScene.SimulationStep); } | ||
192 | set { | ||
193 | if (value) | ||
194 | CollidingStep = PhysicsScene.SimulationStep; | ||
195 | else | ||
196 | CollidingStep = 0; | ||
197 | } | ||
198 | } | ||
199 | public override bool CollidingGround { | ||
200 | get { return (CollidingGroundStep == PhysicsScene.SimulationStep); } | ||
201 | set | ||
202 | { | ||
203 | if (value) | ||
204 | CollidingGroundStep = PhysicsScene.SimulationStep; | ||
205 | else | ||
206 | CollidingGroundStep = 0; | ||
207 | } | ||
208 | } | ||
209 | public override bool CollidingObj { | ||
210 | get { return (CollidingObjectStep == PhysicsScene.SimulationStep); } | ||
211 | set { | ||
212 | if (value) | ||
213 | CollidingObjectStep = PhysicsScene.SimulationStep; | ||
214 | else | ||
215 | CollidingObjectStep = 0; | ||
216 | } | ||
217 | } | ||
218 | |||
188 | // The collisions that have been collected this tick | 219 | // The collisions that have been collected this tick |
189 | protected CollisionEventUpdate CollisionCollection; | 220 | protected CollisionEventUpdate CollisionCollection; |
190 | 221 | ||
@@ -196,12 +227,16 @@ public abstract class BSPhysObject : PhysicsActor | |||
196 | { | 227 | { |
197 | bool ret = false; | 228 | bool ret = false; |
198 | 229 | ||
199 | // The following lines make IsColliding() and IsCollidingGround() work | 230 | // The following lines make IsColliding(), CollidingGround() and CollidingObj work |
200 | CollidingStep = PhysicsScene.SimulationStep; | 231 | CollidingStep = PhysicsScene.SimulationStep; |
201 | if (collidingWith <= PhysicsScene.TerrainManager.HighestTerrainID) | 232 | if (collidingWith <= PhysicsScene.TerrainManager.HighestTerrainID) |
202 | { | 233 | { |
203 | CollidingGroundStep = PhysicsScene.SimulationStep; | 234 | CollidingGroundStep = PhysicsScene.SimulationStep; |
204 | } | 235 | } |
236 | else | ||
237 | { | ||
238 | CollidingObjectStep = PhysicsScene.SimulationStep; | ||
239 | } | ||
205 | 240 | ||
206 | // prims in the same linkset cannot collide with each other | 241 | // prims in the same linkset cannot collide with each other |
207 | if (collidee != null && (this.Linkset.LinksetID == collidee.Linkset.LinksetID)) | 242 | if (collidee != null && (this.Linkset.LinksetID == collidee.Linkset.LinksetID)) |