16-10-2018, 07:50 AM
(This post was last modified: 16-10-2018, 07:52 AM by josemendez.)
(15-10-2018, 05:17 PM)Mitch@PG Wrote: Also:
- Uninstantiating particles within the radius of a Vector3 location
And / or:
- Changing values of an Emitter Material at runtime, such as Resolution or Rest Density
So, given an arbitrary Vector3 world location, will it be easy to determine if that location is within the volume of a collection of Obi Fluid particles? The Obi Fluid will be at rest in a container when I need to do this, so it wont be run while fluid is flying around the scene or anything. I've not had the chance to properly trawl through the API documentation yet, so my apologies if there's an easy answer in there.
The two next questions are pretty much as written; is there an easy way to uninstantiate particular particles? Again, apologies if this is obvious in the API docs!
And is it advisable / possible to alter the properties of Emitter Materials at runtime?
Thank you!
Hi there,
- Uninstantiating particles within the radius of a Vector3 location:
There's two options: iterate over all particles checking if they're within range of the Vector3 point (which if done every frame, can be inefficient) or use a spherical trigger collider and consider particles inside it (a better option). Then just set their life to zero. There's an example that does exactly this here:
http://obi.virtualmethodstudio.com/tutor...sions.html
- Changing values of an Emitter Material at runtime, such as Resolution or Rest Density
Yes, simply assign whatever values you need to the material properties, then call:
Code:
material.CommitChanges(ObiEmitterMaterial.MaterialChanges.PER_MATERIAL_DATA | ObiEmitterMaterial.MaterialChanges.PER_PARTICLE_DATA);