obj.Shape = new PrimObject.ShapeBlock();
obj.Inventory = new PrimObject.InventoryBlock();
obj.AllowedDrop = true;
obj.PassTouches = false;
Vector3 offsetPosition = new Vector3();
Vector3 groupPosition = new Vector3();
NodeList nodeList = root.getChildNodes();
for(int i = 0; i < nodeList.getLength(); i++)
{
Node node = nodeList.item(i);
String nodeName = node.getNodeName();
if(node.getNodeType() == Node.ELEMENT_NODE)
{
if(nodeName.equals("AllowedDrop"))
{
obj.AllowedDrop = Boolean.parseBoolean(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equals("CreatorID"))
{
obj.CreatorID = ReadUUID(node);
}
else if(nodeName.equalsIgnoreCase("FolderID"))
{
obj.FolderID = ReadUUID(root);
}
else if(nodeName.equalsIgnoreCase("InventorySerial"))
{
String s = node.getFirstChild().getNodeValue().trim();
obj.Inventory.Serial = Integer.parseInt(s);
}
else if(nodeName.equalsIgnoreCase("TaskInventory"))
{
obj.Inventory.Items = ReadTaskInventoryItems(node);
}
else if(nodeName.equalsIgnoreCase("ObjectFlags"))
{
EnumSet<PrimFlags> flags = PrimFlags.get((long)Long.parseLong(node.getFirstChild().getNodeValue().trim()));
obj.UsePhysics = PrimFlags.and(flags , PrimFlags.Physics) != 0;
obj.Phantom = PrimFlags.and(flags , PrimFlags.Phantom) != 0;
obj.DieAtEdge = PrimFlags.and(flags , PrimFlags.DieAtEdge) != 0;
obj.ReturnAtEdge = PrimFlags.and(flags , PrimFlags.ReturnAtEdge) != 0;
obj.Temporary = PrimFlags.and(flags , PrimFlags.Temporary) != 0;
obj.Sandbox = PrimFlags.and(flags , PrimFlags.Sandbox) != 0;
}
else if(nodeName.equalsIgnoreCase("UUID"))
{
obj.ID = ReadUUID(node);
}
else if(nodeName.equalsIgnoreCase("LocalId"))
{
obj.LocalID = Long.parseLong(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equalsIgnoreCase("Name"))
{
obj.Name = node.getFirstChild().getNodeValue().trim();
}
else if(nodeName.equalsIgnoreCase("Material"))
{
obj.Material = Integer.parseInt(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equalsIgnoreCase("PassTouches"))
{
obj.PassTouches = Boolean.parseBoolean(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equalsIgnoreCase("RegionHandle"))
{
obj.RegionHandle = new BigInteger(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equalsIgnoreCase("ScriptAccessPin"))
{
obj.RemoteScriptAccessPIN = Integer.parseInt(node.getFirstChild().getNodeValue().trim());
}
else if(nodeName.equalsIgnoreCase("PlaySoundSlavePrims"))
{
//Discard
}
else if(nodeName.equalsIgnoreCase("LoopSoundSlavePrims"))
{
//Discard
}
else if(nodeName.equalsIgnoreCase("GroupPosition"))
{
groupPosition = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("OffsetPosition"))
{
offsetPosition = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("RotationOffset"))
{
obj.Rotation = ReadQuaternion(node);
}
else if(nodeName.equalsIgnoreCase("Velocity"))
{
obj.Velocity = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("RotationalVelocity"))
{
Vector3 rotationalVelocity = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("AngularVelocity"))
{
Vector3 AngularVelocity = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("Acceleration"))
{
Vector3 Acceleration = ReadVector(node);
}
else if(nodeName.equalsIgnoreCase("Description"))
{
obj.Description = node.getFirstChild().getNodeValue().trim();
}