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

Method LoadModel

Source/Objects/envobject.cpp:1601–1633  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1599}
1600
1601void EnvObject::LoadModel() {
1602 if (!ofr.valid()) {
1603 return;
1604 }
1605 bool use_tangent = true;
1606 char flags = 0;
1607 if (use_tangent) {
1608 flags = flags | _MDL_USE_TANGENT;
1609 }
1610 flags = flags | _MDL_CENTER;
1611
1612 bool physics_recalc = false;
1613 if (!csg_modified_) {
1614 int old_model_id = model_id_;
1615 if (NeedsWindingFlip(GetScale())) {
1616 model_id_ = Models::Instance()->loadFlippedModel(ofr->model_name.c_str(), flags);
1617 winding_flip = true;
1618 } else {
1619 model_id_ = Models::Instance()->loadModel(ofr->model_name.c_str(), flags);
1620 winding_flip = false;
1621 }
1622 if (old_model_id != -1 && old_model_id != model_id_) {
1623 physics_recalc = true;
1624 }
1625 }
1626 if (scenegraph_ && physics_recalc) {
1627 RemovePhysicsShape();
1628
1629 if (!attached_) {
1630 CreatePhysicsShape();
1631 }
1632 }
1633}
1634
1635void EnvObject::SetCSGModified() {
1636 csg_modified_ = true;

Callers

nothing calls this directly

Calls 6

NeedsWindingFlipFunction · 0.85
GetScaleFunction · 0.85
loadFlippedModelMethod · 0.80
validMethod · 0.45
c_strMethod · 0.45
loadModelMethod · 0.45

Tested by

no test coverage detected