Random position in a entity
Posted: Mon Sep 06, 2010 6:49 am
Hey norbo how would you suggest getting a random point in a box?
I want to get a random point in a body and also want to make a function for getting on on the surface of a body as well
Its for spawning particles on the surface of a animated charictor with a ragdoll that is mapped to it uses box entitys...
Any idea?
Should i just attempt to get each plane and size of the box and then find a random x and y for it in local space?
I was hoping that there may be a easier way somewhere already in the engine that could help...
Also it needs to be fast as it will be spawning many particles (i.e for fire) over the objects...
Thanks for any help you can provide.
I want to get a random point in a body and also want to make a function for getting on on the surface of a body as well
Its for spawning particles on the surface of a animated charictor with a ragdoll that is mapped to it uses box entitys...
Any idea?
Should i just attempt to get each plane and size of the box and then find a random x and y for it in local space?
I was hoping that there may be a easier way somewhere already in the engine that could help...
Also it needs to be fast as it will be spawning many particles (i.e for fire) over the objects...
Thanks for any help you can provide.