diff options
author | MW | 2007-03-10 20:30:25 +0000 |
---|---|---|
committer | MW | 2007-03-10 20:30:25 +0000 |
commit | 76569ff4fba09f22ed4a06b8073deaed7f64a2e3 (patch) | |
tree | f83430652d8874f299733f505b6b7ded13910bb8 /src/physics/plugins/PhysXplugin.cs | |
parent | Another attempt to fix the project files (diff) | |
download | opensim-SC_OLD-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.zip opensim-SC_OLD-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.tar.gz opensim-SC_OLD-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.tar.bz2 opensim-SC_OLD-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.tar.xz |
A PhysX physics plugin (that actually uses physX now but currently only works on windows)
Can now change direction when walking without stopping
Flying works when using the Physx dll
Diffstat (limited to 'src/physics/plugins/PhysXplugin.cs')
-rw-r--r-- | src/physics/plugins/PhysXplugin.cs | 38 |
1 files changed, 33 insertions, 5 deletions
diff --git a/src/physics/plugins/PhysXplugin.cs b/src/physics/plugins/PhysXplugin.cs index 58a82fb..8c09dc8 100644 --- a/src/physics/plugins/PhysXplugin.cs +++ b/src/physics/plugins/PhysXplugin.cs | |||
@@ -85,14 +85,30 @@ namespace PhysXplugin | |||
85 | return act; | 85 | return act; |
86 | } | 86 | } |
87 | 87 | ||
88 | public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) | ||
89 | { | ||
90 | return null; | ||
91 | } | ||
92 | |||
88 | public override void Simulate(float timeStep) | 93 | public override void Simulate(float timeStep) |
89 | { | 94 | { |
90 | foreach (PhysXActor actor in _actors) | 95 | foreach (PhysXActor actor in _actors) |
91 | { | 96 | { |
92 | actor.Position.X = actor.Position.X + actor.Velocity.X * timeStep; | 97 | actor.Position.X = actor.Position.X + (actor.Velocity.X * timeStep); |
93 | actor.Position.Y = actor.Position.Y + actor.Velocity.Y * timeStep; | 98 | actor.Position.Y = actor.Position.Y + (actor.Velocity.Y * timeStep); |
94 | actor.Position.Z = actor.Position.Z + actor.Velocity.Z * timeStep; | 99 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); |
95 | actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1; | 100 | /*if(actor.Flying) |
101 | { | ||
102 | actor.Position.Z = actor.Position.Z + (actor.Velocity.Z * timeStep); | ||
103 | } | ||
104 | else | ||
105 | { | ||
106 | actor.Position.Z = actor.Position.Z + ((-9.8f + actor.Velocity.Z) * timeStep); | ||
107 | } | ||
108 | if(actor.Position.Z < (_heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1)) | ||
109 | {*/ | ||
110 | actor.Position.Z = _heightMap[(int)actor.Position.Y * 256 + (int)actor.Position.X]+1; | ||
111 | //} | ||
96 | if(actor.Position.X<0) | 112 | if(actor.Position.X<0) |
97 | { | 113 | { |
98 | actor.Position.X = 0; | 114 | actor.Position.X = 0; |
@@ -140,7 +156,7 @@ namespace PhysXplugin | |||
140 | private PhysicsVector _position; | 156 | private PhysicsVector _position; |
141 | private PhysicsVector _velocity; | 157 | private PhysicsVector _velocity; |
142 | private PhysicsVector _acceleration; | 158 | private PhysicsVector _acceleration; |
143 | 159 | private bool flying; | |
144 | public PhysXActor() | 160 | public PhysXActor() |
145 | { | 161 | { |
146 | _velocity = new PhysicsVector(); | 162 | _velocity = new PhysicsVector(); |
@@ -148,6 +164,18 @@ namespace PhysXplugin | |||
148 | _acceleration = new PhysicsVector(); | 164 | _acceleration = new PhysicsVector(); |
149 | } | 165 | } |
150 | 166 | ||
167 | public override bool Flying | ||
168 | { | ||
169 | get | ||
170 | { | ||
171 | return false; | ||
172 | } | ||
173 | set | ||
174 | { | ||
175 | flying= value; | ||
176 | } | ||
177 | } | ||
178 | |||
151 | public override PhysicsVector Position | 179 | public override PhysicsVector Position |
152 | { | 180 | { |
153 | get | 181 | get |