flagflag  If you want to see English page, please click "English" Button at Left.

llGroundSet(int x, int y, double height), llGroundUpdate() anchor.png

Page Top
OS Function に同じような osTerrainSetHeight(), osTerrainFlush() があった. anchor.png
  • llGroundSet(): 座標 (x, y) の標高を height にする関数.
  • llGroundUpdate(): 変更した標高を適用させる.
  • OpenSim/Region/ScriptEngine/Shared/Api/I​mplementation/LSL_Api.cs
           // Fumi.Iseki
           public void llGroundSet(int x, int y, double height)
           {       
               m_host.AddScriptLPS(1);
                   
               if (World.Permissions.CanTerraformLand(m_host.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;
               }
           }   
               
           // Fumi.Iseki
           public void llGroundUpdate()
           {   
               m_host.AddScriptLPS(1);
    
               ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>();
               if (tm != null)
               {
                   tm.TaintTerrain();
               }
           }
  • OpenSim/Region/ScriptEngine/Shared/Api/R​untime/LSL_Stub.cs
           // Fumi.Iseki
           public void llGroundSet(int x, int y, double 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();
Page Top

別解:TerrainModule.cs に SetHeightMap() 関数を追加する場合 anchor.png

  • 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_host.OwnerID, new Vector3(x,y,0)))
               {
                   ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<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
    public void SetHeightMap(int x, int y, double height, UUID agentId)
    {
        if (m_scene.Permissions.CanTerraformLand(agentId, new Vector3(x,y,0)))
        {
            m_channel[x, y] = height;
        }
     }
    • チェックが2重だな
  • OpenSim/Region/Framework/Interfaces/ITer​rainModule.cs  (インターフェイス)
    void SetHeightMap(int x, int y, double height, UUID agentId)

トップ   凍結 差分 バックアップ 複製 名前変更 リロード   新規 ページ一覧 単語検索 最終更新   ヘルプ   最終更新のRSS 1.0 最終更新のRSS 2.0 最終更新のRSS Atom
Counter: 1598, today: 3, yesterday: 0
最終更新: 2010-01-21 (木) 02:31:13 (JST) (5181d) by iseki

サイト内 検索

ログイン

ユーザー名:

パスワード:


パスワード紛失
新規登録

サブ メニュー

ミニカレンダー

前月2024年 3月翌月
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
31
<今日>

オンライン状況

84 人のユーザが現在オンラインです。 (10 人のユーザが xpwiki を参照しています。)

登録ユーザ: 0
ゲスト: 84

もっと...

アクセスカウンタ

今日 : 1295412954129541295412954
昨日 : 6869686968696869
総計 : 2318723723187237231872372318723723187237231872372318723723187237
Powered by XOOPS Cube 2.1© 2001-2006 XOOPS Cube Project
Design by XoopsDesign.com