diff options
| author | Nguyễn Gia Phong <cnx@loang.net> | 2023-11-18 21:40:15 +0900 |
|---|---|---|
| committer | Nguyễn Gia Phong <cnx@loang.net> | 2023-11-18 21:40:15 +0900 |
| commit | ae0810b2d4cdd31cd05f5746c6411da9d458eead (patch) | |
| tree | a827fbe10c12a4a4665b98144f32e767ba5a3553 /src/Person.cpp | |
| parent | 371906f5fb958691a8bfce85c28eb4dfaf63559c (diff) | |
| download | blackshades-ae0810b2d4cdd31cd05f5746c6411da9d458eead.tar.gz | |
Convert model geometry to Zig
Diffstat (limited to 'src/Person.cpp')
| -rw-r--r-- | src/Person.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Person.cpp b/src/Person.cpp index 65eb002..0b0a97c 100644 --- a/src/Person.cpp +++ b/src/Person.cpp @@ -105,9 +105,9 @@ HitStruct Person::BulletCollideWithPlayer(int who, XYZ start, XYZ end){ tempbulletloc[1].y=M[13]; tempbulletloc[1].z=M[14]; glPopMatrix(); - collide=skeletonmodels[joint.modelnum].LineCheck(tempbulletloc[0],tempbulletloc[1],&collisionpoint); - if(collide!=-1) - { + collide = segCrossModel(tempbulletloc[0], tempbulletloc[1], + skeletonmodels + joint.modelnum, &collisionpoint); + if (collide > -1) { glPushMatrix(); glLoadIdentity(); glTranslatef((joint.position.x + joint.parent->position.x) / 2, @@ -165,9 +165,10 @@ HitStruct Person::BulletCollideWithPlayer(int who, XYZ start, XYZ end){ 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) - { + collide = segCrossModel(tempbulletloc[0], tempbulletloc[1], + skeletonmodels + skeleton.muscles[j].parent1->modelnum, + &collisionpoint); + if (collide > -1) { glPushMatrix(); glLoadIdentity(); glTranslatef( (skeleton.muscles[j].parent1->position.x+skeleton.muscles[j].parent2->position.x)/2, |
