diff options
author | gareth | 2007-03-23 14:24:21 +0000 |
---|---|---|
committer | gareth | 2007-03-23 14:24:21 +0000 |
commit | 6cdd4ddf08be4280309da59daa546dea4ff9b71b (patch) | |
tree | 9c3f9798e98c097f18dd6e5c24ca4a12304dea4e /OpenSim.RegionServer | |
parent | * Hopefully got vs2005 target to gen refs correctly (diff) | |
download | opensim-SC_OLD-6cdd4ddf08be4280309da59daa546dea4ff9b71b.zip opensim-SC_OLD-6cdd4ddf08be4280309da59daa546dea4ff9b71b.tar.gz opensim-SC_OLD-6cdd4ddf08be4280309da59daa546dea4ff9b71b.tar.bz2 opensim-SC_OLD-6cdd4ddf08be4280309da59daa546dea4ff9b71b.tar.xz |
Added initial (buggy) support for animations
Diffstat (limited to '')
-rw-r--r-- | OpenSim.RegionServer/world/Avatar.cs | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/OpenSim.RegionServer/world/Avatar.cs b/OpenSim.RegionServer/world/Avatar.cs index ced05bf..2382f81 100644 --- a/OpenSim.RegionServer/world/Avatar.cs +++ b/OpenSim.RegionServer/world/Avatar.cs | |||
@@ -17,7 +17,9 @@ namespace OpenSim.world | |||
17 | public string firstname; | 17 | public string firstname; |
18 | public string lastname; | 18 | public string lastname; |
19 | public SimClient ControllingClient; | 19 | public SimClient ControllingClient; |
20 | private PhysicsActor _physActor; | 20 | public LLUUID current_anim; |
21 | public int anim_seq; | ||
22 | private PhysicsActor _physActor; | ||
21 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; | 23 | private static libsecondlife.Packets.ObjectUpdatePacket.ObjectDataBlock AvatarTemplate; |
22 | private bool updateflag = false; | 24 | private bool updateflag = false; |
23 | private byte movementflag = 0; | 25 | private byte movementflag = 0; |
@@ -275,7 +277,15 @@ namespace OpenSim.world | |||
275 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); | 277 | Axiom.MathLib.Quaternion q = new Axiom.MathLib.Quaternion(pack.AgentData.BodyRotation.W, pack.AgentData.BodyRotation.X, pack.AgentData.BodyRotation.Y, pack.AgentData.BodyRotation.Z); |
276 | if (((movementflag & 1) == 0) || (q != this.bodyRot)) | 278 | if (((movementflag & 1) == 0) || (q != this.bodyRot)) |
277 | { | 279 | { |
278 | //we should add a new force to the list | 280 | |
281 | if((movementflag &1) == 0) | ||
282 | { | ||
283 | this.current_anim=AnimsLLUUID["ANIM_AGENT_STAND"]; | ||
284 | this.anim_seq=1; | ||
285 | this.SendAnimPack(); | ||
286 | } | ||
287 | |||
288 | //we should add a new force to the list | ||
279 | // but for now we will deal with velocities | 289 | // but for now we will deal with velocities |
280 | NewForce newVelocity = new NewForce(); | 290 | NewForce newVelocity = new NewForce(); |
281 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); | 291 | Axiom.MathLib.Vector3 v3 = new Axiom.MathLib.Vector3(1, 0, 0); |
@@ -371,11 +381,31 @@ namespace OpenSim.world | |||
371 | newVelocity.Z = 0; | 381 | newVelocity.Z = 0; |
372 | this.forcesList.Add(newVelocity); | 382 | this.forcesList.Add(newVelocity); |
373 | movementflag = 0; | 383 | movementflag = 0; |
374 | } | 384 | // We're standing still, so make it show! |
385 | this.current_anim=AnimsLLUUID["ANIM_AGENT_STAND"]; | ||
386 | this.anim_seq=1; | ||
387 | this.SendAnimPack(); | ||
388 | } | ||
375 | } | 389 | } |
376 | } | 390 | } |
377 | 391 | ||
378 | //should be moved somewhere else | 392 | // Sends animation update |
393 | public void SendAnimPack() | ||
394 | { | ||
395 | AvatarAnimationPacket ani = new AvatarAnimationPacket(); | ||
396 | ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; | ||
397 | ani.AnimationSourceList[0] = new AvatarAnimationPacket.AnimationSourceListBlock(); | ||
398 | ani.AnimationSourceList[0].ObjectID = ControllingClient.AgentID; | ||
399 | ani.Sender = new AvatarAnimationPacket.SenderBlock(); | ||
400 | ani.Sender.ID = ControllingClient.AgentID; | ||
401 | ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; | ||
402 | ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); | ||
403 | ani.AnimationList[0].AnimID = this.current_anim; | ||
404 | ani.AnimationList[0].AnimSequenceID = this.anim_seq; | ||
405 | ControllingClient.OutPacket(ani); | ||
406 | } | ||
407 | |||
408 | //should be moved somewhere else | ||
379 | public void SendRegionHandshake(World RegionInfo) | 409 | public void SendRegionHandshake(World RegionInfo) |
380 | { | 410 | { |
381 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); | 411 | OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Avatar.cs:SendRegionHandshake() - Creating empty RegionHandshake packet"); |