Obi Official Forum
Help Questions About Fixing Particle Translation and Removing Pin Contraint in Runtime - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Rope (https://obi.virtualmethodstudio.com/forum/forum-4.html)
+--- Thread: Help Questions About Fixing Particle Translation and Removing Pin Contraint in Runtime (/thread-2175.html)



Questions About Fixing Particle Translation and Removing Pin Contraint in Runtime - relevantname - 16-04-2020

Hi, 

I have two questions;

- How to fix particle translation and orientation in runtime? (I want to fix a particle and than generate tethers in runtime)
- How to remove pin contraints in runtime?(I can add and clear pin contraints in runtime but cannor remove like the same way.)

Thanks in advance.


RE: Questions About Fixing Particle Translation and Removing Pin Contraint in Runtime - josemendez - 19-04-2020

(16-04-2020, 04:30 PM)relevantname Wrote: Hi, 

I have two questions;

- How to fix particle translation and orientation in runtime? (I want to fix a particle and than generate tethers in runtime)
- How to remove pin contraints in runtime?(I can add and clear pin contraints in runtime but cannor remove like the same way.)

Thanks in advance.

Hi,

I assume you're using Obi 4.X, if dealing with pin constraints manually.

To fix particle translation, set its inverse mass to zero. To fix its orientation, set its inverse rotational mass to zero. See:
http://obi.virtualmethodstudio.com/tutorials_4/scriptingparticles.html

Inverse mass
Inverse mass for each particle. An inverse mass of 0 means the particle's mass is infinite, so its position will be unaffected by dynamics (allowing you to override it manually).
Inverse rotational mass
Inverse rotational mass for each particle. An inverse mass of 0 means the particle's rotational mass is infinite, so its orientation will be unaffected by dynamics (allowing you to override it manually).

To remove pin constraints, call pinBatch.RemoveConstraint(constraintIndex);. See: http://obi.virtualmethodstudio.com/tutorials_4/scriptingconstraints.html