diff options
author | Robert Adams | 2013-04-28 14:44:21 -0700 |
---|---|---|
committer | Robert Adams | 2013-04-29 07:38:40 -0700 |
commit | e5582939fd8d78b61c6f1eeda6de45d94f4b4926 (patch) | |
tree | 1f990ab6f73f4e787566031af35c7c59c89968aa /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: complete BSShape classes. (diff) | |
download | opensim-SC_OLD-e5582939fd8d78b61c6f1eeda6de45d94f4b4926.zip opensim-SC_OLD-e5582939fd8d78b61c6f1eeda6de45d94f4b4926.tar.gz opensim-SC_OLD-e5582939fd8d78b61c6f1eeda6de45d94f4b4926.tar.bz2 opensim-SC_OLD-e5582939fd8d78b61c6f1eeda6de45d94f4b4926.tar.xz |
BulletSim: massive refactor of shape classes. Removed shape specific code from BSShapeCollection. Using BSShape* classes to hold references to shape. Simplified shape dependency callbacks. Remove 'PreferredShape' methods and have each class specify shape type. Disable compound shape linkset for a later commit that will simplify linkset implementation.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index a0d58d3..da23a262 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -123,8 +123,8 @@ public sealed class BSCharacter : BSPhysObject | |||
123 | { | 123 | { |
124 | PhysicsScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); | 124 | PhysicsScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); |
125 | PhysBody.Clear(); | 125 | PhysBody.Clear(); |
126 | PhysicsScene.Shapes.DereferenceShape(PhysShape, null /* bodyCallback */); | 126 | PhysShape.Dereference(PhysicsScene); |
127 | PhysShape.Clear(); | 127 | PhysShape = new BSShapeNull(); |
128 | }); | 128 | }); |
129 | } | 129 | } |
130 | 130 | ||
@@ -146,8 +146,8 @@ public sealed class BSCharacter : BSPhysObject | |||
146 | Flying = _flying; | 146 | Flying = _flying; |
147 | 147 | ||
148 | PhysicsScene.PE.SetRestitution(PhysBody, BSParam.AvatarRestitution); | 148 | PhysicsScene.PE.SetRestitution(PhysBody, BSParam.AvatarRestitution); |
149 | PhysicsScene.PE.SetMargin(PhysShape, PhysicsScene.Params.collisionMargin); | 149 | PhysicsScene.PE.SetMargin(PhysShape.physShapeInfo, PhysicsScene.Params.collisionMargin); |
150 | PhysicsScene.PE.SetLocalScaling(PhysShape, Scale); | 150 | PhysicsScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); |
151 | PhysicsScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); | 151 | PhysicsScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); |
152 | if (BSParam.CcdMotionThreshold > 0f) | 152 | if (BSParam.CcdMotionThreshold > 0f) |
153 | { | 153 | { |
@@ -205,9 +205,9 @@ public sealed class BSCharacter : BSPhysObject | |||
205 | 205 | ||
206 | PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() | 206 | PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() |
207 | { | 207 | { |
208 | if (PhysBody.HasPhysicalBody && PhysShape.HasPhysicalShape) | 208 | if (PhysBody.HasPhysicalBody && PhysShape.physShapeInfo.HasPhysicalShape) |
209 | { | 209 | { |
210 | PhysicsScene.PE.SetLocalScaling(PhysShape, Scale); | 210 | PhysicsScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); |
211 | UpdatePhysicalMassProperties(RawMass, true); | 211 | UpdatePhysicalMassProperties(RawMass, true); |
212 | // Make sure this change appears as a property update event | 212 | // Make sure this change appears as a property update event |
213 | PhysicsScene.PE.PushUpdate(PhysBody); | 213 | PhysicsScene.PE.PushUpdate(PhysBody); |
@@ -221,11 +221,6 @@ public sealed class BSCharacter : BSPhysObject | |||
221 | { | 221 | { |
222 | set { BaseShape = value; } | 222 | set { BaseShape = value; } |
223 | } | 223 | } |
224 | // I want the physics engine to make an avatar capsule | ||
225 | public override BSPhysicsShapeType PreferredPhysicalShape | ||
226 | { | ||
227 | get {return BSPhysicsShapeType.SHAPE_CAPSULE; } | ||
228 | } | ||
229 | 224 | ||
230 | public override bool Grabbed { | 225 | public override bool Grabbed { |
231 | set { _grabbed = value; } | 226 | set { _grabbed = value; } |
@@ -381,7 +376,7 @@ public sealed class BSCharacter : BSPhysObject | |||
381 | } | 376 | } |
382 | public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) | 377 | public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) |
383 | { | 378 | { |
384 | OMV.Vector3 localInertia = PhysicsScene.PE.CalculateLocalInertia(PhysShape, physMass); | 379 | OMV.Vector3 localInertia = PhysicsScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); |
385 | PhysicsScene.PE.SetMassProps(PhysBody, physMass, localInertia); | 380 | PhysicsScene.PE.SetMassProps(PhysBody, physMass, localInertia); |
386 | } | 381 | } |
387 | 382 | ||