MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / TerrainObject

Method TerrainObject

Source/Objects/terrainobject.cpp:314–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

312}
313
314TerrainObject::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
344TerrainObject::~TerrainObject() {
345 if (added_to_physics_scene_)

Callers

nothing calls this directly

Calls 9

SetColorTextureMethod · 0.80
setWrapMethod · 0.80
GetAssetManagerMethod · 0.80
SetDetailTexturesMethod · 0.80
SetWeightTextureMethod · 0.80
LoadMinimalMethod · 0.80
SetDetailObjectLayersMethod · 0.80
c_strMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected