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

Method UpdateDetailScale

Source/Objects/envobject.cpp:1014–1025  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1012}
1013
1014void EnvObject::UpdateDetailScale() {
1015 if (!detail_texture_color_.empty()) {
1016 vec4 scale = GetScale();
1017 float scaled_up = max(scale[0], max(scale[1], scale[2]));
1018 Model* model = &Models::Instance()->GetModel(model_id_);
1019 float texel_scale = scaled_up / model->texel_density * 0.15f;
1020 vec4 scale_vec(1.0f);
1021 for (int i = 0; i < (int)ofr->m_detail_map_scale.size(); ++i) {
1022 scale_vec[i] = texel_scale * ofr->m_detail_map_scale[i];
1023 }
1024 }
1025}
1026
1027void EnvObject::GetObj2World(float* obj2world) {
1028 const float* gl_matrix = transform_;

Callers

nothing calls this directly

Calls 5

GetScaleFunction · 0.85
maxFunction · 0.85
emptyMethod · 0.45
GetModelMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected