Made selection boxes not succ
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
#include "DeleteListener.h"
|
||||
#include "CameraButtonListener.h"
|
||||
#include "RotateButtonListener.h"
|
||||
#define LEGACY_LOAD_G3DFUN_LEVEL
|
||||
//#define LEGACY_LOAD_G3DFUN_LEVEL
|
||||
Ray testRay;
|
||||
static int cursorid = 0;
|
||||
static int cursorOvrid = 0;
|
||||
@@ -512,7 +512,7 @@ int Application::getMode()
|
||||
|
||||
void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, LightingParameters lighting, Vector3 size, Vector3 pos, CoordinateFrame c)
|
||||
{
|
||||
|
||||
rd->disableLighting();
|
||||
Color3 outline = Color3::cyan();//Color3(0.098F,0.6F,1.0F);
|
||||
float offsetSize = 0.05F;
|
||||
//X
|
||||
@@ -534,8 +534,6 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
|
||||
|
||||
if(_mode == ARROWS)
|
||||
{
|
||||
rd->setLight(0, NULL);
|
||||
rd->setAmbientLightColor(Color3(1,1,1));
|
||||
|
||||
AABox box;
|
||||
c.toWorldSpace(Box(from, to)).getBounds(box);
|
||||
@@ -556,14 +554,10 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
|
||||
|
||||
|
||||
|
||||
rd->setAmbientLightColor(lighting.ambient);
|
||||
rd->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor));
|
||||
}
|
||||
else if(_mode == RESIZE)
|
||||
{
|
||||
Color3 sphereColor = outline;
|
||||
rd->setLight(0, NULL);
|
||||
rd->setAmbientLightColor(Color3(1,1,1));
|
||||
Vector3 gamepoint = pos;
|
||||
Vector3 camerapoint = rd->getCameraToWorldMatrix().translation;
|
||||
float distance = pow(pow((double)gamepoint.x - (double)camerapoint.x, 2) + pow((double)gamepoint.y - (double)camerapoint.y, 2) + pow((double)gamepoint.z - (double)camerapoint.z, 2), 0.5);
|
||||
@@ -573,25 +567,23 @@ void Application::drawOutline(Vector3 from, Vector3 to, RenderDevice* rd, Lighti
|
||||
float multiplier = distance * 0.025F/2;
|
||||
if(multiplier < 0.25F)
|
||||
multiplier = 0.25F;
|
||||
Vector3 position = pos + (c.lookVector()*((size.z/2)+1));
|
||||
Vector3 position = pos + (c.lookVector()*((size.z)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
position = pos - (c.lookVector()*((size.z/2)+1));
|
||||
position = pos - (c.lookVector()*((size.z)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
|
||||
position = pos + (c.rightVector()*((size.x/2)+1));
|
||||
position = pos + (c.rightVector()*((size.x)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
position = pos - (c.rightVector()*((size.x/2)+1));
|
||||
position = pos - (c.rightVector()*((size.x)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
|
||||
position = pos + (c.upVector()*((size.y/2)+1));
|
||||
position = pos + (c.upVector()*((size.y)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
position = pos - (c.upVector()*((size.y/2)+1));
|
||||
position = pos - (c.upVector()*((size.y)+1));
|
||||
Draw::sphere(Sphere(position, multiplier), rd, sphereColor, Color4::clear());
|
||||
}
|
||||
rd->setAmbientLightColor(lighting.ambient);
|
||||
rd->setLight(0, GLight::directional(lighting.lightDirection, lighting.lightColor));
|
||||
}
|
||||
|
||||
rd->enableLighting();
|
||||
}
|
||||
|
||||
void Application::exitApplication()
|
||||
|
||||
Reference in New Issue
Block a user