aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2018-05-08 16:58:15 +0100
committerUbitUmarov2018-05-08 16:58:15 +0100
commitcf1ea3b093b96bc306c569dc73e70be220e02b4f (patch)
tree9719a275c8a78aa87f92142a647326c99c1904c8
parentbreaking map (warp3d)... (diff)
downloadopensim-SC-cf1ea3b093b96bc306c569dc73e70be220e02b4f.zip
opensim-SC-cf1ea3b093b96bc306c569dc73e70be220e02b4f.tar.gz
opensim-SC-cf1ea3b093b96bc306c569dc73e70be220e02b4f.tar.bz2
opensim-SC-cf1ea3b093b96bc306c569dc73e70be220e02b4f.tar.xz
breaking map (warp3d) suport default map parameters. Planar not suported ( will render as deafaul
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs81
1 files changed, 66 insertions, 15 deletions
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
index e0e851f..4c0023c 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
@@ -490,13 +490,73 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
490 continue; 490 continue;
491 491
492 warp_Object faceObj = new warp_Object(); 492 warp_Object faceObj = new warp_Object();
493 for (int j = 0; j < face.Vertices.Count; j++) 493
494 Primitive.TextureEntryFace teFace = prim.Shape.Textures.GetFace((uint)i);
495 Color4 faceColor = teFace.RGBA;
496
497 string materialName = String.Empty;
498 if (m_texturePrims && primScaleLenSquared > m_texturePrimSize*m_texturePrimSize)
499 materialName = GetOrCreateMaterial(renderer, faceColor, teFace.TextureID);
500 else
501 materialName = GetOrCreateMaterial(renderer, GetFaceColor(teFace));
502
503 if(renderer.Scene.material(materialName).getTexture() == null)
494 { 504 {
495 Vertex v = face.Vertices[j]; 505 for (int j = 0; j < face.Vertices.Count; j++)
496 warp_Vector pos = ConvertVector(v.Position); 506 {
497 warp_Vertex vert = new warp_Vertex(pos, v.TexCoord.X, 1.0f - v.TexCoord.Y); 507 Vertex v = face.Vertices[j];
498 faceObj.addVertex(vert); 508 warp_Vector pos = ConvertVector(v.Position);
499 } 509 warp_Vertex vert = new warp_Vertex(pos, v.TexCoord.X, 1.0f - v.TexCoord.Y);
510 faceObj.addVertex(vert);
511 }
512 }
513 else
514 {
515 float tu;
516 float tv;
517 float offsetu = teFace.OffsetU + 0.5f;
518 float offsetv = teFace.OffsetV + 0.5f;
519 float scaleu = teFace.RepeatU;
520 float scalev = teFace.RepeatV;
521 float rotation = teFace.Rotation;
522 float rc = 0;
523 float rs = 0;
524 if(rotation != 0)
525 {
526 rc = (float)Math.Cos(rotation);
527 rs = (float)Math.Sin(rotation);
528 }
529
530 for (int j = 0; j < face.Vertices.Count; j++)
531 {
532 warp_Vertex vert;
533 Vertex v = face.Vertices[j];
534 warp_Vector pos = ConvertVector(v.Position);
535 tu = v.TexCoord.X - 0.5f;
536 tv = 0.5f - v.TexCoord.Y;
537 if(rotation != 0)
538 {
539 float tur = tu * rc - tv * rs;
540 float tvr = tu * rs + tv * rc;
541 tur *= scaleu;
542 tur += offsetu;
543
544 tvr *= scalev;
545 tvr += offsetv;
546 vert = new warp_Vertex(pos, tur, tvr);
547 }
548 else
549 {
550 tu *= scaleu;
551 tu += offsetu;
552 tv *= scalev;
553 tv += offsetv;
554 vert = new warp_Vertex(pos, tu, tv);
555 }
556
557 faceObj.addVertex(vert);
558 }
559 }
500 560
501 for (int j = 0; j < face.Indices.Count; j += 3) 561 for (int j = 0; j < face.Indices.Count; j += 3)
502 { 562 {
@@ -506,15 +566,6 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
506 face.Indices[j + 2]); 566 face.Indices[j + 2]);
507 } 567 }
508 568
509 Primitive.TextureEntryFace teFace = prim.Shape.Textures.GetFace((uint)i);
510 Color4 faceColor = teFace.RGBA;
511 string materialName = String.Empty;
512
513 if (m_texturePrims && primScaleLenSquared > m_texturePrimSize*m_texturePrimSize)
514 materialName = GetOrCreateMaterial(renderer, faceColor, teFace.TextureID);
515 else
516 materialName = GetOrCreateMaterial(renderer, GetFaceColor(teFace));
517
518 faceObj.scaleSelf(prim.Scale.X, prim.Scale.Z, prim.Scale.Y); 569 faceObj.scaleSelf(prim.Scale.X, prim.Scale.Z, prim.Scale.Y);
519 faceObj.transform(m); 570 faceObj.transform(m);
520 faceObj.setPos(primPos); 571 faceObj.setPos(primPos);