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/world | |
parent | Another attempt to fix the project files (diff) | |
download | opensim-SC-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.zip opensim-SC-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.tar.gz opensim-SC-76569ff4fba09f22ed4a06b8073deaed7f64a2e3.tar.bz2 opensim-SC-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/world')
-rw-r--r-- | src/world/Avatar.cs | 103 | ||||
-rw-r--r-- | src/world/Primitive.cs | 83 | ||||
-rw-r--r-- | src/world/World.cs | 9 |
3 files changed, 169 insertions, 26 deletions
diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs index c09c008..facfeee 100644 --- a/src/world/Avatar.cs +++ b/src/world/Avatar.cs | |||
@@ -11,15 +11,17 @@ namespace OpenSim.world | |||
11 | { | 11 | { |
12 | public class Avatar : Entity | 12 | public class Avatar : Entity |
13 | { | 13 | { |
14 | public static bool PhysicsEngineFlying; | ||
14 | public string firstname; | 15 | public string firstname; |
15 | public string lastname; | 16 | public string lastname; |
16 | public OpenSimClient ControllingClient; | 17 | public OpenSimClient ControllingClient; |
17 | private PhysicsActor _physActor; | 18 | private PhysicsActor _physActor; |
18 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; | 19 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; |
19 | private bool updateflag; | 20 | private bool updateflag; |
20 | private bool walking; | 21 | private byte movementflag; |
21 | private List<NewForce> forcesList = new List<NewForce>(); | 22 | private List<NewForce> forcesList = new List<NewForce>(); |
22 | private short _updateCount; | 23 | private short _updateCount; |
24 | private Axiom.MathLib.Quaternion bodyRot; | ||
23 | 25 | ||
24 | public Avatar(OpenSimClient TheClient) { | 26 | public Avatar(OpenSimClient TheClient) { |
25 | ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); | 27 | ServerConsole.MainConsole.Instance.WriteLine("Avatar.cs - Loading details from grid (DUMMY)"); |
@@ -77,14 +79,14 @@ namespace OpenSim.world | |||
77 | } | 79 | } |
78 | 80 | ||
79 | updateflag =false; | 81 | updateflag =false; |
80 | this._updateCount = 0; | 82 | //this._updateCount = 0; |
81 | } | 83 | } |
82 | else | 84 | else |
83 | { | 85 | { |
84 | if(walking) | 86 | //if((movementflag & 1) !=0) |
85 | { | 87 | //{ |
86 | _updateCount++; | 88 | _updateCount++; |
87 | if(_updateCount>3) | 89 | if(( (!PhysicsEngineFlying) && (_updateCount>3)) || (_updateCount>0)) |
88 | { | 90 | { |
89 | //It has been a while since last update was sent so lets send one. | 91 | //It has been a while since last update was sent so lets send one. |
90 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); | 92 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock terseBlock = CreateTerseBlock(); |
@@ -98,7 +100,7 @@ namespace OpenSim.world | |||
98 | } | 100 | } |
99 | _updateCount = 0; | 101 | _updateCount = 0; |
100 | } | 102 | } |
101 | } | 103 | //} |
102 | } | 104 | } |
103 | } | 105 | } |
104 | 106 | ||
@@ -249,36 +251,111 @@ namespace OpenSim.world | |||
249 | } | 251 | } |
250 | 252 | ||
251 | public void HandleUpdate(AgentUpdatePacket pack) { | 253 | public void HandleUpdate(AgentUpdatePacket pack) { |
252 | if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) !=0) { | 254 | if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_FLY) !=0) |
253 | if(!walking) | 255 | { |
256 | this._physActor.Flying = true; | ||
257 | } | ||
258 | else | ||
259 | { | ||
260 | this._physActor.Flying = false; | ||
261 | } | ||
262 | if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_POS) !=0) { | ||
263 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); | ||
264 | if(((movementflag & 1) ==0) || (q!= this.bodyRot)) | ||
254 | { | 265 | { |
255 | //we should add a new force to the list | 266 | //we should add a new force to the list |
256 | // but for now we will deal with velocities | 267 | // but for now we will deal with velocities |
257 | NewForce newVelocity = new NewForce(); | 268 | NewForce newVelocity = new NewForce(); |
258 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); | 269 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); |
259 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); | ||
260 | Axiom.MathLib.Vector3 direc = q * v3; | 270 | Axiom.MathLib.Vector3 direc = q * v3; |
261 | direc.Normalize(); | 271 | direc.Normalize(); |
262 | 272 | ||
263 | //work out velocity for sim physics system | 273 | //work out velocity for sim physics system |
264 | direc = direc * ((0.03f) * 128f); | 274 | direc = direc * ((0.03f) * 128f); |
275 | if(this._physActor.Flying) | ||
276 | direc *=2; | ||
277 | |||
278 | newVelocity.X = direc.x; | ||
279 | newVelocity.Y = direc.y; | ||
280 | newVelocity.Z = direc.z; | ||
281 | this.forcesList.Add(newVelocity); | ||
282 | movementflag = 1; | ||
283 | this.bodyRot = q; | ||
284 | } | ||
285 | } | ||
286 | else if((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_POS) !=0) &&(PhysicsEngineFlying)) { | ||
287 | if(((movementflag & 2) ==0) && this._physActor.Flying) | ||
288 | { | ||
289 | //we should add a new force to the list | ||
290 | // but for now we will deal with velocities | ||
291 | NewForce newVelocity = new NewForce(); | ||
292 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, 1); | ||
293 | Axiom.MathLib.Vector3 direc = v3; | ||
294 | direc.Normalize(); | ||
295 | |||
296 | //work out velocity for sim physics system | ||
297 | direc = direc * ((0.03f) * 128f *2); | ||
298 | newVelocity.X = direc.x; | ||
299 | newVelocity.Y = direc.y; | ||
300 | newVelocity.Z = direc.z; | ||
301 | this.forcesList.Add(newVelocity); | ||
302 | movementflag = 2; | ||
303 | } | ||
304 | } | ||
305 | else if((((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_UP_NEG) !=0) && (PhysicsEngineFlying)) { | ||
306 | if(((movementflag & 4) ==0) && this._physActor.Flying) | ||
307 | { | ||
308 | //we should add a new force to the list | ||
309 | // but for now we will deal with velocities | ||
310 | NewForce newVelocity = new NewForce(); | ||
311 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(0, 0, -1); | ||
312 | //Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); | ||
313 | Axiom.MathLib.Vector3 direc = v3; | ||
314 | direc.Normalize(); | ||
315 | |||
316 | //work out velocity for sim physics system | ||
317 | direc = direc * ((0.03f) * 128f *2); | ||
318 | newVelocity.X = direc.x; | ||
319 | newVelocity.Y = direc.y; | ||
320 | newVelocity.Z = direc.z; | ||
321 | this.forcesList.Add(newVelocity); | ||
322 | movementflag = 4; | ||
323 | } | ||
324 | } | ||
325 | else if(((uint)pack.AgentData.ControlFlags & (uint)MainAvatar.AgentUpdateFlags.AGENT_CONTROL_AT_NEG) !=0) { | ||
326 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); | ||
327 | if(((movementflag & 8) ==0) || (q!= this.bodyRot)) | ||
328 | { | ||
329 | //we should add a new force to the list | ||
330 | // but for now we will deal with velocities | ||
331 | NewForce newVelocity = new NewForce(); | ||
332 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(-1, 0, 0); | ||
333 | Axiom.MathLib.Vector3 direc = q * v3; | ||
334 | direc.Normalize(); | ||
335 | |||
336 | //work out velocity for sim physics system | ||
337 | direc = direc * ((0.03f) * 128f); | ||
338 | if(this._physActor.Flying) | ||
339 | direc *=2; | ||
340 | |||
265 | newVelocity.X = direc.x; | 341 | newVelocity.X = direc.x; |
266 | newVelocity.Y = direc.y; | 342 | newVelocity.Y = direc.y; |
267 | newVelocity.Z = direc.z; | 343 | newVelocity.Z = direc.z; |
268 | this.forcesList.Add(newVelocity); | 344 | this.forcesList.Add(newVelocity); |
269 | walking=true; | 345 | movementflag = 8; |
346 | this.bodyRot = q; | ||
270 | } | 347 | } |
271 | } | 348 | } |
272 | else | 349 | else |
273 | { | 350 | { |
274 | if(walking) | 351 | if((movementflag) !=0) |
275 | { | 352 | { |
276 | NewForce newVelocity = new NewForce(); | 353 | NewForce newVelocity = new NewForce(); |
277 | newVelocity.X = 0; | 354 | newVelocity.X = 0; |
278 | newVelocity.Y = 0; | 355 | newVelocity.Y = 0; |
279 | newVelocity.Z = 0; | 356 | newVelocity.Z = 0; |
280 | this.forcesList.Add(newVelocity); | 357 | this.forcesList.Add(newVelocity); |
281 | walking = false; | 358 | movementflag = 0; |
282 | } | 359 | } |
283 | } | 360 | } |
284 | } | 361 | } |
diff --git a/src/world/Primitive.cs b/src/world/Primitive.cs index 0d7d951..6be33ef 100644 --- a/src/world/Primitive.cs +++ b/src/world/Primitive.cs | |||
@@ -5,6 +5,7 @@ using OpenSim.types; | |||
5 | using libsecondlife; | 5 | using libsecondlife; |
6 | using libsecondlife.Packets; | 6 | using libsecondlife.Packets; |
7 | using GridInterfaces; | 7 | using GridInterfaces; |
8 | using PhysicsSystem; | ||
8 | 9 | ||
9 | namespace OpenSim.world | 10 | namespace OpenSim.world |
10 | { | 11 | { |
@@ -16,8 +17,21 @@ namespace OpenSim.world | |||
16 | protected bool newPrimFlag; | 17 | protected bool newPrimFlag; |
17 | protected bool updateFlag; | 18 | protected bool updateFlag; |
18 | protected bool dirtyFlag; | 19 | protected bool dirtyFlag; |
19 | protected ObjectUpdatePacket OurPacket; | 20 | private ObjectUpdatePacket OurPacket; |
21 | private PhysicsActor _physActor; | ||
22 | private bool physicsEnabled; | ||
20 | 23 | ||
24 | public bool PhysicsEnabled | ||
25 | { | ||
26 | get | ||
27 | { | ||
28 | return physicsEnabled; | ||
29 | } | ||
30 | set | ||
31 | { | ||
32 | physicsEnabled = value; | ||
33 | } | ||
34 | } | ||
21 | public bool UpdateFlag | 35 | public bool UpdateFlag |
22 | { | 36 | { |
23 | get | 37 | get |
@@ -41,6 +55,14 @@ namespace OpenSim.world | |||
41 | return this.primData.Scale; | 55 | return this.primData.Scale; |
42 | } | 56 | } |
43 | } | 57 | } |
58 | public PhysicsActor PhysActor | ||
59 | { | ||
60 | set | ||
61 | { | ||
62 | this._physActor = value; | ||
63 | } | ||
64 | } | ||
65 | |||
44 | public Primitive() | 66 | public Primitive() |
45 | { | 67 | { |
46 | mesh_cutbegin = 0.0f; | 68 | mesh_cutbegin = 0.0f; |
@@ -61,6 +83,16 @@ namespace OpenSim.world | |||
61 | return mesh; | 83 | return mesh; |
62 | } | 84 | } |
63 | 85 | ||
86 | public void UpdatePosition( LLVector3 pos) | ||
87 | { | ||
88 | this.position = pos; | ||
89 | if(this._physActor != null && this.physicsEnabled) | ||
90 | { | ||
91 | this._physActor.Position = new PhysicsVector(pos.X, pos.Y, pos.Z); | ||
92 | } | ||
93 | this.updateFlag = true; | ||
94 | } | ||
95 | |||
64 | public override void update() | 96 | public override void update() |
65 | { | 97 | { |
66 | if(this.newPrimFlag) | 98 | if(this.newPrimFlag) |
@@ -89,13 +121,39 @@ namespace OpenSim.world | |||
89 | } | 121 | } |
90 | this.dirtyFlag = false; | 122 | this.dirtyFlag = false; |
91 | } | 123 | } |
92 | 124 | else | |
125 | { | ||
126 | if(this._physActor != null && this.physicsEnabled) | ||
127 | { | ||
128 | ImprovedTerseObjectUpdatePacket terse = new ImprovedTerseObjectUpdatePacket(); | ||
129 | terse.RegionData.RegionHandle = OpenSim_Main.cfg.RegionHandle; // FIXME | ||
130 | terse.RegionData.TimeDilation = 64096; | ||
131 | terse.ObjectData = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock[1]; | ||
132 | terse.ObjectData[0] = this.CreateImprovedBlock(); | ||
133 | foreach(OpenSimClient client in OpenSim_Main.sim.ClientThreads.Values) { | ||
134 | client.OutPacket(terse); | ||
135 | } | ||
136 | } | ||
137 | } | ||
93 | } | 138 | } |
94 | 139 | ||
95 | public void UpdateClient(OpenSimClient RemoteClient) | 140 | public void UpdateClient(OpenSimClient RemoteClient) |
96 | { | 141 | { |
97 | byte[] pb = this.position.GetBytes(); | 142 | |
143 | LLVector3 lPos; | ||
144 | if( this._physActor != null && this.physicsEnabled) | ||
145 | { | ||
146 | PhysicsVector pPos = this._physActor.Position; | ||
147 | lPos = new LLVector3( pPos.X, pPos.Y, pPos.Z); | ||
148 | } | ||
149 | else | ||
150 | { | ||
151 | lPos = this.position; | ||
152 | } | ||
153 | byte[] pb = lPos.GetBytes(); | ||
98 | Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length); | 154 | Array.Copy(pb, 0, OurPacket.ObjectData[0].ObjectData, 0, pb.Length); |
155 | |||
156 | // OurPacket should be update with the follwing in updateShape() rather than having to do it here | ||
99 | OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID; | 157 | OurPacket.ObjectData[0].OwnerID = this.primData.OwnerID; |
100 | OurPacket.ObjectData[0].PCode = this.primData.PCode; | 158 | OurPacket.ObjectData[0].PCode = this.primData.PCode; |
101 | OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin; | 159 | OurPacket.ObjectData[0].PathBegin = this.primData.PathBegin; |
@@ -137,7 +195,6 @@ namespace OpenSim.world | |||
137 | this.primData.PathCurve = addPacket.PathCurve; | 195 | this.primData.PathCurve = addPacket.PathCurve; |
138 | this.primData.ProfileCurve = addPacket.ProfileCurve; | 196 | this.primData.ProfileCurve = addPacket.ProfileCurve; |
139 | this.primData.ProfileHollow = addPacket.ProfileHollow; | 197 | this.primData.ProfileHollow = addPacket.ProfileHollow; |
140 | |||
141 | this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; | 198 | this.primData.PathRadiusOffset = addPacket.PathRadiusOffset; |
142 | this.primData.PathRevolutions = addPacket.PathRevolutions; | 199 | this.primData.PathRevolutions = addPacket.PathRevolutions; |
143 | this.primData.PathTaperX = addPacket.PathTaperX; | 200 | this.primData.PathTaperX = addPacket.PathTaperX; |
@@ -145,7 +202,6 @@ namespace OpenSim.world | |||
145 | this.primData.PathTwist = addPacket.PathTwist; | 202 | this.primData.PathTwist = addPacket.PathTwist; |
146 | this.primData.PathTwistBegin =addPacket.PathTwistBegin; | 203 | this.primData.PathTwistBegin =addPacket.PathTwistBegin; |
147 | this.dirtyFlag = true; | 204 | this.dirtyFlag = true; |
148 | |||
149 | } | 205 | } |
150 | 206 | ||
151 | public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID) | 207 | public void CreateFromPacket( ObjectAddPacket addPacket, LLUUID agentID, uint localID) |
@@ -162,7 +218,6 @@ namespace OpenSim.world | |||
162 | objupdate.ObjectData[0].ExtraParams = new byte[1]; | 218 | objupdate.ObjectData[0].ExtraParams = new byte[1]; |
163 | objupdate.ObjectData[0].MediaURL = new byte[0]; | 219 | objupdate.ObjectData[0].MediaURL = new byte[0]; |
164 | objupdate.ObjectData[0].NameValue = new byte[0]; | 220 | objupdate.ObjectData[0].NameValue = new byte[0]; |
165 | objupdate.ObjectData[0].PSBlock = new byte[0]; | ||
166 | objupdate.ObjectData[0].Text = new byte[0]; | 221 | objupdate.ObjectData[0].Text = new byte[0]; |
167 | objupdate.ObjectData[0].TextColor = new byte[4]; | 222 | objupdate.ObjectData[0].TextColor = new byte[4]; |
168 | objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0); | 223 | objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0); |
@@ -232,7 +287,6 @@ namespace OpenSim.world | |||
232 | objupdate.ObjectData[0].ExtraParams = new byte[1]; | 287 | objupdate.ObjectData[0].ExtraParams = new byte[1]; |
233 | objupdate.ObjectData[0].MediaURL = new byte[0]; | 288 | objupdate.ObjectData[0].MediaURL = new byte[0]; |
234 | objupdate.ObjectData[0].NameValue = new byte[0]; | 289 | objupdate.ObjectData[0].NameValue = new byte[0]; |
235 | objupdate.ObjectData[0].PSBlock = new byte[0]; | ||
236 | objupdate.ObjectData[0].Text = new byte[0]; | 290 | objupdate.ObjectData[0].Text = new byte[0]; |
237 | objupdate.ObjectData[0].TextColor = new byte[4]; | 291 | objupdate.ObjectData[0].TextColor = new byte[4]; |
238 | objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0); | 292 | objupdate.ObjectData[0].JointAxisOrAnchor = new LLVector3(0,0,0); |
@@ -291,7 +345,6 @@ namespace OpenSim.world | |||
291 | uint ID = this.localid; | 345 | uint ID = this.localid; |
292 | byte[] bytes = new byte[60]; | 346 | byte[] bytes = new byte[60]; |
293 | 347 | ||
294 | |||
295 | int i = 0; | 348 | int i = 0; |
296 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); | 349 | ImprovedTerseObjectUpdatePacket.ObjectDataBlock dat = new ImprovedTerseObjectUpdatePacket.ObjectDataBlock(); |
297 | dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry; | 350 | dat.TextureEntry = this.OurPacket.ObjectData[0].TextureEntry; |
@@ -302,8 +355,18 @@ namespace OpenSim.world | |||
302 | bytes[i++] = (byte)((ID >> 24) % 256); | 355 | bytes[i++] = (byte)((ID >> 24) % 256); |
303 | bytes[i++]= 0; | 356 | bytes[i++]= 0; |
304 | bytes[i++]= 0; | 357 | bytes[i++]= 0; |
305 | 358 | ||
306 | byte[] pb = this.position.GetBytes(); | 359 | LLVector3 lPos; |
360 | if( this._physActor != null && this.physicsEnabled) | ||
361 | { | ||
362 | PhysicsVector pPos = this._physActor.Position; | ||
363 | lPos = new LLVector3( pPos.X, pPos.Y, pPos.Z); | ||
364 | } | ||
365 | else | ||
366 | { | ||
367 | lPos = this.position; | ||
368 | } | ||
369 | byte[] pb = lPos.GetBytes(); | ||
307 | Array.Copy(pb, 0, bytes, i, pb.Length); | 370 | Array.Copy(pb, 0, bytes, i, pb.Length); |
308 | i += 12; | 371 | i += 12; |
309 | ushort ac = 32767; | 372 | ushort ac = 32767; |
diff --git a/src/world/World.cs b/src/world/World.cs index fb78819..e1c84bc 100644 --- a/src/world/World.cs +++ b/src/world/World.cs | |||
@@ -176,9 +176,8 @@ namespace OpenSim.world | |||
176 | ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); | 176 | ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Adding new avatar to world"); |
177 | ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); | 177 | ServerConsole.MainConsole.Instance.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
178 | NewAvatar.SendRegionHandshake(this); | 178 | NewAvatar.SendRegionHandshake(this); |
179 | 179 | PhysicsVector pVec = new PhysicsVector(NewAvatar.position.X, NewAvatar.position.Y, NewAvatar.position.Z); | |
180 | NewAvatar.PhysActor = this.phyScene.AddAvatar(new PhysicsVector(NewAvatar.position.X, NewAvatar.position.Y, NewAvatar.position.Z)); | 180 | NewAvatar.PhysActor = this.phyScene.AddAvatar(pVec); |
181 | //this.Update(); // will work for now, but needs to be optimised so we don't update everything in the sim for each new user | ||
182 | this.Entities.Add(AgentClient.AgentID, NewAvatar); | 181 | this.Entities.Add(AgentClient.AgentID, NewAvatar); |
183 | } | 182 | } |
184 | 183 | ||
@@ -187,6 +186,10 @@ namespace OpenSim.world | |||
187 | ServerConsole.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); | 186 | ServerConsole.MainConsole.Instance.WriteLine("World.cs: AddNewPrim() - Creating new prim"); |
188 | Primitive prim = new Primitive(); | 187 | Primitive prim = new Primitive(); |
189 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); | 188 | prim.CreateFromPacket(addPacket, AgentClient.AgentID, this._primCount); |
189 | PhysicsVector pVec = new PhysicsVector(prim.position.X, prim.position.Y, prim.position.Z); | ||
190 | PhysicsVector pSize = new PhysicsVector( 0.25f, 0.25f, 0.25f); | ||
191 | //prim.PhysActor = this.phyScene.AddPrim(pVec, pSize ); | ||
192 | //prim.PhysicsEnabled = true; | ||
190 | this.Entities.Add(prim.uuid, prim); | 193 | this.Entities.Add(prim.uuid, prim); |
191 | this._primCount++; | 194 | this._primCount++; |
192 | } | 195 | } |