How to use Magic_SetPath
Posted: Wed Oct 25, 2017 9:58 am
Hello,
I have an emitter (type MAGIC_PARTICLES_TYPE_PATH), which is created in the program for designers,
when I run the program, I draw the effect "as is", such as it is created in the program, but after I want to change it programmatically, for this I do such actions
all functions work and return MAGIC_SUCCESS, everything is given according to the documentation,
but after these actions the emitter works without a path at all. I mean all particles appear at the starting point and remain in place.
Tell me please do I do something wrong or is it a bug?
thanks
p.s.
the coordinates that I add are correct. (I looked at those coordinates that come from GetPath and exhibited accordingly with them).
I have an emitter (type MAGIC_PARTICLES_TYPE_PATH), which is created in the program for designers,
when I run the program, I draw the effect "as is", such as it is created in the program, but after I want to change it programmatically, for this I do such actions
- Code: Select all
int iResult = MAGIC_SUCCESS;
ASSERT(Magic_GetParticlesTypeCount(m_iEmitterId) > 0);
Magic_LockParticlesType(m_iEmitterId, 0);
ASSERT(iResult == MAGIC_SUCCESS);
MAGIC_PARTICLES_TYPE_ENUM eType = Magic_GetParticlesTypeMode();
if(eType == MAGIC_PARTICLES_TYPE_PATH)
{
int iPathLenght = Magic_GetPathLength();
MAGIC_KEY keys[iPathLenght];
iResult = Magic_GetPath(keys);
ASSERT(iResult == MAGIC_SUCCESS);
keys[1].position.x -= 60;
keys[1].position.y += 40;
iResult = Magic_SetPath(iPathLenght, &keys[0]);
ASSERT(iResult == MAGIC_SUCCESS);
}
iResult = Magic_UnlockParticlesType();
ASSERT(iResult == MAGIC_SUCCESS);
all functions work and return MAGIC_SUCCESS, everything is given according to the documentation,
but after these actions the emitter works without a path at all. I mean all particles appear at the starting point and remain in place.
Tell me please do I do something wrong or is it a bug?
thanks
p.s.
the coordinates that I add are correct. (I looked at those coordinates that come from GetPath and exhibited accordingly with them).