![]() |
Obi softbody crashes after setting inverse masses - Printable Version +- Obi Official Forum (https://obi.virtualmethodstudio.com/forum) +-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html) +--- Forum: Obi Softbody (https://obi.virtualmethodstudio.com/forum/forum-12.html) +--- Thread: Obi softbody crashes after setting inverse masses (/thread-3150.html) |
Obi softbody crashes after setting inverse masses - Jschol - 25-10-2021 Hi all, I am trying to set the inverse masses of my obi softbody however, it crashes when settting it to a non 0 value with the error: transform.position assign attempt for 'Cluster0' is not valid. Input position is { NaN, NaN, NaN }. UnityEngine.Transform ![]() Obi.ObiSoftbodySkinner:UpdateBones (Obi.ObiActor) (at Assets/Obi/Scripts/Softbody/Rendering/ObiSoftbodySkinner.cs:130) Obi.ObiActor:Interpolate () (at Assets/Obi/Scripts/Common/Actors/ObiActor.cs:1207) Obi.ObiSoftbody:Interpolate () (at Assets/Obi/Scripts/Softbody/Actors/ObiSoftbody.cs:289) I am setting the inverse masses like this: Code: public void setGroupInvMasses() I also call: Code: ObiSoftbody.UpdateParticleProperties() Is there something I miss? I am not sure if it is relevant but, I also change some of the shape matching constraints of the body. Kind regards, Jasper RE: Obi softbody crashes after setting inverse masses - josemendez - 25-10-2021 (25-10-2021, 10:42 AM)Jschol Wrote: I am not sure if it is relevant but, I also change some of the shape matching constraints of the body. Hi, How are you changing the shape matching constraints? It's fairly easy to get issues if you're not careful with indices, since none of the constraint arrays do any range/bounds checks at runtime. RE: Obi softbody crashes after setting inverse masses - Jschol - 25-10-2021 I loop over the constraints and particles, and if a particle is referenced in the constraint, I set the constraints. This works on its own though. Something like this: Code: // get batches and offsets With: Code: bool ConstraintIsReferencedInParticleGroup(ObiShapeMatchingConstraintsBatch actorSoftBodyBatch, |