* Completed a partial port of OpenSim's LSL API. Thank you to everyone on the OpenSim team for their hard work on this incredibly large feature * Added Agent.GetSimulatorPosition() * Corrected default PrimFlags for agents and prims * Stubs for encoding/decoding prim linkset assets * Route chat through the scene * Stub for grid messaging (IM and email) * Add GetTerrainHeightAt(), removed duplicate heightmap storage in Movement.cs * Added a permissions manager stub * Store wind speeds, added functions to get wind speed * Make sure all of the important prim properties are set before creating an object * Lots of new object manipulation functions in scene * Properly clean up event queues on agent exit * Stubbed out a space for a scripting engine * Stubbed out task inventory * Added ScriptingConsole, which allows you to run LSL functions from the chat console * Added new PacketCategory, Messaging, for chat-related packets * Fixed InventoryObject overrides * Added a NotecardCache, useful for the scripting engine and may become generally useful later * Added several helper functions and new members to SimulationObject git-svn-id: http://libopenmetaverse.googlecode.com/svn/libopenmetaverse/trunk@2462 52acb1d6-8a22-11de-b505-999d5b087335
129 lines
3.8 KiB
C#
129 lines
3.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Net;
|
|
using System.Threading;
|
|
using OpenMetaverse;
|
|
using OpenMetaverse.Packets;
|
|
|
|
namespace Simian
|
|
{
|
|
public class Agent
|
|
{
|
|
// Account
|
|
public string FirstName;
|
|
public string LastName;
|
|
public string PasswordHash;
|
|
public uint CreationTime;
|
|
public uint LastLoginTime;
|
|
public string AccessLevel;
|
|
public int GodLevel;
|
|
public int Balance;
|
|
|
|
// Inventory
|
|
public UUID InventoryRoot;
|
|
public UUID InventoryLibraryRoot;
|
|
public UUID InventoryLibraryOwner;
|
|
|
|
// Location
|
|
public ulong HomeRegionHandle;
|
|
public Vector3 HomePosition;
|
|
public Vector3 HomeLookAt;
|
|
public Vector3 CurrentLookAt;
|
|
public ulong CurrentRegionHandle;
|
|
|
|
// Profile
|
|
public UUID PartnerID;
|
|
public int ProfileCanDo;
|
|
public int ProfileWantDo;
|
|
public string ProfileAboutText;
|
|
public string ProfileFirstText;
|
|
public string ProfileBornOn;
|
|
public string ProfileURL;
|
|
public UUID ProfileImage;
|
|
public UUID ProfileFirstImage;
|
|
public ProfileFlags ProfileFlags;
|
|
|
|
// Appearance
|
|
public byte[] VisualParams;
|
|
//public byte[] Texture;
|
|
public float Height;
|
|
public UUID ShapeItem;
|
|
public UUID SkinItem;
|
|
public UUID HairItem;
|
|
public UUID EyesItem;
|
|
public UUID ShirtItem;
|
|
public UUID PantsItem;
|
|
public UUID ShoesItem;
|
|
public UUID SocksItem;
|
|
public UUID JacketItem;
|
|
public UUID GlovesItem;
|
|
public UUID UndershirtItem;
|
|
public UUID UnderpantsItem;
|
|
public UUID SkirtItem;
|
|
|
|
// Temporary
|
|
[NonSerialized]
|
|
public Avatar Avatar = new Avatar();
|
|
[NonSerialized]
|
|
public UUID SessionID;
|
|
[NonSerialized]
|
|
public UUID SecureSessionID;
|
|
[NonSerialized]
|
|
public uint CircuitCode;
|
|
[NonSerialized]
|
|
public bool Running;
|
|
[NonSerialized]
|
|
public int TickFall;
|
|
[NonSerialized]
|
|
public int TickJump;
|
|
[NonSerialized]
|
|
public int TickLastPacketReceived;
|
|
[NonSerialized]
|
|
public AgentManager.ControlFlags ControlFlags = AgentManager.ControlFlags.NONE;
|
|
[NonSerialized]
|
|
public AnimationSet Animations = new AnimationSet();
|
|
[NonSerialized]
|
|
public PrimFlags Flags;
|
|
|
|
public string FullName
|
|
{
|
|
get
|
|
{
|
|
bool hasFirst = !String.IsNullOrEmpty(FirstName);
|
|
bool hasLast = !String.IsNullOrEmpty(LastName);
|
|
|
|
if (hasFirst && hasLast)
|
|
return String.Format("{0} {1}", FirstName, LastName);
|
|
else if (hasFirst)
|
|
return FirstName;
|
|
else if (hasLast)
|
|
return LastName;
|
|
else
|
|
return String.Empty;
|
|
}
|
|
}
|
|
|
|
public Vector3 GetSimulatorPosition(ISceneProvider scene)
|
|
{
|
|
SimulationObject parent;
|
|
Vector3 position = Avatar.Position;
|
|
|
|
if (Avatar.ParentID != 0 && scene.TryGetObject(Avatar.ParentID, out parent))
|
|
position += Vector3.Transform(parent.Prim.Position, Matrix4.CreateFromQuaternion(parent.Prim.Rotation));
|
|
|
|
return position;
|
|
}
|
|
|
|
public Quaternion GetSimulatorRotation(ISceneProvider scene)
|
|
{
|
|
SimulationObject parent;
|
|
Quaternion rotation = Avatar.Rotation;
|
|
|
|
if (Avatar.ParentID != 0 && scene.TryGetObject(Avatar.ParentID, out parent))
|
|
rotation *= parent.Prim.Rotation;
|
|
|
|
return rotation;
|
|
}
|
|
}
|
|
}
|