else velocity[i]=0;
if(terrain.getOpacity(position[i].x,position[i].z)<.2)velocity[i]+=bounceness*elasticity*.3;
else velocity[i]+=bounceness*elasticity;
-
+//if (type[i]==knife) printf("velocity of knife %d now %f,%f,%f.\n", i, velocity[i].x, velocity[i].y, velocity[i].z);
if(findLengthfast(&bounceness)>1){
float gLoc[3];
float vel[3];
else tipvelocity[i]=0;
if(terrain.getOpacity(tippoint[i].x,tippoint[i].z)<.2)tipvelocity[i]+=bounceness*elasticity*.3;
else tipvelocity[i]+=bounceness*elasticity;
+//if (type[i]==knife) printf("tipvelocity of knife %d now %f,%f,%f.\n", i, tipvelocity[i].x, tipvelocity[i].y, tipvelocity[i].z);
if(findLengthfast(&bounceness)>1){
float gLoc[3];
Weapons::~Weapons()
{
- if (stafftextureptr) glDeleteTextures( 1, (const unsigned long *)&stafftextureptr );
- if (knifetextureptr) glDeleteTextures( 1, (const unsigned long *)&knifetextureptr );
- if (lightbloodknifetextureptr) glDeleteTextures( 1, (const unsigned long *)&lightbloodknifetextureptr );
- if (bloodknifetextureptr) glDeleteTextures( 1, (const unsigned long *)&bloodknifetextureptr );
- if (swordtextureptr) glDeleteTextures( 1, (const unsigned long *)&swordtextureptr );
- if (lightbloodswordtextureptr) glDeleteTextures( 1, (const unsigned long *)&lightbloodswordtextureptr );
- if (bloodswordtextureptr) glDeleteTextures( 1, (const unsigned long *)&bloodswordtextureptr );
+ if (stafftextureptr) glDeleteTextures( 1, &stafftextureptr );
+ if (knifetextureptr) glDeleteTextures( 1, &knifetextureptr );
+ if (lightbloodknifetextureptr) glDeleteTextures( 1, &lightbloodknifetextureptr );
+ if (bloodknifetextureptr) glDeleteTextures( 1, &bloodknifetextureptr );
+ if (swordtextureptr) glDeleteTextures( 1, &swordtextureptr );
+ if (lightbloodswordtextureptr) glDeleteTextures( 1, &lightbloodswordtextureptr );
+ if (bloodswordtextureptr) glDeleteTextures( 1, &bloodswordtextureptr );
}