public UUID SculptID;
public EnumsPrimitive.SculptType SculptType;
public OSDMap Serialize()
{
OSDMap map = new OSDMap();
map.put("group-id", OSD.FromUUID(GroupID));
map.put("material", OSD.FromInteger((int)Material.getIndex()));
map.put("name", OSD.FromString(Name));
map.put("pos", OSD.FromVector3(Position));
map.put("rotation", OSD.FromQuaternion(Rotation));
map.put("scale", OSD.FromVector3(Scale));
// Extra params
OSDArray extraParams = new OSDArray();
if (ExtraParams != null)
{
for (int i = 0; i < ExtraParams.length; i++)
extraParams.add(ExtraParams[i].Serialize());
}
map.put("extra_parameters", extraParams);
// Faces
OSDArray faces = new OSDArray();
if (Faces != null)
{
for (int i = 0; i < Faces.length; i++)
faces.add(Faces[i].Serialize());
}
map.put("facelist", faces);
// Shape
OSDMap shape = new OSDMap();
OSDMap path = new OSDMap();
path.put("begin", OSD.FromReal(PathBegin));
path.put("curve", OSD.FromInteger(PathCurve));
path.put("end", OSD.FromReal(PathEnd));
path.put("radius_offset", OSD.FromReal(RadiusOffset));
path.put("revolutions", OSD.FromReal(Revolutions));
path.put("scale_x", OSD.FromReal(ScaleX));
path.put("scale_y", OSD.FromReal(ScaleY));
path.put("shear_x", OSD.FromReal(ShearX));
path.put("shear_y", OSD.FromReal(ShearY));
path.put("skew", OSD.FromReal(Skew));
path.put("taper_x", OSD.FromReal(TaperX));
path.put("taper_y", OSD.FromReal(TaperY));
path.put("twist", OSD.FromReal(Twist));
path.put("twist_begin", OSD.FromReal(TwistBegin));
shape.put("path", path);
OSDMap profile = new OSDMap();
profile.put("begin", OSD.FromReal(ProfileBegin));
profile.put("curve", OSD.FromInteger(ProfileCurve));
profile.put("end", OSD.FromReal(ProfileEnd));
profile.put("hollow", OSD.FromReal(ProfileHollow));
shape.put("profile", profile);
OSDMap sculpt = new OSDMap();
sculpt.put("id", OSD.FromUUID(SculptID));
sculpt.put("type", OSD.FromInteger((int)SculptType.getIndex()));
shape.put("sculpt", sculpt);
map.put("shape", shape);
return map;
}