* Fixed multiple light parameter parsing bugs, added LightData.Intensity (resolving issue #45 by timhart)
* Removed the useless Avatar.Online variable * Adding the beginnings of appearance and animation tracking for avatars * Updated PrimInfo command to show light data git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@1514 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -228,8 +228,6 @@ namespace libsecondlife
|
||||
|
||||
/// <summary>Groups that this avatar is a member of</summary>
|
||||
public List<LLUUID> Groups = new List<LLUUID>();
|
||||
/// <summary>Online status</summary>
|
||||
public bool Online = false;
|
||||
/// <summary>Positive and negative ratings</summary>
|
||||
public Statistics ProfileStatistics = new Statistics();
|
||||
/// <summary>Avatar properties including about text, profile URL, image IDs and
|
||||
|
||||
@@ -1557,8 +1557,7 @@ namespace libsecondlife
|
||||
|
||||
SetAvatarSittingOn(simulator, avatar, block.ParentID, oldSeatID);
|
||||
|
||||
// Set this avatar online and in a region
|
||||
avatar.Online = true;
|
||||
// Set the current simulator for this avatar
|
||||
avatar.CurrentSim = simulator;
|
||||
|
||||
// Textures
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace libsecondlife
|
||||
public ParticleSystem(byte[] data, int pos)
|
||||
{
|
||||
// TODO: Not sure exactly how many bytes we need here, so partial
|
||||
// (but truncated) data will cause an exception to be thrown
|
||||
// (truncated) data will cause an exception to be thrown
|
||||
if (data.Length > 0)
|
||||
{
|
||||
BitPack pack = new BitPack(data, pos);
|
||||
|
||||
@@ -267,6 +267,8 @@ namespace libsecondlife
|
||||
/// <summary></summary>
|
||||
public LLColor Color;
|
||||
/// <summary></summary>
|
||||
public float Intensity;
|
||||
/// <summary></summary>
|
||||
public float Radius;
|
||||
/// <summary></summary>
|
||||
public float Cutoff;
|
||||
@@ -280,19 +282,24 @@ namespace libsecondlife
|
||||
/// <param name="pos"></param>
|
||||
public LightData(byte[] data, int pos)
|
||||
{
|
||||
if (data.Length >= 16)
|
||||
if (data.Length - pos >= 16)
|
||||
{
|
||||
Color = new LLColor(data, 0, false);
|
||||
Radius = Helpers.BytesToFloat(data, 4);
|
||||
Cutoff = Helpers.BytesToFloat(data, 8);
|
||||
Falloff = Helpers.BytesToFloat(data, 12);
|
||||
Color = new LLColor(data, pos, false);
|
||||
Radius = Helpers.BytesToFloat(data, pos + 4);
|
||||
Cutoff = Helpers.BytesToFloat(data, pos + 8);
|
||||
Falloff = Helpers.BytesToFloat(data, pos + 12);
|
||||
|
||||
// Alpha in color is actually intensity
|
||||
Intensity = Color.A;
|
||||
Color.A = 1f;
|
||||
}
|
||||
else
|
||||
{
|
||||
Color = LLColor.Black;
|
||||
Radius = 0.0f;
|
||||
Cutoff = 0.0f;
|
||||
Falloff = 0.0f;
|
||||
Radius = 0f;
|
||||
Cutoff = 0f;
|
||||
Falloff = 0f;
|
||||
Intensity = 0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,13 +311,26 @@ namespace libsecondlife
|
||||
{
|
||||
byte[] data = new byte[16];
|
||||
|
||||
Color.GetBytes().CopyTo(data, 0);
|
||||
// Alpha channel in color is intensity
|
||||
LLColor tmpColor = Color;
|
||||
tmpColor.A = Intensity;
|
||||
tmpColor.GetBytes().CopyTo(data, 0);
|
||||
Helpers.FloatToBytes(Radius).CopyTo(data, 4);
|
||||
Helpers.FloatToBytes(Cutoff).CopyTo(data, 8);
|
||||
Helpers.FloatToBytes(Falloff).CopyTo(data, 12);
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public override string ToString()
|
||||
{
|
||||
return String.Format("Color: {0} Intensity: {1} Radius: {2} Cutoff: {3} Falloff: {4}",
|
||||
Color, Intensity, Radius, Cutoff, Falloff);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -21,14 +21,16 @@ namespace libsecondlife.TestClient
|
||||
if (LLUUID.TryParse(args[0], out primID))
|
||||
{
|
||||
Primitive target = Client.Network.CurrentSim.Objects.Find(
|
||||
delegate(Primitive prim)
|
||||
{
|
||||
return prim.ID == primID;
|
||||
}
|
||||
delegate(Primitive prim) { return prim.ID == primID; }
|
||||
);
|
||||
|
||||
if (target != null)
|
||||
{
|
||||
Client.Log("Light: " + target.Light.ToString(), Helpers.LogLevel.Info);
|
||||
|
||||
if (target.ParticleSys.CRC != 0)
|
||||
Client.Log("Particles: " + target.ParticleSys.ToString(), Helpers.LogLevel.Info);
|
||||
|
||||
Client.Log("TextureEntry:", Helpers.LogLevel.Info);
|
||||
if (target.Textures != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user