Fix body material defaulting some state#495
Conversation
This prevents RapierCollisionObjectBase from overwriting material properties that should only be set by RapierBody.
|
Kinda beats the purpose of the material. Not a big fan of this, but if it works I guess it's ok. I would rather either have 2 functions, and not have the bool param, or not have the material and instead have optional parameters, or just construct the material correctly. EDIT: |
|
I tested locally and it worked as expected, at least for bounce. As for splitting it into two functions, I could set that up later if you want to hold off on merging. |
|
Nah, it's ok like this. You can if you want as a future PR, though it's not bad as it is right now. Thanks for contributing! |
Resolves appsinacup#492 Resolves appsinacup#488 This prevents RapierCollisionObjectBase from overwriting material properties that should only be set by RapierBody. Namely bounce and friction, but also contact skin and soft ccd. I just threw this together because I realized it would be simple to fix this way, but if this seems too hacky I can set up a system where `body_update_material` takes two material parameters: a new `BaseMaterial` and the standard `Material`, where they each handle their respective collision object type, and the `Material` is optional to allow `RapierCollisionObjectBase` to modify things safely.
Resolves #492
Resolves #488
This prevents RapierCollisionObjectBase from overwriting material properties that should only be set by RapierBody. Namely bounce and friction, but also contact skin and soft ccd.
I just threw this together because I realized it would be simple to fix this way, but if this seems too hacky I can set up a system where
body_update_materialtakes two material parameters: a newBaseMaterialand the standardMaterial, where they each handle their respective collision object type, and theMaterialis optional to allowRapierCollisionObjectBaseto modify things safely.