| 312 | } |
| 313 | |
| 314 | TerrainObject::TerrainObject(const TerrainInfo& _terrain_info) : bullet_object_(NULL), |
| 315 | preview_mode(false) { |
| 316 | shader_extra = _terrain_info.shader_extra; |
| 317 | terrain_info_ = _terrain_info; |
| 318 | added_to_physics_scene_ = false; |
| 319 | terrain_.SetColorTexture(terrain_info_.colormap.c_str()); |
| 320 | Textures::Instance()->setWrap(GL_REPEAT); |
| 321 | terrain_.weight_perturb_ref = Engine::Instance()->GetAssetManager()->LoadSync<TextureAsset>("Data/Textures/weight_perturb.tga"); |
| 322 | terrain_.SetDetailTextures(terrain_info_.detail_map_info); |
| 323 | terrain_.SetWeightTexture(terrain_info_.weightmap.c_str()); |
| 324 | if (_terrain_info.minimal) |
| 325 | terrain_.LoadMinimal(terrain_info_.heightmap.c_str(), terrain_info_.model_override); |
| 326 | else |
| 327 | terrain_.Load(terrain_info_.heightmap.c_str(), terrain_info_.model_override); |
| 328 | terrain_.SetDetailObjectLayers(terrain_info_.detail_object_info); |
| 329 | collidable = true; |
| 330 | transparent = false; |
| 331 | gl_state_.depth_test = true; |
| 332 | gl_state_.cull_face = true; |
| 333 | gl_state_.depth_write = true; |
| 334 | gl_state_.blend = false; |
| 335 | edge_gl_state_.depth_test = true; |
| 336 | edge_gl_state_.cull_face = true; |
| 337 | edge_gl_state_.depth_write = true; |
| 338 | edge_gl_state_.blend = true; |
| 339 | permission_flags = 0; |
| 340 | exclude_from_undo = true; |
| 341 | exclude_from_save = true; |
| 342 | } |
| 343 | |
| 344 | TerrainObject::~TerrainObject() { |
| 345 | if (added_to_physics_scene_) |
nothing calls this directly
no test coverage detected