From 9716ea9550e80ecb6e5030b6a45b603524ebaf22 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Thu, 2 May 2013 22:28:41 -0700 Subject: [PATCH] Ground plane moved to 0->10 and lines are exactly 1 meter --- interface/src/Avatar.cpp | 9 ++++++-- interface/src/Util.cpp | 44 ++++++++++++++-------------------------- interface/src/Util.h | 2 +- interface/src/main.cpp | 2 +- 4 files changed, 24 insertions(+), 33 deletions(-) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index b75e151a5b..a1f9103d37 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -1508,8 +1508,13 @@ glm::vec3 Avatar::getGravity(glm::vec3 pos) { // For now, we'll test this with a simple global lookup, but soon we will add getting this // from the domain/voxelserver (or something similar) // - if (glm::length(pos) < 5.f) { - // If near the origin sphere, turn gravity ON + if ((pos.x > 0.f) && + (pos.x < 10.f) && + (pos.z > 0.f) && + (pos.z < 10.f) && + (pos.y > 0.f) && + (pos.y < 3.f)) { + // If above ground plane, turn gravity on return glm::vec3(0.f, -1.f, 0.f); } else { // If flying in space, turn gravity OFF diff --git a/interface/src/Util.cpp b/interface/src/Util.cpp index ef51f9b72a..138ae7aef4 100644 --- a/interface/src/Util.cpp +++ b/interface/src/Util.cpp @@ -213,42 +213,28 @@ void drawvec3(int x, int y, float scale, float rotate, float thick, int mono, gl } -void drawGroundPlaneGrid( float size, int resolution ) +void drawGroundPlaneGrid(float size) { - glColor3f( 0.4f, 0.5f, 0.3f ); + glColor3f( 0.4f, 0.5f, 0.3f ); glLineWidth(2.0); - float gridSize = 10.0; - int gridResolution = 20; - - for (int g=0; g