improve BasicDemo, better mouse handling, add colors to drawing

This commit is contained in:
Erwin Coumans
2014-05-21 09:59:24 -07:00
parent 7f300a877f
commit 28f19f1bab
6 changed files with 25 additions and 11 deletions

View File

@@ -5,7 +5,9 @@
Bullet2RigidBodyDemo::Bullet2RigidBodyDemo(SimpleOpenGL3App* app)
:m_glApp(app),
m_pickedBody(0),
m_pickedConstraint(0)
m_pickedConstraint(0),
m_controlPressed(false),
m_altPressed(false)
{
m_config = 0;
m_dispatcher = 0;
@@ -113,8 +115,8 @@ btVector3 Bullet2RigidBodyDemo::getRayTo(int x,int y)
bool Bullet2RigidBodyDemo::mouseMoveCallback(float x,float y)
{
// if (m_data->m_altPressed!=0 || m_data->m_controlPressed!=0)
// return false;
//if (m_data->m_altPressed!=0 || m_data->m_controlPressed!=0)
//return false;
if (m_pickedBody && m_pickedConstraint)
{
@@ -143,7 +145,7 @@ bool Bullet2RigidBodyDemo::mouseButtonCallback(int button, int state, float x, f
if (state==1)
{
if(button==0)// && (m_data->m_altPressed==0 && m_data->m_controlPressed==0))
if(button==0 && (!m_altPressed && !m_controlPressed))
{
btVector3 camPos;
m_glApp->m_instancingRenderer->getCameraPosition(camPos);