]> git.jsancho.org Git - lugaru.git/commitdiff
Remove HitStruct and associated commented-out code
authorAlexander Monakov <amonakov@gmail.com>
Sun, 6 Jun 2010 16:42:56 +0000 (20:42 +0400)
committerAlexander Monakov <amonakov@gmail.com>
Sun, 6 Jun 2010 16:42:56 +0000 (20:42 +0400)
Source/Person.cpp
Source/Person.h

index 716130cd9957c71f6a6ad2b1405a93eff983f3dc..dcccedec0a6ccbbd60b8e690e90ff99638eb95ef 100644 (file)
@@ -1752,175 +1752,6 @@ void Person::Puff(int whichlabel){
 }
 
 
-/*
-HitStruct      Person::BulletCollideWithPlayer(XYZ start, XYZ end){
-float damage=20;
-XYZ tempbulletloc[2];
-XYZ collisionpoint;
-XYZ sparkpos;
-GLfloat M[16];
-int collide;
-float howfar;
-XYZ average;
-XYZ facing;
-int howmany;
-float distancemax;
-HitStruct hitstruct;
-hitstruct.collision=0;
-//Make bounding sphere
-average=0;
-howmany=0;
-for(int j=0;j<skeleton.num_joints;j++){
-average.x=average.x+skeleton.joints[j].position.x;
-average.y=average.y+skeleton.joints[j].position.y;
-average.z=average.z+skeleton.joints[j].position.z;
-howmany++;
-}
-average=average/howmany;
-distancemax=0;
-for(int j=0;j<skeleton.num_joints;j++){
-if(findDistancefast(average,skeleton.joints[j].position)>distancemax){
-distancemax=findDistancefast(average,skeleton.joints[j].position);
-}
-}
-distancemax=fast_sqrt(distancemax);
-//Collide with player
-if(skeleton.free<1){
-start=start-coords;
-end=end-coords;
-if(rotation)start=DoRotation(start,0,-rotation,0);
-if(rotation)end=DoRotation(end,0,-rotation,0);
-}
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-if(sphere_line_intersection(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z,
-tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z,
-average.x, average.y, average.z, distancemax)){
-for(int j=0;j<skeleton.num_joints;j++){
-if(skeleton.joints[j].hasparent&&skeleton.joints[j].visible){
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.joints[j].length,1);
-glRotatef(skeleton.joints[j].rotate2-90,0,0,1);
-glRotatef(skeleton.joints[j].rotate1-90,0,1,0);
-glTranslatef(  (-(skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2),
-(-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2),
-(-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2));
-glTranslatef(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[0].x=M[12];
-tempbulletloc[0].y=M[13];
-tempbulletloc[0].z=M[14];
-glPopMatrix();
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.joints[j].length,1);
-glRotatef(skeleton.joints[j].rotate2-90,0,0,1);
-glRotatef(skeleton.joints[j].rotate1-90,0,1,0);
-glTranslatef(  (-(skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2),
-(-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2),
-(-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2));
-glTranslatef(tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[1].x=M[12];
-tempbulletloc[1].y=M[13];
-tempbulletloc[1].z=M[14];
-glPopMatrix();
-collide=skeletonmodels[skeleton.joints[j].modelnum].LineCheck(tempbulletloc[0],tempbulletloc[1],&collisionpoint);
-if(collide!=-1)
-{
-glPushMatrix();
-glLoadIdentity();
-glTranslatef(  (skeleton.joints[j].position.x+skeleton.joints[j].parent->position.x)/2,
-(skeleton.joints[j].position.y+skeleton.joints[j].parent->position.y)/2,
-(skeleton.joints[j].position.z+skeleton.joints[j].parent->position.z)/2);
-glRotatef(-skeleton.joints[j].rotate1+90,0,1,0);
-glRotatef(-skeleton.joints[j].rotate2+90,0,0,1);
-glScalef(1,skeleton.joints[j].length,1);
-glTranslatef(collisionpoint.x,collisionpoint.y,collisionpoint.z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-collisionpoint.x=M[12];
-collisionpoint.y=M[13];
-collisionpoint.z=M[14];
-glPopMatrix();
-hitstruct.collision=1;
-hitstruct.hitlocation=collisionpoint;
-hitstruct.joint1=&skeleton.joints[j];
-hitstruct.joint2=skeleton.joints[j].parent;
-}
-}
-}
-for(int j=0;j<skeleton.num_muscles;j++){
-if(skeleton.muscles[j].visible){
-tempbulletloc[0]=start;
-tempbulletloc[1]=end;
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.muscles[j].length,1);
-glRotatef(skeleton.muscles[j].rotate3,0,1,0);
-glRotatef(skeleton.muscles[j].rotate2-90,0,0,1);
-glRotatef(skeleton.muscles[j].rotate1-90,0,1,0);
-glTranslatef(  (-(skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2),
-(-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2),
-(-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2));
-
-glTranslatef(tempbulletloc[0].x,tempbulletloc[0].y,tempbulletloc[0].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[0].x=M[12];
-tempbulletloc[0].y=M[13];
-tempbulletloc[0].z=M[14];
-glPopMatrix();
-glPushMatrix();
-glLoadIdentity();
-glScalef(1,1/skeleton.muscles[j].length,1);
-glRotatef(skeleton.muscles[j].rotate3,0,1,0);
-glRotatef(skeleton.muscles[j].rotate2-90,0,0,1);
-glRotatef(skeleton.muscles[j].rotate1-90,0,1,0);
-
-glTranslatef(  (-(skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2),
-(-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2),
-(-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2));
-glTranslatef(tempbulletloc[1].x,tempbulletloc[1].y,tempbulletloc[1].z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-tempbulletloc[1].x=M[12];
-tempbulletloc[1].y=M[13];
-tempbulletloc[1].z=M[14];
-glPopMatrix();
-collide=skeletonmodels[skeleton.muscles[j].parent1->modelnum].LineCheck(tempbulletloc[0],tempbulletloc[1],&collisionpoint);
-if(collide!=-1)
-{
-glPushMatrix();
-glLoadIdentity();
-glTranslatef(  (skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2,
-(skeleton.muscles[j].parent1->position.y+skeleton.muscles[j].parent2->position.y)/2,
-(skeleton.muscles[j].parent1->position.z+skeleton.muscles[j].parent2->position.z)/2);
-glRotatef(-skeleton.muscles[j].rotate1+90,0,1,0);
-glRotatef(-skeleton.muscles[j].rotate2+90,0,0,1);
-glRotatef(-skeleton.muscles[j].rotate3,0,1,0);
-glScalef(1,findDistance(skeleton.muscles[j].parent1->position,skeleton.muscles[j].parent2->position),1);
-glTranslatef(collisionpoint.x,collisionpoint.y,collisionpoint.z);
-glGetFloatv(GL_MODELVIEW_MATRIX,M);
-collisionpoint.x=M[12];
-collisionpoint.y=M[13];
-collisionpoint.z=M[14];
-glPopMatrix();
-hitstruct.collision=1;
-hitstruct.hitlocation=collisionpoint;
-hitstruct.joint1=skeleton.muscles[j].parent1;
-hitstruct.joint2=skeleton.muscles[j].parent2;
-}
-}
-}
-}
-if(skeleton.free<1){
-if(rotation)hitstruct.hitlocation=DoRotation(hitstruct.hitlocation,0,rotation,0);
-hitstruct.hitlocation=hitstruct.hitlocation+coords;
-}
-return hitstruct;
-}
-*/
 void   Person::DoAnimations(){
        if(!skeleton.free){
                int i = 0;
index 517ca0d5057a544358f8ac9b69ad70cd50b1d8f4..27666e4bf904fe99cd04b1d1c0b1d3e50710a665 100644 (file)
@@ -47,15 +47,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #define rabbittype 0
 #define wolftype 1
 
-class HitStruct
-{
-       public:
-               Joint *joint1;
-               Joint *joint2;
-               XYZ hitlocation;
-               bool collision;
-};
-
 class Person
 {
        public:
@@ -380,7 +371,6 @@ class Person
                void DoStuff();
                void DoAnimations();
                void RagDoll(bool checkcollision);
-               HitStruct BulletCollideWithPlayer(XYZ start, XYZ end);
 };
 
 #endif