aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
diff options
context:
space:
mode:
authorMelanie2010-03-15 17:23:35 +0000
committerMelanie2010-03-15 17:23:35 +0000
commitd3f33acc1a6a385ee19814286fe27cb5e48c1551 (patch)
tree07795e74a637ca63d96b5ee06950b8c1a7a99489 /OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
parentMerge branch 'careminster' into careminster-presence-refactor (diff)
parentflip UVs for profile faces (diff)
downloadopensim-SC_OLD-d3f33acc1a6a385ee19814286fe27cb5e48c1551.zip
opensim-SC_OLD-d3f33acc1a6a385ee19814286fe27cb5e48c1551.tar.gz
opensim-SC_OLD-d3f33acc1a6a385ee19814286fe27cb5e48c1551.tar.bz2
opensim-SC_OLD-d3f33acc1a6a385ee19814286fe27cb5e48c1551.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs')
-rw-r--r--OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs33
1 files changed, 29 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
index 198962b..f13c323 100644
--- a/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
+++ b/OpenSim/Region/Physics/BulletDotNETPlugin/BulletDotNETCharacter.cs
@@ -108,12 +108,11 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
108 private bool[] m_colliderarr = new bool[11]; 108 private bool[] m_colliderarr = new bool[11];
109 private bool[] m_colliderGroundarr = new bool[11]; 109 private bool[] m_colliderGroundarr = new bool[11];
110 110
111
112
113 private BulletDotNETScene m_parent_scene; 111 private BulletDotNETScene m_parent_scene;
114 112
115 public int m_eventsubscription = 0; 113 public int m_eventsubscription = 0;
116 // private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); 114 private CollisionEventUpdate CollisionEventsThisFrame = null;
115 private int m_requestedUpdateFrequency = 0;
117 116
118 public BulletDotNETCharacter(string avName, BulletDotNETScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, float capsule_radius, float tensor, float density, float height_fudge_factor, float walk_divisor, float rundivisor) 117 public BulletDotNETCharacter(string avName, BulletDotNETScene parent_scene, Vector3 pos, Vector3 size, float pid_d, float pid_p, float capsule_radius, float tensor, float density, float height_fudge_factor, float walk_divisor, float rundivisor)
119 { 118 {
@@ -212,7 +211,8 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
212 m_mass = Mass; 211 m_mass = Mass;
213 212
214 Body = new btRigidBody(m_mass, m_bodyMotionState, Shell); 213 Body = new btRigidBody(m_mass, m_bodyMotionState, Shell);
215 Body.setUserPointer(new IntPtr((int)Body.Handle)); 214 // this is used for self identification. User localID instead of body handle
215 Body.setUserPointer(new IntPtr((int)m_localID));
216 216
217 if (ClosestCastResult != null) 217 if (ClosestCastResult != null)
218 ClosestCastResult.Dispose(); 218 ClosestCastResult.Dispose();
@@ -716,6 +716,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
716 public override void SubscribeEvents(int ms) 716 public override void SubscribeEvents(int ms)
717 { 717 {
718 m_eventsubscription = ms; 718 m_eventsubscription = ms;
719 m_requestedUpdateFrequency = ms;
719 m_parent_scene.addCollisionEventReporting(this); 720 m_parent_scene.addCollisionEventReporting(this);
720 } 721 }
721 722
@@ -723,6 +724,7 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
723 { 724 {
724 m_parent_scene.remCollisionEventReporting(this); 725 m_parent_scene.remCollisionEventReporting(this);
725 m_eventsubscription = 0; 726 m_eventsubscription = 0;
727 m_requestedUpdateFrequency = 0;
726 } 728 }
727 729
728 public override bool SubscribedEvents() 730 public override bool SubscribedEvents()
@@ -732,6 +734,29 @@ namespace OpenSim.Region.Physics.BulletDotNETPlugin
732 return false; 734 return false;
733 } 735 }
734 736
737 public void AddCollision(uint collideWith, ContactPoint contact)
738 {
739 if (CollisionEventsThisFrame == null)
740 {
741 CollisionEventsThisFrame = new CollisionEventUpdate();
742 }
743 CollisionEventsThisFrame.addCollider(collideWith, contact);
744 }
745
746 public void SendCollisions()
747 {
748 if (m_eventsubscription >= m_requestedUpdateFrequency)
749 {
750 if (CollisionEventsThisFrame != null)
751 {
752 base.SendCollisionUpdate(CollisionEventsThisFrame);
753 }
754 CollisionEventsThisFrame = new CollisionEventUpdate();
755 m_eventsubscription = 0;
756 }
757 return;
758 }
759
735 internal void Dispose() 760 internal void Dispose()
736 { 761 {
737 if (Body.isInWorld()) 762 if (Body.isInWorld())