It's a bit late and my head isn't working too well.
I try to draw a particle, which is attached to specific object bone (in example, torch - point is placed in the end of the stick).
I'm calculating the position with:
Code:
// matrix is the hand matrix (the hand position)
void drawParticles(Particles &particles, Matrix & matrix)
{
SkelPoint* lightPoint;
if (lightPoint = mesh->skeleton()->findPoint("lightPoint"))
{
Matrix a(*lightPoint);
particles.matrix = a + matrix.pos;
particles.draw();
}
}
But the effect looks like on a screen (like the position isn't rotated by the item orientation).
Where did I messed up the matrices? ;-)
(This post was last modified: 11-07-2011 12:18 AM by kulesz.)
if (lightPoint = Players[0].cskel.findPoint("lightPoint"))
{
particles.matrix = lightPoint->pos;
particles.draw();
}
The cskel should already be rotated since it's animating with your character. Using mesh()->skeleton() will give you the non-transformed version (i.e. what you see in Model Editor).
(This post was last modified: 11-07-2011 08:22 AM by Driklyn.)