#9046 - hnager - Sun Jul 27, 2003 2:57 am
I have multiple sprites on screen which all should be able to rotate independantly of eachother (they can move in totally seperate paths). Anybody see anything wrong with this rotation function?:
Strange thing is that I can trace out to the console the OAMSpriteNum and they are definately different than eachother - here is the case/switch which moves/rotates:
Thanks again - anybody else ever encounter that issue?
Code: |
void Sprite::rotate(s32 angle){
s32 pa,pb,pc,pd; pa = ((zoom) * (s32)COS[angle])>>8; //(do my fixed point multiplies and shift back down) pb = ((zoom) * (s32)SIN[angle])>>8; pc = ((zoom) * (s32)-SIN[angle])>>8; pd = ((zoom) * (s32)COS[angle])>>8; rotData[OAMSpriteNum].pa = pa; //put them in my data struct rotData[OAMSpriteNum].pb = pb; rotData[OAMSpriteNum].pc = pc; rotData[OAMSpriteNum].pd = pd; } |
Strange thing is that I can trace out to the console the OAMSpriteNum and they are definately different than eachother - here is the case/switch which moves/rotates:
Code: |
switch(dir){ case ANT_RIGHT: setX(getX() + 2); this->rotate(90); break; case ANT_LEFT: setX(getX() - 2); this->rotate(-90); break; case ANT_UP: setY(getY() - 2); this->rotate(0); break; case ANT_DOWN: setY(getY() + 2); this->rotate(180); break; default: break; } |
Thanks again - anybody else ever encounter that issue?