diff options
author | Robert Adams | 2012-07-12 15:34:25 -0700 |
---|---|---|
committer | Robert Adams | 2012-07-20 14:02:24 -0700 |
commit | c400918c84fc89ff0209ee05def3bb46206ba5ee (patch) | |
tree | fc28a498207e20136a87528b937ec619ab3cbe3a /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: Add detailed and voluminous debug logging that is enabled (diff) | |
download | opensim-SC_OLD-c400918c84fc89ff0209ee05def3bb46206ba5ee.zip opensim-SC_OLD-c400918c84fc89ff0209ee05def3bb46206ba5ee.tar.gz opensim-SC_OLD-c400918c84fc89ff0209ee05def3bb46206ba5ee.tar.bz2 opensim-SC_OLD-c400918c84fc89ff0209ee05def3bb46206ba5ee.tar.xz |
BulletSim: Add PID variables to physical scene. Not PIDing yet, but soon.
Cleaned up code and got rid of compile warnings.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 69 |
1 files changed, 32 insertions, 37 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index dc0c008..09e1f0c 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -41,7 +41,7 @@ public class BSCharacter : PhysicsActor | |||
41 | 41 | ||
42 | private BSScene _scene; | 42 | private BSScene _scene; |
43 | private String _avName; | 43 | private String _avName; |
44 | private bool _stopped; | 44 | // private bool _stopped; |
45 | private Vector3 _size; | 45 | private Vector3 _size; |
46 | private Vector3 _scale; | 46 | private Vector3 _scale; |
47 | private PrimitiveBaseShape _pbs; | 47 | private PrimitiveBaseShape _pbs; |
@@ -134,9 +134,9 @@ public class BSCharacter : PhysicsActor | |||
134 | { | 134 | { |
135 | base.RequestPhysicsterseUpdate(); | 135 | base.RequestPhysicsterseUpdate(); |
136 | } | 136 | } |
137 | 137 | // No one calls this method so I don't know what it could possibly mean | |
138 | public override bool Stopped { | 138 | public override bool Stopped { |
139 | get { return _stopped; } | 139 | get { return false; } |
140 | } | 140 | } |
141 | public override Vector3 Size { | 141 | public override Vector3 Size { |
142 | get { return _size; } | 142 | get { return _size; } |
@@ -391,52 +391,47 @@ public class BSCharacter : PhysicsActor | |||
391 | _mass = _density * _avatarVolume; | 391 | _mass = _density * _avatarVolume; |
392 | } | 392 | } |
393 | 393 | ||
394 | // Set to 'true' if the individual changed items should be checked | ||
395 | // (someday RequestPhysicsTerseUpdate() will take a bitmap of changed properties) | ||
396 | const bool SHOULD_CHECK_FOR_INDIVIDUAL_CHANGES = false; | ||
397 | |||
398 | // The physics engine says that properties have updated. Update same and inform | 394 | // The physics engine says that properties have updated. Update same and inform |
399 | // the world that things have changed. | 395 | // the world that things have changed. |
400 | public void UpdateProperties(EntityProperties entprop) | 396 | public void UpdateProperties(EntityProperties entprop) |
401 | { | 397 | { |
398 | /* | ||
402 | bool changed = false; | 399 | bool changed = false; |
403 | if (SHOULD_CHECK_FOR_INDIVIDUAL_CHANGES) { | 400 | // we assign to the local variables so the normal set action does not happen |
404 | // we assign to the local variables so the normal set action does not happen | 401 | if (_position != entprop.Position) { |
405 | if (_position != entprop.Position) { | ||
406 | _position = entprop.Position; | ||
407 | changed = true; | ||
408 | } | ||
409 | if (_orientation != entprop.Rotation) { | ||
410 | _orientation = entprop.Rotation; | ||
411 | changed = true; | ||
412 | } | ||
413 | if (_velocity != entprop.Velocity) { | ||
414 | _velocity = entprop.Velocity; | ||
415 | changed = true; | ||
416 | } | ||
417 | if (_acceleration != entprop.Acceleration) { | ||
418 | _acceleration = entprop.Acceleration; | ||
419 | changed = true; | ||
420 | } | ||
421 | if (_rotationalVelocity != entprop.RotationalVelocity) { | ||
422 | _rotationalVelocity = entprop.RotationalVelocity; | ||
423 | changed = true; | ||
424 | } | ||
425 | if (changed) { | ||
426 | // m_log.DebugFormat("{0}: UpdateProperties: id={1}, c={2}, pos={3}, rot={4}", LogHeader, LocalID, changed, _position, _orientation); | ||
427 | // Avatar movement is not done by generating this event. There is code in the heartbeat | ||
428 | // loop that updates avatars. | ||
429 | // base.RequestPhysicsterseUpdate(); | ||
430 | } | ||
431 | } | ||
432 | else { | ||
433 | _position = entprop.Position; | 402 | _position = entprop.Position; |
403 | changed = true; | ||
404 | } | ||
405 | if (_orientation != entprop.Rotation) { | ||
434 | _orientation = entprop.Rotation; | 406 | _orientation = entprop.Rotation; |
407 | changed = true; | ||
408 | } | ||
409 | if (_velocity != entprop.Velocity) { | ||
435 | _velocity = entprop.Velocity; | 410 | _velocity = entprop.Velocity; |
411 | changed = true; | ||
412 | } | ||
413 | if (_acceleration != entprop.Acceleration) { | ||
436 | _acceleration = entprop.Acceleration; | 414 | _acceleration = entprop.Acceleration; |
415 | changed = true; | ||
416 | } | ||
417 | if (_rotationalVelocity != entprop.RotationalVelocity) { | ||
437 | _rotationalVelocity = entprop.RotationalVelocity; | 418 | _rotationalVelocity = entprop.RotationalVelocity; |
419 | changed = true; | ||
420 | } | ||
421 | if (changed) { | ||
422 | // m_log.DebugFormat("{0}: UpdateProperties: id={1}, c={2}, pos={3}, rot={4}", LogHeader, LocalID, changed, _position, _orientation); | ||
423 | // Avatar movement is not done by generating this event. There is code in the heartbeat | ||
424 | // loop that updates avatars. | ||
438 | // base.RequestPhysicsterseUpdate(); | 425 | // base.RequestPhysicsterseUpdate(); |
439 | } | 426 | } |
427 | */ | ||
428 | _position = entprop.Position; | ||
429 | _orientation = entprop.Rotation; | ||
430 | _velocity = entprop.Velocity; | ||
431 | _acceleration = entprop.Acceleration; | ||
432 | _rotationalVelocity = entprop.RotationalVelocity; | ||
433 | // Avatars don't report theirr changes the usual way. Changes are checked for in the heartbeat loop. | ||
434 | // base.RequestPhysicsterseUpdate(); | ||
440 | } | 435 | } |
441 | 436 | ||
442 | // Called by the scene when a collision with this object is reported | 437 | // Called by the scene when a collision with this object is reported |