| 510 |
|
|
| 511 |
private void CheckAndApplyParent(int pObjects) |
private void CheckAndApplyParent(int pObjects) |
| 512 |
{ |
{ |
|
|
|
| 513 |
if (UnAssignedChildObjectModQueue.Count < pObjects) |
if (UnAssignedChildObjectModQueue.Count < pObjects) |
| 514 |
pObjects = UnAssignedChildObjectModQueue.Count; |
pObjects = UnAssignedChildObjectModQueue.Count; |
| 515 |
|
|
| 931 |
} |
} |
| 932 |
terrain = smgr.AddTerrainSceneNode( |
terrain = smgr.AddTerrainSceneNode( |
| 933 |
filename, smgr.RootSceneNode, -1, |
filename, smgr.RootSceneNode, -1, |
| 934 |
new Vector3D(relTerrainPos.X, relTerrainPos.Z, relTerrainPos.Y), new Vector3D(0, 270, 0), new Vector3D(1, 1, 1), new Color(255, 255, 255, 255), 3, TerrainPatchSize.TPS17); |
new Vector3D(relTerrainPos.X - 4f, relTerrainPos.Z, relTerrainPos.Y + 16f), new Vector3D(0, 270, 0), new Vector3D(1, 1, 1), new Color(255, 255, 255, 255), 3, TerrainPatchSize.TPS17); |
| 935 |
//device.FileSystem.WorkingDirectory = "./media/"; |
//device.FileSystem.WorkingDirectory = "./media/"; |
| 936 |
terrain.SetMaterialFlag(MaterialFlag.Lighting, true); |
terrain.SetMaterialFlag(MaterialFlag.Lighting, true); |
| 937 |
terrain.SetMaterialType(MaterialType.DetailMap); |
terrain.SetMaterialType(MaterialType.DetailMap); |
| 938 |
|
terrain.SetMaterialFlag(MaterialFlag.NormalizeNormals, true); |
| 939 |
terrain.SetMaterialTexture(0, driver.GetTexture("Green_Grass_Detailed.tga")); |
terrain.SetMaterialTexture(0, driver.GetTexture("Green_Grass_Detailed.tga")); |
| 940 |
//terrain.SetMaterialTexture(1, driver.GetTexture("detailmap3.jpg")); |
//terrain.SetMaterialTexture(1, driver.GetTexture("detailmap3.jpg")); |
| 941 |
terrain.ScaleTexture(16, 16); |
terrain.ScaleTexture(16, 16); |
| 942 |
|
terrain.Scale = new Vector3D(1.0275f, 1, 1.0275f); |
| 943 |
} |
} |
| 944 |
|
|
| 945 |
lock (terrains) |
lock (terrains) |
| 1155 |
int bitmapy = cy + y * 16; |
int bitmapy = cy + y * 16; |
| 1156 |
|
|
| 1157 |
//int col = (int)(Util.Clamp(currentPatch[cy * 16 + cx] / 255, 0.0f, 1.0f) * 255); |
//int col = (int)(Util.Clamp(currentPatch[cy * 16 + cx] / 255, 0.0f, 1.0f) * 255); |
| 1158 |
float col = Util.Clamp<float>(currentPatch[cy * 16 + cx] * 0.00388f,0,255.0f); |
|
| 1159 |
|
float col = 0; |
| 1160 |
|
|
| 1161 |
|
col = currentPatch[cy * 16 + cx]; |
| 1162 |
|
if (col > 1000f || col < 0) |
| 1163 |
|
col = 0f; |
| 1164 |
|
col *= 0.00388f; |
| 1165 |
|
|
| 1166 |
|
|
| 1167 |
//m_log.Debug("[COLOR]: " + currentPatch[cy * 16 + cx].ToString()); |
//m_log.Debug("[COLOR]: " + currentPatch[cy * 16 + cx].ToString()); |
| 1168 |
//terrainbitmap.SetPixel(bitmapy, bitmapx, System.Drawing.Color.FromArgb(col, col, col)); |
//terrainbitmap.SetPixel(bitmapy, bitmapx, System.Drawing.Color.FromArgb(col, col, col)); |
| 1169 |
terrainbitmap.SetPixel(bitmapy, bitmapx, Util.FromArgbf(0,col,col,col)); |
terrainbitmap.SetPixel(bitmapy, bitmapx, Util.FromArgbf(1,col,col,col)); |
| 1170 |
} |
} |
| 1171 |
} |
} |
| 1172 |
} |
} |
| 1226 |
if (isCurrentSim) |
if (isCurrentSim) |
| 1227 |
{ |
{ |
| 1228 |
SNGlobalwater.Position = new Vector3D(0, sim.WaterHeight-0.5f, 0); |
SNGlobalwater.Position = new Vector3D(0, sim.WaterHeight-0.5f, 0); |
| 1229 |
|
//SNGlobalwater.Position = new Vector3D(0, sim.WaterHeight - 50.5f, 0); |
| 1230 |
|
// TODO REFIX! |
| 1231 |
} |
} |
| 1232 |
} |
} |
| 1233 |
|
|