| 1237 | } |
| 1238 | |
| 1239 | void EnvObject::CreatePhysicsShape() { |
| 1240 | BWFlags flags = BW_NO_FLAGS; |
| 1241 | if (ofr->no_collision) { |
| 1242 | flags |= BW_DECALS_ONLY; |
| 1243 | } |
| 1244 | BulletWorld* bw = GetBulletWorld(); |
| 1245 | if (ofr->bush_collision) { |
| 1246 | CreateBushPhysicsShape(); |
| 1247 | } else { |
| 1248 | int id = GetCollisionModelID(); |
| 1249 | Model* model = &Models::Instance()->GetModel(id); |
| 1250 | normal_override_buffer_dirty = true; |
| 1251 | bullet_object_ = bw->CreateStaticMesh(model, id, flags); |
| 1252 | } |
| 1253 | if (bullet_object_) { |
| 1254 | bullet_object_->owner_object = this; |
| 1255 | bullet_object_->SetTransform(GetTranslation(), Mat4FromQuaternion(GetRotation()), GetScale()); |
| 1256 | bullet_object_->UpdateTransform(); |
| 1257 | bullet_object_->UpdateTransform(); |
| 1258 | bw->UpdateSingleAABB(bullet_object_); |
| 1259 | } |
| 1260 | } |
| 1261 | |
| 1262 | void EnvObject::RemovePhysicsShape() { |
| 1263 | if (bullet_object_) { |
nothing calls this directly
no test coverage detected