improve get_model_transform readability
This commit is contained in:
parent
3797408bc8
commit
24787fede5
@ -235,11 +235,11 @@ impl PhysicsModels{
|
||||
}
|
||||
fn get_model_transform(&self,model_id:ModelId)->Option<&PhysicsMeshTransform>{
|
||||
//ModelId can possibly be a decoration
|
||||
self.contact_models.get(&ContactModelId::new(model_id.get())).map_or_else(
|
||||
||self.intersect_models.get(&IntersectModelId::new(model_id.get()))
|
||||
match self.contact_models.get(&ContactModelId::new(model_id.get())){
|
||||
Some(model)=>Some(&model.transform),
|
||||
None=>self.intersect_models.get(&IntersectModelId::new(model_id.get()))
|
||||
.map(|model|&model.transform),
|
||||
|model|Some(&model.transform)
|
||||
)
|
||||
}
|
||||
}
|
||||
fn contact_model(&self,model_id:ContactModelId)->&ContactModel{
|
||||
&self.contact_models[&model_id]
|
||||
|
Loading…
Reference in New Issue
Block a user