diff options
author | Adam Frisby | 2007-06-29 18:37:26 +0000 |
---|---|---|
committer | Adam Frisby | 2007-06-29 18:37:26 +0000 |
commit | cc1c4c034c788b9e2f48d398b12b40ed8d363f40 (patch) | |
tree | f13e36573d65c2bac8d2f18eabdb90188499125f /OpenSim/Region | |
parent | *Deleted Logger.cs from OpenSim.Framework (diff) | |
download | opensim-SC_OLD-cc1c4c034c788b9e2f48d398b12b40ed8d363f40.zip opensim-SC_OLD-cc1c4c034c788b9e2f48d398b12b40ed8d363f40.tar.gz opensim-SC_OLD-cc1c4c034c788b9e2f48d398b12b40ed8d363f40.tar.bz2 opensim-SC_OLD-cc1c4c034c788b9e2f48d398b12b40ed8d363f40.tar.xz |
* Applying Danx0r's BasicPhysics update.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index dcb8f3b..e3f34da 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -101,22 +101,29 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
101 | { | 101 | { |
102 | foreach (BasicActor actor in _actors) | 102 | foreach (BasicActor actor in _actors) |
103 | { | 103 | { |
104 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); | ||
105 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); | ||
106 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
107 | /*if(actor.Flying) | ||
108 | { | ||
109 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
110 | } | ||
111 | else | ||
112 | { | ||
113 | actor.Position.Z = actor.Position.Z + ((-9.8f + actor.Velocity.Z) * timeStep); | ||
114 | } | ||
115 | if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1)) | ||
116 | {*/ | ||
117 | if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) | 104 | if ((actor.Position.Y > 0 && actor.Position.Y < 256) && (actor.Position.X > 0 && actor.Position.X < 256)) |
118 | { | 105 | { |
119 | actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1; | 106 | float height = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 1.2f; |
107 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); | ||
108 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); | ||
109 | if (actor.Flying) | ||
110 | { | ||
111 | if (actor.Position.Z + (actor.Velocity.Z * timeStep) < | ||
112 | _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X] + 2) | ||
113 | { | ||
114 | actor.Position.Z = height; | ||
115 | actor.Velocity.Z = 0; | ||
116 | } | ||
117 | else | ||
118 | { | ||
119 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
120 | } | ||
121 | } | ||
122 | else | ||
123 | { | ||
124 | actor.Position.Z = height; | ||
125 | actor.Velocity.Z = 0; | ||
126 | } | ||
120 | } | 127 | } |
121 | else | 128 | else |
122 | { | 129 | { |
@@ -167,7 +174,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
167 | actor.Position.Y = 255; | 174 | actor.Position.Y = 255; |
168 | actor.Velocity.X = 0; | 175 | actor.Velocity.X = 0; |
169 | }*/ | 176 | }*/ |
170 | } | 177 | } |
171 | } | 178 | } |
172 | 179 | ||
173 | public override void GetResults() | 180 | public override void GetResults() |
@@ -211,7 +218,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
211 | { | 218 | { |
212 | get | 219 | get |
213 | { | 220 | { |
214 | return false; | 221 | return flying; |
215 | } | 222 | } |
216 | set | 223 | set |
217 | { | 224 | { |