diff options
author | Melanie | 2010-10-06 05:45:29 +0100 |
---|---|---|
committer | Melanie | 2010-10-06 05:45:29 +0100 |
commit | ca50f6a82cb7c5385ebfa633a5cf1672a6415b95 (patch) | |
tree | 795b9d2c93dc2e92bfa7366d1af391bb76d4971d /OpenSim/Region | |
parent | Convert worldview to GET (diff) | |
parent | Add and plumb the usetex URL parameter to worldview. Required but not yet (diff) | |
download | opensim-SC-ca50f6a82cb7c5385ebfa633a5cf1672a6415b95.zip opensim-SC-ca50f6a82cb7c5385ebfa633a5cf1672a6415b95.tar.gz opensim-SC-ca50f6a82cb7c5385ebfa633a5cf1672a6415b95.tar.bz2 opensim-SC-ca50f6a82cb7c5385ebfa633a5cf1672a6415b95.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
5 files changed, 20 insertions, 14 deletions
diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index c9ef1f4..f86c790 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs | |||
@@ -560,7 +560,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap | |||
560 | return returnpt; | 560 | return returnpt; |
561 | } | 561 | } |
562 | 562 | ||
563 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height) | 563 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) |
564 | { | 564 | { |
565 | return null; | 565 | return null; |
566 | } | 566 | } |
diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs index eca85d3..00b506e 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/MapImageModule.cs | |||
@@ -128,16 +128,16 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
128 | { | 128 | { |
129 | Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); | 129 | Vector3 camPos = new Vector3(127.5f, 127.5f, 221.7025033688163f); |
130 | Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); | 130 | Viewport viewport = new Viewport(camPos, -Vector3.UnitZ, 1024f, 0.1f, (int)Constants.RegionSize, (int)Constants.RegionSize, (float)Constants.RegionSize, (float)Constants.RegionSize); |
131 | return CreateMapTile(viewport); | 131 | return CreateMapTile(viewport, false); |
132 | } | 132 | } |
133 | 133 | ||
134 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height) | 134 | public Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures) |
135 | { | 135 | { |
136 | Viewport viewport = new Viewport(camPos, camDir, fov, (float)Constants.RegionSize, 0.1f, width, height); | 136 | Viewport viewport = new Viewport(camPos, camDir, fov, (float)Constants.RegionSize, 0.1f, width, height); |
137 | return CreateMapTile(viewport); | 137 | return CreateMapTile(viewport, useTextures); |
138 | } | 138 | } |
139 | 139 | ||
140 | public Bitmap CreateMapTile(Viewport viewport) | 140 | public Bitmap CreateMapTile(Viewport viewport, bool useTextures) |
141 | { | 141 | { |
142 | bool drawPrimVolume = true; | 142 | bool drawPrimVolume = true; |
143 | bool textureTerrain = true; | 143 | bool textureTerrain = true; |
@@ -198,7 +198,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
198 | CreateWater(renderer); | 198 | CreateWater(renderer); |
199 | CreateTerrain(renderer, textureTerrain); | 199 | CreateTerrain(renderer, textureTerrain); |
200 | if (drawPrimVolume) | 200 | if (drawPrimVolume) |
201 | CreateAllPrims(renderer); | 201 | CreateAllPrims(renderer, useTextures); |
202 | 202 | ||
203 | renderer.Render(); | 203 | renderer.Render(); |
204 | Bitmap bitmap = renderer.Scene.getImage(); | 204 | Bitmap bitmap = renderer.Scene.getImage(); |
@@ -325,7 +325,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
325 | renderer.SetObjectMaterial("Terrain", "TerrainColor"); | 325 | renderer.SetObjectMaterial("Terrain", "TerrainColor"); |
326 | } | 326 | } |
327 | 327 | ||
328 | private void CreateAllPrims(WarpRenderer renderer) | 328 | private void CreateAllPrims(WarpRenderer renderer, bool useTextures) |
329 | { | 329 | { |
330 | if (m_primMesher == null) | 330 | if (m_primMesher == null) |
331 | return; | 331 | return; |
@@ -333,14 +333,15 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
333 | m_scene.ForEachSOG( | 333 | m_scene.ForEachSOG( |
334 | delegate(SceneObjectGroup group) | 334 | delegate(SceneObjectGroup group) |
335 | { | 335 | { |
336 | CreatePrim(renderer, group.RootPart); | 336 | CreatePrim(renderer, group.RootPart, useTextures); |
337 | foreach (SceneObjectPart child in group.Parts) | 337 | foreach (SceneObjectPart child in group.Parts) |
338 | CreatePrim(renderer, child); | 338 | CreatePrim(renderer, child, useTextures); |
339 | } | 339 | } |
340 | ); | 340 | ); |
341 | } | 341 | } |
342 | 342 | ||
343 | private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim) | 343 | private void CreatePrim(WarpRenderer renderer, SceneObjectPart prim, |
344 | bool useTextures) | ||
344 | { | 345 | { |
345 | const float MIN_SIZE = 2f; | 346 | const float MIN_SIZE = 2f; |
346 | 347 | ||
@@ -371,6 +372,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap | |||
371 | string primID = prim.UUID.ToString(); | 372 | string primID = prim.UUID.ToString(); |
372 | 373 | ||
373 | // Create the prim faces | 374 | // Create the prim faces |
375 | // TODO: Implement the useTextures flag behavior | ||
374 | for (int i = 0; i < renderMesh.Faces.Count; i++) | 376 | for (int i = 0; i < renderMesh.Faces.Count; i++) |
375 | { | 377 | { |
376 | Face face = renderMesh.Faces[i]; | 378 | Face face = renderMesh.Faces[i]; |
diff --git a/OpenSim/Region/Framework/Interfaces/ITerrain.cs b/OpenSim/Region/Framework/Interfaces/ITerrain.cs index 38cf020..815a2d8 100644 --- a/OpenSim/Region/Framework/Interfaces/ITerrain.cs +++ b/OpenSim/Region/Framework/Interfaces/ITerrain.cs | |||
@@ -75,7 +75,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
75 | public interface IMapImageGenerator | 75 | public interface IMapImageGenerator |
76 | { | 76 | { |
77 | System.Drawing.Bitmap CreateMapTile(); | 77 | System.Drawing.Bitmap CreateMapTile(); |
78 | System.Drawing.Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height); | 78 | System.Drawing.Bitmap CreateViewImage(Vector3 camPos, Vector3 camDir, float fov, int width, int height, bool useTextures); |
79 | byte[] WriteJpeg2000Image(); | 79 | byte[] WriteJpeg2000Image(); |
80 | } | 80 | } |
81 | } | 81 | } |
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs index 55be9ba..d4b7020 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewModule.cs | |||
@@ -104,13 +104,13 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
104 | } | 104 | } |
105 | 105 | ||
106 | public byte[] GenerateWorldView(Vector3 pos, Vector3 rot, float fov, | 106 | public byte[] GenerateWorldView(Vector3 pos, Vector3 rot, float fov, |
107 | int width, int height) | 107 | int width, int height, bool usetex) |
108 | { | 108 | { |
109 | if (!m_Enabled) | 109 | if (!m_Enabled) |
110 | return new Byte[0]; | 110 | return new Byte[0]; |
111 | 111 | ||
112 | Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, | 112 | Bitmap bmp = m_Generator.CreateViewImage(pos, rot, fov, width, |
113 | height); | 113 | height, usetex); |
114 | 114 | ||
115 | MemoryStream str = new MemoryStream(); | 115 | MemoryStream str = new MemoryStream(); |
116 | 116 | ||
diff --git a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs index bfdcdb4..f47d9c7 100644 --- a/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs +++ b/OpenSim/Region/OptionalModules/World/WorldView/WorldViewRequestHandler.cs | |||
@@ -96,6 +96,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
96 | float fov; | 96 | float fov; |
97 | int width; | 97 | int width; |
98 | int height; | 98 | int height; |
99 | bool usetex; | ||
99 | 100 | ||
100 | if (!request.ContainsKey("posX")) | 101 | if (!request.ContainsKey("posX")) |
101 | return new Byte[0]; | 102 | return new Byte[0]; |
@@ -115,6 +116,8 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
115 | return new Byte[0]; | 116 | return new Byte[0]; |
116 | if (!request.ContainsKey("height")) | 117 | if (!request.ContainsKey("height")) |
117 | return new Byte[0]; | 118 | return new Byte[0]; |
119 | if (!request.ContainsKey("usetex")) | ||
120 | return new Byte[0]; | ||
118 | 121 | ||
119 | try | 122 | try |
120 | { | 123 | { |
@@ -127,6 +130,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
127 | fov = Convert.ToSingle(request["fov"]); | 130 | fov = Convert.ToSingle(request["fov"]); |
128 | width = Convert.ToInt32(request["width"]); | 131 | width = Convert.ToInt32(request["width"]); |
129 | height = Convert.ToInt32(request["height"]); | 132 | height = Convert.ToInt32(request["height"]); |
133 | usetex = Convert.ToBoolean(request["usetex"]); | ||
130 | } | 134 | } |
131 | catch | 135 | catch |
132 | { | 136 | { |
@@ -137,7 +141,7 @@ namespace OpenSim.Region.OptionalModules.World.WorldView | |||
137 | Vector3 rot = new Vector3(rotX, rotY, rotZ); | 141 | Vector3 rot = new Vector3(rotX, rotY, rotZ); |
138 | 142 | ||
139 | return m_WorldViewModule.GenerateWorldView(pos, rot, fov, width, | 143 | return m_WorldViewModule.GenerateWorldView(pos, rot, fov, width, |
140 | height); | 144 | height, usetex); |
141 | } | 145 | } |
142 | } | 146 | } |
143 | } | 147 | } |