aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorTeravus Ovares2007-12-22 07:23:02 +0000
committerTeravus Ovares2007-12-22 07:23:02 +0000
commit9f886083ab29d39b60869f48de75d14122a36715 (patch)
tree38a9629ce622329f96afa0d07d839a097623ea8c /OpenSim/Region
parent* Added smoother handling of interpenetrating physical objects. (diff)
downloadopensim-SC_OLD-9f886083ab29d39b60869f48de75d14122a36715.zip
opensim-SC_OLD-9f886083ab29d39b60869f48de75d14122a36715.tar.gz
opensim-SC_OLD-9f886083ab29d39b60869f48de75d14122a36715.tar.bz2
opensim-SC_OLD-9f886083ab29d39b60869f48de75d14122a36715.tar.xz
* Fixed general avatar bounciness in ODE
* Craggy terrain mishandling by ODE still occasionally causes point bounciness
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs21
1 files changed, 20 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 3bdf180..273ee23 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -74,6 +74,7 @@ namespace OpenSim.Region.Physics.OdePlugin
74 public IntPtr Body; 74 public IntPtr Body;
75 private OdeScene _parent_scene; 75 private OdeScene _parent_scene;
76 public IntPtr Shell; 76 public IntPtr Shell;
77 public IntPtr Amotor;
77 public d.Mass ShellMass; 78 public d.Mass ShellMass;
78 public bool collidelock = false; 79 public bool collidelock = false;
79 80
@@ -92,13 +93,30 @@ namespace OpenSim.Region.Physics.OdePlugin
92 93
93 lock (OdeScene.OdeLock) 94 lock (OdeScene.OdeLock)
94 { 95 {
95 96 int dAMotorEuler = 1;
96 Shell = d.CreateCapsule(parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 97 Shell = d.CreateCapsule(parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
97 d.MassSetCapsule(out ShellMass, m_density, 3, CAPSULE_RADIUS, CAPSULE_LENGTH); 98 d.MassSetCapsule(out ShellMass, m_density, 3, CAPSULE_RADIUS, CAPSULE_LENGTH);
98 Body = d.BodyCreate(parent_scene.world); 99 Body = d.BodyCreate(parent_scene.world);
99 d.BodySetMass(Body, ref ShellMass); 100 d.BodySetMass(Body, ref ShellMass);
100 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z); 101 d.BodySetPosition(Body, pos.X, pos.Y, pos.Z);
101 d.GeomSetBody(Shell, Body); 102 d.GeomSetBody(Shell, Body);
103 Amotor = d.JointCreateAMotor(parent_scene.world, IntPtr.Zero);
104 d.JointAttach(Amotor, Body, IntPtr.Zero);
105 d.JointSetAMotorMode(Amotor, dAMotorEuler);
106 d.JointSetAMotorNumAxes(Amotor, 3);
107 d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0);
108 d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0);
109 d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1);
110 d.JointSetAMotorAngle(Amotor, 0, 0);
111 d.JointSetAMotorAngle(Amotor, 1, 0);
112 d.JointSetAMotorAngle(Amotor, 2, 0);
113 d.JointSetAMotorParam(Amotor, 0, -0);
114 d.JointSetAMotorParam(Amotor, 0x200, -0);
115 d.JointSetAMotorParam(Amotor, 0x100, -0);
116 d.JointSetAMotorParam(Amotor, 0, 0);
117 d.JointSetAMotorParam(Amotor, 3, 0);
118 d.JointSetAMotorParam(Amotor, 2, 0);
119
102 } 120 }
103 m_name = avName; 121 m_name = avName;
104 parent_scene.geom_name_map[Shell] = avName; 122 parent_scene.geom_name_map[Shell] = avName;
@@ -547,6 +565,7 @@ namespace OpenSim.Region.Physics.OdePlugin
547 { 565 {
548 lock (OdeScene.OdeLock) 566 lock (OdeScene.OdeLock)
549 { 567 {
568 d.JointDestroy(Amotor);
550 d.GeomDestroy(Shell); 569 d.GeomDestroy(Shell);
551 _parent_scene.geom_name_map.Remove(Shell); 570 _parent_scene.geom_name_map.Remove(Shell);
552 d.BodyDestroy(Body); 571 d.BodyDestroy(Body);