LSL update texture entry is heavy, set all parameters on same update

0.9.1.0-post-fixes
UbitUmarov 2019-03-19 21:37:58 +00:00
parent af35882eda
commit fe6317f009
3 changed files with 60 additions and 12 deletions

View File

@ -2338,10 +2338,7 @@ namespace OpenSim.Region.Framework.Scenes
{
ParentGroup.Scene.RemovePhysicalPrim(1);
Velocity = new Vector3(0, 0, 0);
Acceleration = new Vector3(0, 0, 0);
AngularVelocity = new Vector3(0, 0, 0);
APIDActive = false;
Stop();
if (pa.Phantom && !VolumeDetectActive)
{
@ -4730,14 +4727,13 @@ namespace OpenSim.Region.Framework.Scenes
if ((SetPhantom && !UsePhysics && !SetVD) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none
|| (Shape.PathCurve == (byte)Extrusion.Flexible))
{
Stop();
if (pa != null)
{
if(wasUsingPhysics)
ParentGroup.Scene.RemovePhysicalPrim(1);
RemoveFromPhysics();
}
Stop();
}
else

View File

@ -2403,6 +2403,62 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
ScriptSleep(m_sleepMsOnSetLinkTexture);
}
protected void SetTextureParams(SceneObjectPart part, string texture, double scaleU, double ScaleV,
double offsetU, double offsetV, double rotation, int face)
{
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
return;
UUID textureID = new UUID();
textureID = ScriptUtils.GetAssetIdFromItemName(m_host, texture, (int)AssetType.Texture);
if (textureID == UUID.Zero)
{
if (!UUID.TryParse(texture, out textureID))
return;
}
Primitive.TextureEntry tex = part.Shape.Textures;
int nsides = GetNumberOfSides(part);
if (face >= 0 && face < nsides)
{
Primitive.TextureEntryFace texface = tex.CreateFace((uint)face);
texface.TextureID = textureID;
texface.RepeatU = (float)scaleU;
texface.RepeatV = (float)ScaleV;
texface.OffsetU = (float)offsetU;
texface.OffsetV = (float)offsetV;
texface.Rotation = (float)rotation;
tex.FaceTextures[face] = texface;
part.UpdateTextureEntry(tex);
return;
}
else if (face == ScriptBaseClass.ALL_SIDES)
{
for (uint i = 0; i < nsides; i++)
{
if (tex.FaceTextures[i] != null)
{
tex.FaceTextures[i].TextureID = textureID;
tex.FaceTextures[i].RepeatU = (float)scaleU;
tex.FaceTextures[i].RepeatV = (float)ScaleV;
tex.FaceTextures[i].OffsetU = (float)offsetU;
tex.FaceTextures[i].OffsetV = (float)offsetV;
tex.FaceTextures[i].Rotation = (float)rotation;
}
}
tex.DefaultTexture.TextureID = textureID;
tex.DefaultTexture.RepeatU = (float)scaleU;
tex.DefaultTexture.RepeatV = (float)ScaleV;
tex.DefaultTexture.OffsetU = (float)offsetU;
tex.DefaultTexture.OffsetV = (float)offsetV;
tex.DefaultTexture.Rotation = (float)rotation;
part.UpdateTextureEntry(tex);
return;
}
}
protected void SetTexture(SceneObjectPart part, string texture, int face)
{
if (part == null || part.ParentGroup == null || part.ParentGroup.IsDeleted)
@ -9728,11 +9784,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
return new LSL_List();
}
SetTexture(part, tex, face);
ScaleTexture(part, repeats.x, repeats.y, face);
OffsetTexture(part, offsets.x, offsets.y, face);
RotateTexture(part, rotation, face);
SetTextureParams(part, tex, repeats.x, repeats.y, offsets.x, offsets.y, rotation, face);
break;
case ScriptBaseClass.PRIM_COLOR:

View File

@ -454,7 +454,7 @@
; warp3D rendering height limits for prims (relative to rez position not bounding box)
; prims above RenderMaxHeight are excluded
; valid values: 100 t0 4086
; valid values: 100 to 4086
;RenderMaxHeight = 4086
; prims below RenderMinHeight are excluded