Simian: Added support for prim texturing
git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@2255 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -502,6 +502,16 @@ namespace Simian.Extensions
|
||||
|
||||
void ObjectImageHandler(Packet packet, Agent agent)
|
||||
{
|
||||
ObjectImagePacket image = (ObjectImagePacket)packet;
|
||||
|
||||
for (int i = 0; i < image.ObjectData.Length; i++)
|
||||
{
|
||||
SimulationObject obj;
|
||||
if (Server.Scene.TryGetObject(image.ObjectData[i].ObjectLocalID, out obj))
|
||||
Server.Scene.ObjectImage(this, obj,
|
||||
Utils.BytesToString(image.ObjectData[i].MediaURL),
|
||||
new Primitive.TextureEntry(image.ObjectData[i].TextureEntry, 0, image.ObjectData[i].TextureEntry.Length));
|
||||
}
|
||||
}
|
||||
|
||||
void DeRezObjectHandler(Packet packet, Agent agent)
|
||||
|
||||
@@ -22,6 +22,7 @@ namespace Simian.Extensions
|
||||
public event ObjectRemoveCallback OnObjectRemove;
|
||||
public event ObjectTransformCallback OnObjectTransform;
|
||||
public event ObjectFlagsCallback OnObjectFlags;
|
||||
public event ObjectImageCallback OnObjectImage;
|
||||
public event ObjectModifyCallback OnObjectModify;
|
||||
public event TerrainUpdatedCallback OnTerrainUpdated;
|
||||
|
||||
@@ -149,6 +150,21 @@ namespace Simian.Extensions
|
||||
BroadcastObjectUpdate(obj);
|
||||
}
|
||||
|
||||
public void ObjectImage(object sender, SimulationObject obj, string mediaURL, Primitive.TextureEntry textureEntry)
|
||||
{
|
||||
if (OnObjectImage != null)
|
||||
{
|
||||
OnObjectImage(sender, obj, mediaURL, textureEntry);
|
||||
}
|
||||
|
||||
// Update the object
|
||||
obj.Prim.Textures = textureEntry;
|
||||
obj.Prim.MediaURL = mediaURL;
|
||||
|
||||
// Inform clients
|
||||
BroadcastObjectUpdate(obj);
|
||||
}
|
||||
|
||||
public void ObjectModify(object sender, SimulationObject obj, Primitive.ConstructionData data)
|
||||
{
|
||||
if (OnObjectModify != null)
|
||||
|
||||
@@ -9,6 +9,8 @@ namespace Simian
|
||||
Vector3 position, Quaternion rotation, Vector3 velocity, Vector3 acceleration,
|
||||
Vector3 angularVelocity, Vector3 scale);
|
||||
public delegate void ObjectFlagsCallback(object sender, SimulationObject obj, PrimFlags flags);
|
||||
public delegate void ObjectImageCallback(object sender, SimulationObject obj,
|
||||
string mediaURL, Primitive.TextureEntry textureEntry);
|
||||
public delegate void ObjectModifyCallback(object sender, SimulationObject obj,
|
||||
Primitive.ConstructionData data);
|
||||
// TODO: Convert terrain to a patch-based system
|
||||
@@ -34,6 +36,7 @@ namespace Simian
|
||||
Quaternion rotation, Vector3 velocity, Vector3 acceleration,
|
||||
Vector3 angularVelocity, Vector3 scale);
|
||||
void ObjectFlags(object sender, SimulationObject obj, PrimFlags flags);
|
||||
void ObjectImage(object sender, SimulationObject obj, string mediaURL, Primitive.TextureEntry textureEntry);
|
||||
void ObjectModify(object sender, SimulationObject obj, Primitive.ConstructionData data);
|
||||
bool TryGetObject(uint localID, out SimulationObject obj);
|
||||
bool TryGetObject(UUID id, out SimulationObject obj);
|
||||
|
||||
Reference in New Issue
Block a user