X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FObjects.cpp;h=06c8b8bdd360f41c9c8f754971a2c514ddde6e71;hb=8557e339c9a2d10afdf6465e02eca6b87efc961f;hp=d67044eee0923ea543436805384068352c0cf457;hpb=44146d06c780d3aaa283672fedb08b8870ebe1b9;p=lugaru.git diff --git a/Source/Objects.cpp b/Source/Objects.cpp index d67044e..06c8b8b 100644 --- a/Source/Objects.cpp +++ b/Source/Objects.cpp @@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "Objects.h" extern XYZ viewer; extern float viewdistance; -extern float lightambient[3],lightbrightness[3]; extern float fadestart; extern int environment; extern float texscale; @@ -31,14 +30,12 @@ extern float multiplier; extern float gravity; extern FRUSTUM frustum; extern Terrain terrain; -extern float terraindetail; extern bool foliage; extern int detail; extern float blurness; extern float windvar; extern float playerdist; extern bool skyboxtexture; -extern Sprites sprites; //Functions @@ -55,7 +52,7 @@ bool Objects::checkcollide(XYZ startpoint,XYZ endpoint,int which){ if(type[i]!=treeleavestype&&type[i]!=treetrunktype&&type[i]!=bushtype&&type[i]!=firetype&&i!=which){ colviewer=startpoint; coltarget=endpoint; - if(model[i].LineCheck(&colviewer,&coltarget,&colpoint,&position[i],&rotation[i])!=-1)return 1; + if(model[i].LineCheck(&colviewer,&coltarget,&colpoint,&position[i],&yaw[i])!=-1)return 1; } } @@ -68,15 +65,15 @@ void Objects::SphereCheckPossible(XYZ *p1,float radius) static int whichpatchx; static int whichpatchz; - whichpatchx=p1->x/(terrain.size/subdivision*terrain.scale*terraindetail); - whichpatchz=p1->z/(terrain.size/subdivision*terrain.scale*terraindetail); + whichpatchx=p1->x/(terrain.size/subdivision*terrain.scale); + whichpatchz=p1->z/(terrain.size/subdivision*terrain.scale); if(whichpatchx>=0&&whichpatchz>=0&&whichpatchx0&&terrain.patchobjectnum[whichpatchx][whichpatchz]<500) for(j=0;j