aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2018-12-21 15:51:12 +0000
committerUbitUmarov2018-12-21 15:51:12 +0000
commit3a20ccb4030b212279a204391976c23822bc1e99 (patch)
tree925c83ad4c016c8385367a51ec84a63d69e04de2
parentwarp3d: try handle planar mapping (diff)
downloadopensim-SC-3a20ccb4030b212279a204391976c23822bc1e99.zip
opensim-SC-3a20ccb4030b212279a204391976c23822bc1e99.tar.gz
opensim-SC-3a20ccb4030b212279a204391976c23822bc1e99.tar.bz2
opensim-SC-3a20ccb4030b212279a204391976c23822bc1e99.tar.xz
warp3d: add RenderMinHeight and RenderMaxHeight options, work on prims only for now
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs23
1 files changed, 21 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
index f1883b5..99cf121 100644
--- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
+++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs
@@ -66,6 +66,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
66#pragma warning disable 414 66#pragma warning disable 414
67 private static string LogHeader = "[WARP 3D IMAGE MODULE]"; 67 private static string LogHeader = "[WARP 3D IMAGE MODULE]";
68#pragma warning restore 414 68#pragma warning restore 414
69 private const float m_cameraHeight = 4096f;
69 70
70 internal Scene m_scene; 71 internal Scene m_scene;
71 private IRendering m_primMesher; 72 private IRendering m_primMesher;
@@ -82,6 +83,8 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
82 private bool m_texturePrims = true; // true if should texture the rendered prims 83 private bool m_texturePrims = true; // true if should texture the rendered prims
83 private float m_texturePrimSize = 48f; // size of prim before we consider texturing it 84 private float m_texturePrimSize = 48f; // size of prim before we consider texturing it
84 private bool m_renderMeshes = false; // true if to render meshes rather than just bounding boxes 85 private bool m_renderMeshes = false; // true if to render meshes rather than just bounding boxes
86 private float m_renderMinHeight = -100f;
87 private float m_renderMaxHeight = 4096f;
85 88
86 private bool m_Enabled = false; 89 private bool m_Enabled = false;
87 90
@@ -117,6 +120,18 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
117 m_renderMeshes = 120 m_renderMeshes =
118 Util.GetConfigVarFromSections<bool>(m_config, "RenderMeshes", configSections, m_renderMeshes); 121 Util.GetConfigVarFromSections<bool>(m_config, "RenderMeshes", configSections, m_renderMeshes);
119 122
123 m_renderMaxHeight = Util.GetConfigVarFromSections<float>(m_config, "RenderMaxHeight", configSections, m_renderMaxHeight);
124 m_renderMinHeight = Util.GetConfigVarFromSections<float>(m_config, "RenderMinHeight", configSections, m_renderMinHeight);
125
126 if (m_renderMaxHeight < 100f)
127 m_renderMaxHeight = 100f;
128 else if (m_renderMaxHeight > m_cameraHeight - 10f)
129 m_renderMaxHeight = m_cameraHeight - 10f;
130
131 if (m_renderMinHeight < -100f)
132 m_renderMinHeight = -100f;
133 else if (m_renderMinHeight > m_renderMaxHeight - 10f)
134 m_renderMinHeight = m_renderMaxHeight - 10f;
120 } 135 }
121 136
122 public void AddRegion(Scene scene) 137 public void AddRegion(Scene scene)
@@ -183,7 +198,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
183 cameraPos = new Vector3( 198 cameraPos = new Vector3(
184 (m_scene.RegionInfo.RegionSizeX) * 0.5f, 199 (m_scene.RegionInfo.RegionSizeX) * 0.5f,
185 (m_scene.RegionInfo.RegionSizeY) * 0.5f, 200 (m_scene.RegionInfo.RegionSizeY) * 0.5f,
186 4096f); 201 m_cameraHeight);
187 202
188 cameraDir = -Vector3.UnitZ; 203 cameraDir = -Vector3.UnitZ;
189 viewWitdh = (int)m_scene.RegionInfo.RegionSizeX; 204 viewWitdh = (int)m_scene.RegionInfo.RegionSizeX;
@@ -474,7 +489,11 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap
474 if ((PCode)prim.Shape.PCode != PCode.Prim) 489 if ((PCode)prim.Shape.PCode != PCode.Prim)
475 return; 490 return;
476 491
477 warp_Vector primPos = ConvertVector(prim.GetWorldPosition()); 492 Vector3 ppos = prim.GetWorldPosition();
493 if (ppos.Z < m_renderMinHeight || ppos.Z > m_renderMaxHeight)
494 return;
495
496 warp_Vector primPos = ConvertVector(ppos);
478 warp_Quaternion primRot = ConvertQuaternion(prim.GetWorldRotation()); 497 warp_Quaternion primRot = ConvertQuaternion(prim.GetWorldRotation());
479 warp_Matrix m = warp_Matrix.quaternionMatrix(primRot); 498 warp_Matrix m = warp_Matrix.quaternionMatrix(primRot);
480 499