API- Accessing Particle Data

   4117   1   2
User Avatar
Member
229 posts
Joined: May 2006
Offline
Hi,

maybe somebody could help me :-), achtualy i'm writing a pop operator, and to do with the particle what i want, i do something like this


UT_Vector3* accel_ = (UT_Vector3*) myCurrPt->getAttribData(data->getAccelOffset());
UT_Vector3* veloc_ = (UT_Vector3*) myCurrPt->getAttribData(data->getVelocityOffset());
this->particleMgr->addParticle(myCurrPt,accel_,veloc_);



i just wana store the pointer to the GEO_Point Object of the Particle to later have access to the Object.
But Some Function Calls later when i want to access the Position via

this->particles.getPoint().getPos();

where getPoint() returns the Pointer added before with

this->particleMgr->addParticle(myCurrPt,accel_,veloc_);

i got a segmentation fault, maybe because the prevoius stored pointer is not valid anymore.

Now my question, is there an other way to identify a particle unique ??

thx in advance

Sebastian Schmidt
User Avatar
Member
166 posts
Joined: Feb. 2006
Offline
Hi Sebastian,

I dont have access to the HDK right now, but I think it will be better to get the particle ID ( which is unique until the particle dies ).
Cause using the index, may result that the particles being different from one frame to another. I am not 100%, but I could dig it and tell you by tomorrow. Or maybe someone knows (now) the answer at 200%
Cheers.
Time to get out of this messy world.
  • Quick Links