flagflag  
2: 2010-01-11 (Mon) 23:36:54 iseki source Cur: 2010-01-21 (Thu) 02:31:13 iseki source
Line 1: Line 1:
-*** llSetTerrain(int x, int y, double height) [#ndfa0172] +*** llGroundSet(int x, int y, double height), llGroundUpdate() [#ndfa0172] 
-- 座標 (x, y) の標高を height にする関数.+**** OS Function に同じような osTerrainSetHeight(), osTerrainFlush() があった. [#fe17e745] 
 + 
 +- llGroundSet(): 座標 (x, y) の標高を height にする関数. 
 +- llGroundUpdate(): 変更した標高を適用させる.
- OpenSim/Region/ScriptEngine/Shared/Api/I​mplementation/LSL_Api.cs - OpenSim/Region/ScriptEngine/Shared/Api/I​mplementation/LSL_Api.cs
-       public void llSetTerrain(int x, int y, double height)+       // Fumi.Iseki 
 +       public void llGroundSet(int x, int y, double height)
       {        {
           m_host.AddScriptLPS(1);            m_host.AddScriptLPS(1);
- +  
-            //tm.SetHeightMap(x, y, height, m_host.OwnerID);    //別解 +           if (World.Permissions.CanTerraformLand(m_ho​st.OwnerID, new Vector3(x,y,0))) 
- +           { 
-           if (World.Permissions.CanTerraformLand(m_ho​st.OwnerID, new Vector3(x,y,0))) {+               if (x>=World.Heightmap.Width)  x = World.Heightmap.Width - 1; 
 +               else if (x<0) x = 0; 
 +               if (y>=World.Heightmap.Height) y = World.Heightmap.Height - 1; 
 +               else if (y<0) y = 0;
               World.Heightmap[x, y] = height;                World.Heightmap[x, y] = height;
-               ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterf​ace<ITerrainModule>(); 
-               if (tm != null) 
-               { 
-                   tm.TaintTerrain(); 
-               } 
           }            }
       }        }
-- OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_A​pi.cs +  
- void llSetTerrain(int x, int y, double height);+       // Fumi.Iseki 
 +        public void llGroundUpdate() 
 +       { 
 +           m_host.AddScriptLPS(1); 
 +  
 +           ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterf​ace<ITerrainModule>(); 
 +           if (tm != null) 
 +           { 
 +               tm.TaintTerrain(); 
 +           } 
 + ;       }
- OpenSim/Region/ScriptEngine/Shared/Api/R​untime/LSL_Stub.cs - OpenSim/Region/ScriptEngine/Shared/Api/R​untime/LSL_Stub.cs
-       public void llSetTerrain(int x, int y, double height)+       // Fumi.Iseki 
 +       public void llGroundSet(int x, int y, double height)
       {        {
-           m_LSL_Functions.llSetTerrain(x, y, height);+           m_LSL_Functions.llGroundSet(x, y, height);
       }        }
 + 
 +       // Fumi.Iseki
 +       public void llGroundUpdate()
 +       {
 +           m_LSL_Functions.llGroundUpdate();
 +       }
 +- OpenSim/Region/ScriptEngine/Shared/Api/I​nterface/ILSL_Api.cs
 + void llGroundSet(int x, int y, double height);
 + void llGroundUpdate();
*** 別解:TerrainModule.cs に SetHeightMap() 関数を追加する場合 [#pc196495] *** 別解:TerrainModule.cs に SetHeightMap() 関数を追加する場合 [#pc196495]
 +- OpenSim/Region/ScriptEngine編集/Shared/Api/Implementation/LSL_Api.cs
 +       // Fumi.Iseki
 +       public void llGroundSet(int x, int y, double height)
 +       {
 +           m_host.AddScriptLPS(1);
 + 
 +           if (World.Permissions.CanTerraformLand(m_ho​st.OwnerID, new Vector3(x,y,0)))
 +           {
 +               ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterf​ace<ITerrainModule>();
 +               if (tm != null)
 +               {
 +                   if (x>=World.Heightmap.Width)  x = World.Heightmap.Width - 1;
 +                   else if (x<0) x = 0;
 +                   if (y>=World.Heightmap.Height) y = World.Heightmap.Height - 1;
 +                   else if (y<0) y = 0;
 +                   tm.SetHeightMap(x, y, height, m_host.OwnerID);
 +               }
 +           }
 +       }
- OpenSim/Region/CoreModules/World/Terrain​/TerrainModule.cs - OpenSim/Region/CoreModules/World/Terrain​/TerrainModule.cs
 public void SetHeightMap(int x, int y, double height, UUID agentId)  public void SetHeightMap(int x, int y, double height, UUID agentId)
 {  {
-     if (m_scene.Permissions.CanTerraformLand(ag​entId, new Vector3(x,y,0))) {+     if (m_scene.Permissions.CanTerraformLand(ag​entId, new Vector3(x,y,0))) 
 +     {
         m_channel[x, y] = height;          m_channel[x, y] = height;
-         CheckForTerrainUpdates(); 
     }      }
  }   }
 +-- チェックが2重だな
 +
- OpenSim/Region/Framework/Interfaces/ITer​rainModule.cs  (インターフェイス) - OpenSim/Region/Framework/Interfaces/ITer​rainModule.cs  (インターフェイス)
 void SetHeightMap(int x, int y, double height, UUID agentId)  void SetHeightMap(int x, int y, double height, UUID agentId)


Front page   New List of Pages Search Recent changes   Help   RSS of recent changes (RSS 1.0) RSS of recent changes (RSS 2.0) RSS of recent changes (RSS Atom)

Site Search

Login

Username:

Password:


Lost Password?
Register now!!

Sub Menu

mini Calendar

Last MonthJun 2024Next Month
Su Mo Tu We Th Fr Sa
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30
Today

Who's Online

31 user(s) are online (3 user(s) are browsing xpwiki)

Members: 0
Guests: 31

more...

Access Counter

Today : 6391639163916391
Yesterday : 5272527252725272
Total : 2374543023745430237454302374543023745430237454302374543023745430
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com