From ae0810b2d4cdd31cd05f5746c6411da9d458eead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Gia=20Phong?= Date: Sat, 18 Nov 2023 21:40:15 +0900 Subject: Convert model geometry to Zig --- src/Person.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/Person.cpp') 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, -- cgit v1.2.3