Commits

Ajay Roopakalu committed 082a59a

Mostly fixed AlignReticle() issues.

Comments (0)

Files changed (3)

 {
 }
 
-
-
 int R3Chunk::
 GenerateChunk(int c_x, int c_z)
 {
   }
 }
 
-
 int R3Chunk::
 ReadChunk(int xChunkCoord, int zChunkCoord)
 {
   int chunkZ = (CHUNKS - 1) / 2;
   int chunksAway = 0;
 
-  newIndex.x = ROUND(p[0] - terrain[chunkX][chunkZ]->start_point[0]);
-  newIndex.y = ROUND(p[1] + CHUNK_Y / 2);
-  newIndex.z = ROUND(p[2] - terrain[chunkX][chunkZ]->start_point[2]);
+  newIndex.x = floor(p[0] - terrain[chunkX][chunkZ]->start_point[0]);
+  newIndex.y = floor(p[1] + CHUNK_Y / 2);
+  newIndex.z = floor(p[2] - terrain[chunkX][chunkZ]->start_point[2]);
   newIndex.current = NULL;
   
   while (newIndex.x < 0)

src/minecraft.cpp

   // Loop until you go beyond the boundaries of the currently loaded map
 	while (true)
 	{
-    dt += 1.;
+    dt += .5;
 		R3Index cur = getChunkCoordinates(ray.Point(dt));
     
     // Break if you reach too far with this ray
 	// Invert y coordinate
 	y = GLUTwindow_height - y;
 
+  R3Index index;
+
   // Process keyboard button event 
   switch (key) 
   {
     case 'i':
       if (state == STARTMENU) 
         break;
-      printf("camera %g %g %g  %g %g %g  %g  %g %g \n",
-          camera.eye[0], camera.eye[1], camera.eye[2], 
+      index = getChunkCoordinates(camera.eye);
+      printf("camera %g %g %g - %d %d %d - %g %g %g - %g - %g %g \n",
+          camera.eye[0], camera.eye[1], camera.eye[2],
+          index.x, index.y, index.z,
           rot[0], rot[1], rot[2],
           camera.xfov, camera.neardist, camera.fardist); 
       break;
 
 	// Set up default properties of camera
 	camera.towards = R3negz_vector;
-	camera.eye = R3zero_point + (1.9) * R3posy_vector;
+	camera.eye = R3zero_point + (2.1) * R3posy_vector;
 	camera.up = R3posy_vector;
 	camera.right = R3posx_vector;
 	camera.xfov = .5;
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.