aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BasicPhysicsPlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/BasicPhysicsPlugin')
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs20
1 files changed, 9 insertions, 11 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
index b6e1cb4..1ceed1a 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsScene.cs
@@ -84,13 +84,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
84*/ 84*/
85 85
86 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 86 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
87 Vector3 size, Quaternion rotation) 87 Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
88 {
89 return AddPrimShape(primName, pbs, position, size, rotation, false);
90 }
91
92 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
93 Vector3 size, Quaternion rotation, bool isPhysical)
94 { 88 {
95 return null; 89 return null;
96 } 90 }
@@ -129,11 +123,15 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
129 actorPosition.X = ((int)Constants.RegionSize - 0.1f); 123 actorPosition.X = ((int)Constants.RegionSize - 0.1f);
130 } 124 }
131 125
132 float height = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + actor.Size.Z; 126 float terrainHeight = 0;
127 if (_heightMap != null)
128 terrainHeight = _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X];
129
130 float height = terrainHeight + actor.Size.Z;
131
133 if (actor.Flying) 132 if (actor.Flying)
134 { 133 {
135 if (actor.Position.Z + (actor.Velocity.Z*timeStep) < 134 if (actor.Position.Z + (actor.Velocity.Z * timeStep) < terrainHeight + 2)
136 _heightMap[(int)actor.Position.Y * Constants.RegionSize + (int)actor.Position.X] + 2)
137 { 135 {
138 actorPosition.Z = height; 136 actorPosition.Z = height;
139 actorVelocity.Z = 0; 137 actorVelocity.Z = 0;
@@ -141,7 +139,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
141 } 139 }
142 else 140 else
143 { 141 {
144 actorPosition.Z += actor.Velocity.Z*timeStep; 142 actorPosition.Z += actor.Velocity.Z * timeStep;
145 actor.IsColliding = false; 143 actor.IsColliding = false;
146 } 144 }
147 } 145 }