1: 2010-01-11 (月) 22:53:24 iseki |
2: 2010-01-11 (月) 23:36:54 iseki |
| *** llSetTerrain(int x, int y, double height) [#ndfa0172] | | *** llSetTerrain(int x, int y, double height) [#ndfa0172] |
| + | - 座標 (x, y) の標高を height にする関数. |
| - OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | | - OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs |
| public void llSetTerrain(int x, int y, double height) | | public void llSetTerrain(int x, int y, double height) |
| m_host.AddScriptLPS(1); | | m_host.AddScriptLPS(1); |
| | | |
- | World.Heightmap[x, y] = height; | + | //tm.SetHeightMap(x, y, height, m_host.OwnerID); //別解 |
- | ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>(); | + | |
- | if (tm != null) | + | if (World.Permissions.CanTerraformLand(m_host.OwnerID, new Vector3(x,y,0))) { |
- | { | + | World.Heightmap[x, y] = height; |
- | //tm.SetHeightMap(x, y, height); | + | ITerrainModule tm = m_ScriptEngine.World.RequestModuleInterface<ITerrainModule>(); |
- | tm.TaintTerrain(); | + | if (tm != null) |
| + | { |
| + | tm.TaintTerrain(); |
| + | } |
| } | | } |
| } | | } |
| + | - OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs |
| + | void llSetTerrain(int x, int y, double height); |
| + | - OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs |
| + | public void llSetTerrain(int x, int y, double height) |
| + | { |
| + | m_LSL_Functions.llSetTerrain(x, y, height); |
| + | } |
| + | |
| + | *** 別解:TerrainModule.cs に SetHeightMap() 関数を追加する場合 [#pc196495] |
| + | - 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; |
| + | CheckForTerrainUpdates(); |
| + | } |
| + | } |
| + | - OpenSim/Region/Framework/Interfaces/ITerrainModule.cs (インターフェイス) |
| + | void SetHeightMap(int x, int y, double height, UUID agentId) |