diff options
author | Robert Adams | 2013-04-28 21:50:47 -0700 |
---|---|---|
committer | Robert Adams | 2013-04-29 07:38:55 -0700 |
commit | ad1787770ed02f71feaa002ab689467e187803bb (patch) | |
tree | 08026c7b0b160ae9b16c2876894852f8a729bbb4 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: first cut at new linksetCompound shape building. (diff) | |
download | opensim-SC_OLD-ad1787770ed02f71feaa002ab689467e187803bb.zip opensim-SC_OLD-ad1787770ed02f71feaa002ab689467e187803bb.tar.gz opensim-SC_OLD-ad1787770ed02f71feaa002ab689467e187803bb.tar.bz2 opensim-SC_OLD-ad1787770ed02f71feaa002ab689467e187803bb.tar.xz |
BulletSim: rename variable 'PhysicsScene' to be either 'PhysScene' or 'm_physicsScene' to match coding conventions and reduce confusion.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index da23a262..e12fc8e 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -95,18 +95,18 @@ public sealed class BSCharacter : BSPhysObject | |||
95 | // the avatar seeking to reach the motor's target speed. | 95 | // the avatar seeking to reach the motor's target speed. |
96 | // This motor runs as a prestep action for the avatar so it will keep the avatar | 96 | // This motor runs as a prestep action for the avatar so it will keep the avatar |
97 | // standing as well as moving. Destruction of the avatar will destroy the pre-step action. | 97 | // standing as well as moving. Destruction of the avatar will destroy the pre-step action. |
98 | m_moveActor = new BSActorAvatarMove(PhysicsScene, this, AvatarMoveActorName); | 98 | m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName); |
99 | PhysicalActors.Add(AvatarMoveActorName, m_moveActor); | 99 | PhysicalActors.Add(AvatarMoveActorName, m_moveActor); |
100 | 100 | ||
101 | DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}", | 101 | DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}", |
102 | LocalID, _size, Scale, Density, _avatarVolume, RawMass); | 102 | LocalID, _size, Scale, Density, _avatarVolume, RawMass); |
103 | 103 | ||
104 | // do actual creation in taint time | 104 | // do actual creation in taint time |
105 | PhysicsScene.TaintedObject("BSCharacter.create", delegate() | 105 | PhysScene.TaintedObject("BSCharacter.create", delegate() |
106 | { | 106 | { |
107 | DetailLog("{0},BSCharacter.create,taint", LocalID); | 107 | DetailLog("{0},BSCharacter.create,taint", LocalID); |
108 | // New body and shape into PhysBody and PhysShape | 108 | // New body and shape into PhysBody and PhysShape |
109 | PhysicsScene.Shapes.GetBodyAndShape(true, PhysicsScene.World, this); | 109 | PhysScene.Shapes.GetBodyAndShape(true, PhysScene.World, this); |
110 | 110 | ||
111 | SetPhysicalProperties(); | 111 | SetPhysicalProperties(); |
112 | }); | 112 | }); |
@@ -119,18 +119,18 @@ public sealed class BSCharacter : BSPhysObject | |||
119 | base.Destroy(); | 119 | base.Destroy(); |
120 | 120 | ||
121 | DetailLog("{0},BSCharacter.Destroy", LocalID); | 121 | DetailLog("{0},BSCharacter.Destroy", LocalID); |
122 | PhysicsScene.TaintedObject("BSCharacter.destroy", delegate() | 122 | PhysScene.TaintedObject("BSCharacter.destroy", delegate() |
123 | { | 123 | { |
124 | PhysicsScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); | 124 | PhysScene.Shapes.DereferenceBody(PhysBody, null /* bodyCallback */); |
125 | PhysBody.Clear(); | 125 | PhysBody.Clear(); |
126 | PhysShape.Dereference(PhysicsScene); | 126 | PhysShape.Dereference(PhysScene); |
127 | PhysShape = new BSShapeNull(); | 127 | PhysShape = new BSShapeNull(); |
128 | }); | 128 | }); |
129 | } | 129 | } |
130 | 130 | ||
131 | private void SetPhysicalProperties() | 131 | private void SetPhysicalProperties() |
132 | { | 132 | { |
133 | PhysicsScene.PE.RemoveObjectFromWorld(PhysicsScene.World, PhysBody); | 133 | PhysScene.PE.RemoveObjectFromWorld(PhysScene.World, PhysBody); |
134 | 134 | ||
135 | ZeroMotion(true); | 135 | ZeroMotion(true); |
136 | ForcePosition = _position; | 136 | ForcePosition = _position; |
@@ -145,35 +145,35 @@ public sealed class BSCharacter : BSPhysObject | |||
145 | // Needs to be reset especially when an avatar is recreated after crossing a region boundry. | 145 | // Needs to be reset especially when an avatar is recreated after crossing a region boundry. |
146 | Flying = _flying; | 146 | Flying = _flying; |
147 | 147 | ||
148 | PhysicsScene.PE.SetRestitution(PhysBody, BSParam.AvatarRestitution); | 148 | PhysScene.PE.SetRestitution(PhysBody, BSParam.AvatarRestitution); |
149 | PhysicsScene.PE.SetMargin(PhysShape.physShapeInfo, PhysicsScene.Params.collisionMargin); | 149 | PhysScene.PE.SetMargin(PhysShape.physShapeInfo, PhysScene.Params.collisionMargin); |
150 | PhysicsScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); | 150 | PhysScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); |
151 | PhysicsScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); | 151 | PhysScene.PE.SetContactProcessingThreshold(PhysBody, BSParam.ContactProcessingThreshold); |
152 | if (BSParam.CcdMotionThreshold > 0f) | 152 | if (BSParam.CcdMotionThreshold > 0f) |
153 | { | 153 | { |
154 | PhysicsScene.PE.SetCcdMotionThreshold(PhysBody, BSParam.CcdMotionThreshold); | 154 | PhysScene.PE.SetCcdMotionThreshold(PhysBody, BSParam.CcdMotionThreshold); |
155 | PhysicsScene.PE.SetCcdSweptSphereRadius(PhysBody, BSParam.CcdSweptSphereRadius); | 155 | PhysScene.PE.SetCcdSweptSphereRadius(PhysBody, BSParam.CcdSweptSphereRadius); |
156 | } | 156 | } |
157 | 157 | ||
158 | UpdatePhysicalMassProperties(RawMass, false); | 158 | UpdatePhysicalMassProperties(RawMass, false); |
159 | 159 | ||
160 | // Make so capsule does not fall over | 160 | // Make so capsule does not fall over |
161 | PhysicsScene.PE.SetAngularFactorV(PhysBody, OMV.Vector3.Zero); | 161 | PhysScene.PE.SetAngularFactorV(PhysBody, OMV.Vector3.Zero); |
162 | 162 | ||
163 | // The avatar mover sets some parameters. | 163 | // The avatar mover sets some parameters. |
164 | PhysicalActors.Refresh(); | 164 | PhysicalActors.Refresh(); |
165 | 165 | ||
166 | PhysicsScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.CF_CHARACTER_OBJECT); | 166 | PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.CF_CHARACTER_OBJECT); |
167 | 167 | ||
168 | PhysicsScene.PE.AddObjectToWorld(PhysicsScene.World, PhysBody); | 168 | PhysScene.PE.AddObjectToWorld(PhysScene.World, PhysBody); |
169 | 169 | ||
170 | // PhysicsScene.PE.ForceActivationState(PhysBody, ActivationState.ACTIVE_TAG); | 170 | // PhysicsScene.PE.ForceActivationState(PhysBody, ActivationState.ACTIVE_TAG); |
171 | PhysicsScene.PE.ForceActivationState(PhysBody, ActivationState.DISABLE_DEACTIVATION); | 171 | PhysScene.PE.ForceActivationState(PhysBody, ActivationState.DISABLE_DEACTIVATION); |
172 | PhysicsScene.PE.UpdateSingleAabb(PhysicsScene.World, PhysBody); | 172 | PhysScene.PE.UpdateSingleAabb(PhysScene.World, PhysBody); |
173 | 173 | ||
174 | // Do this after the object has been added to the world | 174 | // Do this after the object has been added to the world |
175 | PhysBody.collisionType = CollisionType.Avatar; | 175 | PhysBody.collisionType = CollisionType.Avatar; |
176 | PhysBody.ApplyCollisionMask(PhysicsScene); | 176 | PhysBody.ApplyCollisionMask(PhysScene); |
177 | } | 177 | } |
178 | 178 | ||
179 | 179 | ||
@@ -203,14 +203,14 @@ public sealed class BSCharacter : BSPhysObject | |||
203 | DetailLog("{0},BSCharacter.setSize,call,size={1},scale={2},density={3},volume={4},mass={5}", | 203 | DetailLog("{0},BSCharacter.setSize,call,size={1},scale={2},density={3},volume={4},mass={5}", |
204 | LocalID, _size, Scale, Density, _avatarVolume, RawMass); | 204 | LocalID, _size, Scale, Density, _avatarVolume, RawMass); |
205 | 205 | ||
206 | PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() | 206 | PhysScene.TaintedObject("BSCharacter.setSize", delegate() |
207 | { | 207 | { |
208 | if (PhysBody.HasPhysicalBody && PhysShape.physShapeInfo.HasPhysicalShape) | 208 | if (PhysBody.HasPhysicalBody && PhysShape.physShapeInfo.HasPhysicalShape) |
209 | { | 209 | { |
210 | PhysicsScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); | 210 | PhysScene.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 | PhysScene.PE.PushUpdate(PhysBody); |
214 | } | 214 | } |
215 | }); | 215 | }); |
216 | 216 | ||
@@ -247,24 +247,24 @@ public sealed class BSCharacter : BSPhysObject | |||
247 | _rotationalVelocity = OMV.Vector3.Zero; | 247 | _rotationalVelocity = OMV.Vector3.Zero; |
248 | 248 | ||
249 | // Zero some other properties directly into the physics engine | 249 | // Zero some other properties directly into the physics engine |
250 | PhysicsScene.TaintedObject(inTaintTime, "BSCharacter.ZeroMotion", delegate() | 250 | PhysScene.TaintedObject(inTaintTime, "BSCharacter.ZeroMotion", delegate() |
251 | { | 251 | { |
252 | if (PhysBody.HasPhysicalBody) | 252 | if (PhysBody.HasPhysicalBody) |
253 | PhysicsScene.PE.ClearAllForces(PhysBody); | 253 | PhysScene.PE.ClearAllForces(PhysBody); |
254 | }); | 254 | }); |
255 | } | 255 | } |
256 | public override void ZeroAngularMotion(bool inTaintTime) | 256 | public override void ZeroAngularMotion(bool inTaintTime) |
257 | { | 257 | { |
258 | _rotationalVelocity = OMV.Vector3.Zero; | 258 | _rotationalVelocity = OMV.Vector3.Zero; |
259 | 259 | ||
260 | PhysicsScene.TaintedObject(inTaintTime, "BSCharacter.ZeroMotion", delegate() | 260 | PhysScene.TaintedObject(inTaintTime, "BSCharacter.ZeroMotion", delegate() |
261 | { | 261 | { |
262 | if (PhysBody.HasPhysicalBody) | 262 | if (PhysBody.HasPhysicalBody) |
263 | { | 263 | { |
264 | PhysicsScene.PE.SetInterpolationAngularVelocity(PhysBody, OMV.Vector3.Zero); | 264 | PhysScene.PE.SetInterpolationAngularVelocity(PhysBody, OMV.Vector3.Zero); |
265 | PhysicsScene.PE.SetAngularVelocity(PhysBody, OMV.Vector3.Zero); | 265 | PhysScene.PE.SetAngularVelocity(PhysBody, OMV.Vector3.Zero); |
266 | // The next also get rid of applied linear force but the linear velocity is untouched. | 266 | // The next also get rid of applied linear force but the linear velocity is untouched. |
267 | PhysicsScene.PE.ClearForces(PhysBody); | 267 | PhysScene.PE.ClearForces(PhysBody); |
268 | } | 268 | } |
269 | }); | 269 | }); |
270 | } | 270 | } |
@@ -286,7 +286,7 @@ public sealed class BSCharacter : BSPhysObject | |||
286 | set { | 286 | set { |
287 | _position = value; | 287 | _position = value; |
288 | 288 | ||
289 | PhysicsScene.TaintedObject("BSCharacter.setPosition", delegate() | 289 | PhysScene.TaintedObject("BSCharacter.setPosition", delegate() |
290 | { | 290 | { |
291 | DetailLog("{0},BSCharacter.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); | 291 | DetailLog("{0},BSCharacter.SetPosition,taint,pos={1},orient={2}", LocalID, _position, _orientation); |
292 | PositionSanityCheck(); | 292 | PositionSanityCheck(); |
@@ -296,14 +296,14 @@ public sealed class BSCharacter : BSPhysObject | |||
296 | } | 296 | } |
297 | public override OMV.Vector3 ForcePosition { | 297 | public override OMV.Vector3 ForcePosition { |
298 | get { | 298 | get { |
299 | _position = PhysicsScene.PE.GetPosition(PhysBody); | 299 | _position = PhysScene.PE.GetPosition(PhysBody); |
300 | return _position; | 300 | return _position; |
301 | } | 301 | } |
302 | set { | 302 | set { |
303 | _position = value; | 303 | _position = value; |
304 | if (PhysBody.HasPhysicalBody) | 304 | if (PhysBody.HasPhysicalBody) |
305 | { | 305 | { |
306 | PhysicsScene.PE.SetTranslation(PhysBody, _position, _orientation); | 306 | PhysScene.PE.SetTranslation(PhysBody, _position, _orientation); |
307 | } | 307 | } |
308 | } | 308 | } |
309 | } | 309 | } |
@@ -317,18 +317,18 @@ public sealed class BSCharacter : BSPhysObject | |||
317 | bool ret = false; | 317 | bool ret = false; |
318 | 318 | ||
319 | // TODO: check for out of bounds | 319 | // TODO: check for out of bounds |
320 | if (!PhysicsScene.TerrainManager.IsWithinKnownTerrain(RawPosition)) | 320 | if (!PhysScene.TerrainManager.IsWithinKnownTerrain(RawPosition)) |
321 | { | 321 | { |
322 | // The character is out of the known/simulated area. | 322 | // The character is out of the known/simulated area. |
323 | // Force the avatar position to be within known. ScenePresence will use the position | 323 | // Force the avatar position to be within known. ScenePresence will use the position |
324 | // plus the velocity to decide if the avatar is moving out of the region. | 324 | // plus the velocity to decide if the avatar is moving out of the region. |
325 | RawPosition = PhysicsScene.TerrainManager.ClampPositionIntoKnownTerrain(RawPosition); | 325 | RawPosition = PhysScene.TerrainManager.ClampPositionIntoKnownTerrain(RawPosition); |
326 | DetailLog("{0},BSCharacter.PositionSanityCheck,notWithinKnownTerrain,clampedPos={1}", LocalID, RawPosition); | 326 | DetailLog("{0},BSCharacter.PositionSanityCheck,notWithinKnownTerrain,clampedPos={1}", LocalID, RawPosition); |
327 | return true; | 327 | return true; |
328 | } | 328 | } |
329 | 329 | ||
330 | // If below the ground, move the avatar up | 330 | // If below the ground, move the avatar up |
331 | float terrainHeight = PhysicsScene.TerrainManager.GetTerrainHeightAtXYZ(RawPosition); | 331 | float terrainHeight = PhysScene.TerrainManager.GetTerrainHeightAtXYZ(RawPosition); |
332 | if (Position.Z < terrainHeight) | 332 | if (Position.Z < terrainHeight) |
333 | { | 333 | { |
334 | DetailLog("{0},BSCharacter.PositionSanityCheck,adjustForUnderGround,pos={1},terrain={2}", LocalID, _position, terrainHeight); | 334 | DetailLog("{0},BSCharacter.PositionSanityCheck,adjustForUnderGround,pos={1},terrain={2}", LocalID, _position, terrainHeight); |
@@ -337,7 +337,7 @@ public sealed class BSCharacter : BSPhysObject | |||
337 | } | 337 | } |
338 | if ((CurrentCollisionFlags & CollisionFlags.BS_FLOATS_ON_WATER) != 0) | 338 | if ((CurrentCollisionFlags & CollisionFlags.BS_FLOATS_ON_WATER) != 0) |
339 | { | 339 | { |
340 | float waterHeight = PhysicsScene.TerrainManager.GetWaterLevelAtXYZ(_position); | 340 | float waterHeight = PhysScene.TerrainManager.GetWaterLevelAtXYZ(_position); |
341 | if (Position.Z < waterHeight) | 341 | if (Position.Z < waterHeight) |
342 | { | 342 | { |
343 | _position.Z = waterHeight; | 343 | _position.Z = waterHeight; |
@@ -358,7 +358,7 @@ public sealed class BSCharacter : BSPhysObject | |||
358 | { | 358 | { |
359 | // The new position value must be pushed into the physics engine but we can't | 359 | // The new position value must be pushed into the physics engine but we can't |
360 | // just assign to "Position" because of potential call loops. | 360 | // just assign to "Position" because of potential call loops. |
361 | PhysicsScene.TaintedObject(inTaintTime, "BSCharacter.PositionSanityCheck", delegate() | 361 | PhysScene.TaintedObject(inTaintTime, "BSCharacter.PositionSanityCheck", delegate() |
362 | { | 362 | { |
363 | DetailLog("{0},BSCharacter.PositionSanityCheck,taint,pos={1},orient={2}", LocalID, _position, _orientation); | 363 | DetailLog("{0},BSCharacter.PositionSanityCheck,taint,pos={1},orient={2}", LocalID, _position, _orientation); |
364 | ForcePosition = _position; | 364 | ForcePosition = _position; |
@@ -376,8 +376,8 @@ public sealed class BSCharacter : BSPhysObject | |||
376 | } | 376 | } |
377 | public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) | 377 | public override void UpdatePhysicalMassProperties(float physMass, bool inWorld) |
378 | { | 378 | { |
379 | OMV.Vector3 localInertia = PhysicsScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); | 379 | OMV.Vector3 localInertia = PhysScene.PE.CalculateLocalInertia(PhysShape.physShapeInfo, physMass); |
380 | PhysicsScene.PE.SetMassProps(PhysBody, physMass, localInertia); | 380 | PhysScene.PE.SetMassProps(PhysBody, physMass, localInertia); |
381 | } | 381 | } |
382 | 382 | ||
383 | public override OMV.Vector3 Force { | 383 | public override OMV.Vector3 Force { |
@@ -385,11 +385,11 @@ public sealed class BSCharacter : BSPhysObject | |||
385 | set { | 385 | set { |
386 | RawForce = value; | 386 | RawForce = value; |
387 | // m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force); | 387 | // m_log.DebugFormat("{0}: Force = {1}", LogHeader, _force); |
388 | PhysicsScene.TaintedObject("BSCharacter.SetForce", delegate() | 388 | PhysScene.TaintedObject("BSCharacter.SetForce", delegate() |
389 | { | 389 | { |
390 | DetailLog("{0},BSCharacter.setForce,taint,force={1}", LocalID, RawForce); | 390 | DetailLog("{0},BSCharacter.setForce,taint,force={1}", LocalID, RawForce); |
391 | if (PhysBody.HasPhysicalBody) | 391 | if (PhysBody.HasPhysicalBody) |
392 | PhysicsScene.PE.SetObjectForce(PhysBody, RawForce); | 392 | PhysScene.PE.SetObjectForce(PhysBody, RawForce); |
393 | }); | 393 | }); |
394 | } | 394 | } |
395 | } | 395 | } |
@@ -432,7 +432,7 @@ public sealed class BSCharacter : BSPhysObject | |||
432 | set { | 432 | set { |
433 | RawVelocity = value; | 433 | RawVelocity = value; |
434 | // m_log.DebugFormat("{0}: set velocity = {1}", LogHeader, RawVelocity); | 434 | // m_log.DebugFormat("{0}: set velocity = {1}", LogHeader, RawVelocity); |
435 | PhysicsScene.TaintedObject("BSCharacter.setVelocity", delegate() | 435 | PhysScene.TaintedObject("BSCharacter.setVelocity", delegate() |
436 | { | 436 | { |
437 | if (m_moveActor != null) | 437 | if (m_moveActor != null) |
438 | m_moveActor.SetVelocityAndTarget(RawVelocity, RawVelocity, true /* inTaintTime */); | 438 | m_moveActor.SetVelocityAndTarget(RawVelocity, RawVelocity, true /* inTaintTime */); |
@@ -445,11 +445,11 @@ public sealed class BSCharacter : BSPhysObject | |||
445 | public override OMV.Vector3 ForceVelocity { | 445 | public override OMV.Vector3 ForceVelocity { |
446 | get { return RawVelocity; } | 446 | get { return RawVelocity; } |
447 | set { | 447 | set { |
448 | PhysicsScene.AssertInTaintTime("BSCharacter.ForceVelocity"); | 448 | PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity"); |
449 | 449 | ||
450 | RawVelocity = value; | 450 | RawVelocity = value; |
451 | PhysicsScene.PE.SetLinearVelocity(PhysBody, RawVelocity); | 451 | PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity); |
452 | PhysicsScene.PE.Activate(PhysBody, true); | 452 | PhysScene.PE.Activate(PhysBody, true); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | public override OMV.Vector3 Torque { | 455 | public override OMV.Vector3 Torque { |
@@ -479,7 +479,7 @@ public sealed class BSCharacter : BSPhysObject | |||
479 | if (_orientation != value) | 479 | if (_orientation != value) |
480 | { | 480 | { |
481 | _orientation = value; | 481 | _orientation = value; |
482 | PhysicsScene.TaintedObject("BSCharacter.setOrientation", delegate() | 482 | PhysScene.TaintedObject("BSCharacter.setOrientation", delegate() |
483 | { | 483 | { |
484 | ForceOrientation = _orientation; | 484 | ForceOrientation = _orientation; |
485 | }); | 485 | }); |
@@ -491,7 +491,7 @@ public sealed class BSCharacter : BSPhysObject | |||
491 | { | 491 | { |
492 | get | 492 | get |
493 | { | 493 | { |
494 | _orientation = PhysicsScene.PE.GetOrientation(PhysBody); | 494 | _orientation = PhysScene.PE.GetOrientation(PhysBody); |
495 | return _orientation; | 495 | return _orientation; |
496 | } | 496 | } |
497 | set | 497 | set |
@@ -500,7 +500,7 @@ public sealed class BSCharacter : BSPhysObject | |||
500 | if (PhysBody.HasPhysicalBody) | 500 | if (PhysBody.HasPhysicalBody) |
501 | { | 501 | { |
502 | // _position = PhysicsScene.PE.GetPosition(BSBody); | 502 | // _position = PhysicsScene.PE.GetPosition(BSBody); |
503 | PhysicsScene.PE.SetTranslation(PhysBody, _position, _orientation); | 503 | PhysScene.PE.SetTranslation(PhysBody, _position, _orientation); |
504 | } | 504 | } |
505 | } | 505 | } |
506 | } | 506 | } |
@@ -549,14 +549,14 @@ public sealed class BSCharacter : BSPhysObject | |||
549 | public override bool FloatOnWater { | 549 | public override bool FloatOnWater { |
550 | set { | 550 | set { |
551 | _floatOnWater = value; | 551 | _floatOnWater = value; |
552 | PhysicsScene.TaintedObject("BSCharacter.setFloatOnWater", delegate() | 552 | PhysScene.TaintedObject("BSCharacter.setFloatOnWater", delegate() |
553 | { | 553 | { |
554 | if (PhysBody.HasPhysicalBody) | 554 | if (PhysBody.HasPhysicalBody) |
555 | { | 555 | { |
556 | if (_floatOnWater) | 556 | if (_floatOnWater) |
557 | CurrentCollisionFlags = PhysicsScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); | 557 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); |
558 | else | 558 | else |
559 | CurrentCollisionFlags = PhysicsScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); | 559 | CurrentCollisionFlags = PhysScene.PE.RemoveFromCollisionFlags(PhysBody, CollisionFlags.BS_FLOATS_ON_WATER); |
560 | } | 560 | } |
561 | }); | 561 | }); |
562 | } | 562 | } |
@@ -577,7 +577,7 @@ public sealed class BSCharacter : BSPhysObject | |||
577 | public override float Buoyancy { | 577 | public override float Buoyancy { |
578 | get { return _buoyancy; } | 578 | get { return _buoyancy; } |
579 | set { _buoyancy = value; | 579 | set { _buoyancy = value; |
580 | PhysicsScene.TaintedObject("BSCharacter.setBuoyancy", delegate() | 580 | PhysScene.TaintedObject("BSCharacter.setBuoyancy", delegate() |
581 | { | 581 | { |
582 | DetailLog("{0},BSCharacter.setBuoyancy,taint,buoy={1}", LocalID, _buoyancy); | 582 | DetailLog("{0},BSCharacter.setBuoyancy,taint,buoy={1}", LocalID, _buoyancy); |
583 | ForceBuoyancy = _buoyancy; | 583 | ForceBuoyancy = _buoyancy; |
@@ -587,7 +587,7 @@ public sealed class BSCharacter : BSPhysObject | |||
587 | public override float ForceBuoyancy { | 587 | public override float ForceBuoyancy { |
588 | get { return _buoyancy; } | 588 | get { return _buoyancy; } |
589 | set { | 589 | set { |
590 | PhysicsScene.AssertInTaintTime("BSCharacter.ForceBuoyancy"); | 590 | PhysScene.AssertInTaintTime("BSCharacter.ForceBuoyancy"); |
591 | 591 | ||
592 | _buoyancy = value; | 592 | _buoyancy = value; |
593 | DetailLog("{0},BSCharacter.setForceBuoyancy,taint,buoy={1}", LocalID, _buoyancy); | 593 | DetailLog("{0},BSCharacter.setForceBuoyancy,taint,buoy={1}", LocalID, _buoyancy); |
@@ -595,7 +595,7 @@ public sealed class BSCharacter : BSPhysObject | |||
595 | float grav = BSParam.Gravity * (1f - _buoyancy); | 595 | float grav = BSParam.Gravity * (1f - _buoyancy); |
596 | Gravity = new OMV.Vector3(0f, 0f, grav); | 596 | Gravity = new OMV.Vector3(0f, 0f, grav); |
597 | if (PhysBody.HasPhysicalBody) | 597 | if (PhysBody.HasPhysicalBody) |
598 | PhysicsScene.PE.SetGravity(PhysBody, Gravity); | 598 | PhysScene.PE.SetGravity(PhysBody, Gravity); |
599 | } | 599 | } |
600 | } | 600 | } |
601 | 601 | ||
@@ -613,7 +613,7 @@ public sealed class BSCharacter : BSPhysObject | |||
613 | public override void AddForce(OMV.Vector3 force, bool pushforce) | 613 | public override void AddForce(OMV.Vector3 force, bool pushforce) |
614 | { | 614 | { |
615 | // Since this force is being applied in only one step, make this a force per second. | 615 | // Since this force is being applied in only one step, make this a force per second. |
616 | OMV.Vector3 addForce = force / PhysicsScene.LastTimeStep; | 616 | OMV.Vector3 addForce = force / PhysScene.LastTimeStep; |
617 | AddForce(addForce, pushforce, false); | 617 | AddForce(addForce, pushforce, false); |
618 | } | 618 | } |
619 | private void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { | 619 | private void AddForce(OMV.Vector3 force, bool pushforce, bool inTaintTime) { |
@@ -622,13 +622,13 @@ public sealed class BSCharacter : BSPhysObject | |||
622 | OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); | 622 | OMV.Vector3 addForce = Util.ClampV(force, BSParam.MaxAddForceMagnitude); |
623 | // DetailLog("{0},BSCharacter.addForce,call,force={1}", LocalID, addForce); | 623 | // DetailLog("{0},BSCharacter.addForce,call,force={1}", LocalID, addForce); |
624 | 624 | ||
625 | PhysicsScene.TaintedObject(inTaintTime, "BSCharacter.AddForce", delegate() | 625 | PhysScene.TaintedObject(inTaintTime, "BSCharacter.AddForce", delegate() |
626 | { | 626 | { |
627 | // Bullet adds this central force to the total force for this tick | 627 | // Bullet adds this central force to the total force for this tick |
628 | // DetailLog("{0},BSCharacter.addForce,taint,force={1}", LocalID, addForce); | 628 | // DetailLog("{0},BSCharacter.addForce,taint,force={1}", LocalID, addForce); |
629 | if (PhysBody.HasPhysicalBody) | 629 | if (PhysBody.HasPhysicalBody) |
630 | { | 630 | { |
631 | PhysicsScene.PE.ApplyCentralForce(PhysBody, addForce); | 631 | PhysScene.PE.ApplyCentralForce(PhysBody, addForce); |
632 | } | 632 | } |
633 | }); | 633 | }); |
634 | } | 634 | } |