remove a lot of warnings (more todo in demos and serialization code)
This commit is contained in:
@@ -126,9 +126,13 @@ static int loadCurrentDemoEntry(const char* startFileName)
|
||||
{
|
||||
int result;
|
||||
result = fscanf(f,"%d",¤tEntry);
|
||||
if (result)
|
||||
{
|
||||
return currentEntry;
|
||||
}
|
||||
fclose(f);
|
||||
}
|
||||
return currentEntry;
|
||||
return 0;
|
||||
};
|
||||
|
||||
#endif//BULLET_DEMO_ENTRIES_H
|
||||
|
||||
@@ -14,7 +14,7 @@ GraphingTexture::~GraphingTexture()
|
||||
destroy();
|
||||
}
|
||||
|
||||
bool GraphingTexture::destroy()
|
||||
void GraphingTexture::destroy()
|
||||
{
|
||||
//TODO(erwincoumans) release memory etc...
|
||||
m_width = 0;
|
||||
@@ -58,21 +58,18 @@ bool GraphingTexture::create(int texWidth, int texHeight)
|
||||
glGenTextures(1,(GLuint*)&m_textureId);
|
||||
|
||||
uploadImageData();
|
||||
return true;
|
||||
}
|
||||
|
||||
void GraphingTexture::uploadImageData()
|
||||
{
|
||||
glBindTexture(GL_TEXTURE_2D,m_textureId);
|
||||
GLint err = glGetError();
|
||||
assert(err==GL_NO_ERROR);
|
||||
assert(glGetError()==GL_NO_ERROR);
|
||||
|
||||
err = glGetError();
|
||||
assert(err==GL_NO_ERROR);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, m_width,m_height,0,GL_RGBA,GL_UNSIGNED_BYTE,&m_imageData[0]);
|
||||
glGenerateMipmap(GL_TEXTURE_2D);
|
||||
|
||||
err = glGetError();
|
||||
assert(err==GL_NO_ERROR);
|
||||
assert(glGetError()==GL_NO_ERROR);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ struct GraphingTexture
|
||||
virtual ~GraphingTexture();
|
||||
|
||||
bool create(int texWidth, int texHeight);
|
||||
bool destroy();
|
||||
void destroy();
|
||||
|
||||
void setPixel(int x, int y, unsigned char red, unsigned char green, unsigned char blue, unsigned char alpha)
|
||||
{
|
||||
|
||||
@@ -124,7 +124,7 @@ void GwenParameterInterface::registerSliderFloatParameter(SliderParams& params)
|
||||
|
||||
pSlider->onValueChanged.Add( handler, &MySliderEventHandler<btScalar>::SliderMoved );
|
||||
handler->SliderMoved(pSlider);
|
||||
float v = pSlider->GetValue();
|
||||
// float v = pSlider->GetValue();
|
||||
m_gwenInternalData->m_curYposition+=22;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ protected:
|
||||
|
||||
void SliderMoved(Gwen::Controls::Base* pControl )
|
||||
{
|
||||
Gwen::Controls::Slider* pSlider = (Gwen::Controls::Slider*)pControl;
|
||||
// Gwen::Controls::Slider* pSlider = (Gwen::Controls::Slider*)pControl;
|
||||
//this->m_app->scaleYoungModulus(pSlider->GetValue());
|
||||
// printf("Slider Value: %.2f", pSlider->GetValue() );
|
||||
}
|
||||
@@ -35,8 +35,8 @@ protected:
|
||||
|
||||
void OnCheckChangedStiffnessWarping (Gwen::Controls::Base* pControl)
|
||||
{
|
||||
Gwen::Controls::CheckBox* labeled = (Gwen::Controls::CheckBox* )pControl;
|
||||
bool checked = labeled->IsChecked();
|
||||
// Gwen::Controls::CheckBox* labeled = (Gwen::Controls::CheckBox* )pControl;
|
||||
// bool checked = labeled->IsChecked();
|
||||
//m_app->m_stiffness_warp_on = checked;
|
||||
}
|
||||
public:
|
||||
@@ -148,13 +148,13 @@ public:
|
||||
void UpdateText(CProfileIterator* profileIterator, bool idle)
|
||||
{
|
||||
|
||||
static bool update=true;
|
||||
// static bool update=true;
|
||||
|
||||
m_ctrl->SetBounds(0,0,this->GetInnerBounds().w,this->GetInnerBounds().h);
|
||||
|
||||
// if (!update)
|
||||
// return;
|
||||
update=false;
|
||||
// update=false;
|
||||
|
||||
|
||||
static int test = 1;
|
||||
@@ -170,18 +170,18 @@ public:
|
||||
{
|
||||
//recompute profiling data, and store profile strings
|
||||
|
||||
char blockTime[128];
|
||||
// char blockTime[128];
|
||||
|
||||
double totalTime = 0;
|
||||
// double totalTime = 0;
|
||||
|
||||
int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
|
||||
// int frames_since_reset = CProfileManager::Get_Frame_Count_Since_Reset();
|
||||
|
||||
profileIterator->First();
|
||||
|
||||
double parent_time = profileIterator->Is_Root() ? time_since_reset : profileIterator->Get_Current_Parent_Total_Time();
|
||||
|
||||
|
||||
Gwen::Controls::TreeNode* curParent = m_node;
|
||||
// Gwen::Controls::TreeNode* curParent = m_node;
|
||||
|
||||
double accumulated_time = dumpRecursive(profileIterator,m_node);
|
||||
|
||||
|
||||
@@ -238,13 +238,13 @@ struct MyMenuItemHander :public Gwen::Event::Handler
|
||||
|
||||
void onButtonA(Gwen::Controls::Base* pControl)
|
||||
{
|
||||
const Gwen::String& name = pControl->GetName();
|
||||
//const Gwen::String& name = pControl->GetName();
|
||||
Gwen::Controls::TreeNode* node = (Gwen::Controls::TreeNode*)pControl;
|
||||
Gwen::Controls::Label* l = node->GetButton();
|
||||
// Gwen::Controls::Label* l = node->GetButton();
|
||||
|
||||
Gwen::UnicodeString la = node->GetButton()->GetText();// node->GetButton()->GetName();// GetText();
|
||||
Gwen::String laa = Gwen::Utility::UnicodeToString(la);
|
||||
const char* ha = laa.c_str();
|
||||
// const char* ha = laa.c_str();
|
||||
|
||||
//printf("selected %s\n", ha);
|
||||
//int dep = but->IsDepressed();
|
||||
@@ -257,7 +257,7 @@ struct MyMenuItemHander :public Gwen::Event::Handler
|
||||
Gwen::Controls::Label* label = (Gwen::Controls::Label*) pControl;
|
||||
Gwen::UnicodeString la = label->GetText();// node->GetButton()->GetName();// GetText();
|
||||
Gwen::String laa = Gwen::Utility::UnicodeToString(la);
|
||||
const char* ha = laa.c_str();
|
||||
//const char* ha = laa.c_str();
|
||||
|
||||
|
||||
selectDemo(sCurrentHightlighted);
|
||||
@@ -265,10 +265,10 @@ struct MyMenuItemHander :public Gwen::Event::Handler
|
||||
}
|
||||
void onButtonC(Gwen::Controls::Base* pControl)
|
||||
{
|
||||
Gwen::Controls::Label* label = (Gwen::Controls::Label*) pControl;
|
||||
Gwen::UnicodeString la = label->GetText();// node->GetButton()->GetName();// GetText();
|
||||
Gwen::String laa = Gwen::Utility::UnicodeToString(la);
|
||||
const char* ha = laa.c_str();
|
||||
// Gwen::Controls::Label* label = (Gwen::Controls::Label*) pControl;
|
||||
// Gwen::UnicodeString la = label->GetText();// node->GetButton()->GetName();// GetText();
|
||||
// Gwen::String laa = Gwen::Utility::UnicodeToString(la);
|
||||
// const char* ha = laa.c_str();
|
||||
|
||||
|
||||
// printf("onButtonC ! %s\n", ha);
|
||||
@@ -334,7 +334,7 @@ int main(int argc, char* argv[])
|
||||
|
||||
b3Clock clock;
|
||||
|
||||
float dt = 1./120.f;
|
||||
//float dt = 1./120.f;
|
||||
int width = 1024;
|
||||
int height=768;
|
||||
|
||||
@@ -348,8 +348,7 @@ int main(int argc, char* argv[])
|
||||
app->m_window->setKeyboardCallback(MyKeyboardCallback);
|
||||
|
||||
|
||||
GLint err = glGetError();
|
||||
assert(err==GL_NO_ERROR);
|
||||
assert(glGetError()==GL_NO_ERROR);
|
||||
|
||||
sth_stash* fontstash=app->getFontStash();
|
||||
gui = new GwenUserInterface;
|
||||
@@ -376,7 +375,8 @@ int main(int argc, char* argv[])
|
||||
gt->create(256,256);
|
||||
int texId = gt->getTextureId();
|
||||
myTexLoader->m_hashMap.insert("graph1", texId);
|
||||
MyGraphWindow* gw = setupTextureWindow(input);
|
||||
//MyGraphWindow* gw =
|
||||
setupTextureWindow(input);
|
||||
}
|
||||
if (1)
|
||||
{
|
||||
@@ -403,7 +403,8 @@ int main(int argc, char* argv[])
|
||||
int texId = gt->getTextureId();
|
||||
input.m_xPos = width-input.m_width;
|
||||
myTexLoader->m_hashMap.insert("graph2", texId);
|
||||
MyGraphWindow* gw = setupTextureWindow(input);
|
||||
//MyGraphWindow* gw =
|
||||
setupTextureWindow(input);
|
||||
}
|
||||
//destroyTextureWindow(gw);
|
||||
|
||||
@@ -414,8 +415,8 @@ int main(int argc, char* argv[])
|
||||
|
||||
int numDemos = sizeof(allDemos)/sizeof(BulletDemoEntry);
|
||||
|
||||
char nodeText[1024];
|
||||
int curDemo = 0;
|
||||
//char nodeText[1024];
|
||||
//int curDemo = 0;
|
||||
int selectedDemo = loadCurrentDemoEntry(startFileName);
|
||||
Gwen::Controls::TreeNode* curNode = tree;
|
||||
MyMenuItemHander* handler2 = new MyMenuItemHander(-1);
|
||||
@@ -476,8 +477,7 @@ int main(int argc, char* argv[])
|
||||
do
|
||||
{
|
||||
|
||||
GLint err = glGetError();
|
||||
assert(err==GL_NO_ERROR);
|
||||
assert(glGetError()==GL_NO_ERROR);
|
||||
app->m_instancingRenderer->init();
|
||||
DrawGridData dg;
|
||||
dg.upAxis = app->getUpAxis();
|
||||
|
||||
@@ -120,7 +120,7 @@ struct MyButtonHander :public Gwen::Event::Handler
|
||||
void onButtonA( Gwen::Controls::Base* pControl )
|
||||
{
|
||||
Gwen::Controls::Button* but = (Gwen::Controls::Button*) pControl;
|
||||
int dep = but->IsDepressed();
|
||||
// int dep = but->IsDepressed();
|
||||
int tog = but->GetToggleState();
|
||||
if (m_data->m_toggleButtonCallback)
|
||||
(*m_data->m_toggleButtonCallback)(m_buttonId,tog);
|
||||
|
||||
@@ -28,7 +28,7 @@ static GLInstanceGraphicsShape* gCreateGraphicsShapeFromWavefrontObj(std::vector
|
||||
// int numIndices = 0;
|
||||
b3AlignedObjectArray<int>* indicesPtr = new b3AlignedObjectArray<int>;
|
||||
|
||||
for (int s=0;s<shapes.size();s++)
|
||||
for (int s=0;s<(int)shapes.size();s++)
|
||||
{
|
||||
tinyobj::shape_t& shape = shapes[s];
|
||||
int faceCount = shape.mesh.indices.size();
|
||||
@@ -151,7 +151,7 @@ void ImportObjDemo::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
|
||||
btVector3 shift(0,0,0);
|
||||
btVector3 scaling(1,1,1);
|
||||
int index=10;
|
||||
// int index=10;
|
||||
|
||||
{
|
||||
|
||||
@@ -172,7 +172,8 @@ void ImportObjDemo::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
int shapeId = m_app->m_instancingRenderer->registerShape(&gfxShape->m_vertices->at(0).xyzw[0], gfxShape->m_numvertices, &gfxShape->m_indices->at(0), gfxShape->m_numIndices);
|
||||
|
||||
|
||||
int id = m_app->m_instancingRenderer->registerGraphicsInstance(shapeId,position,orn,color,scaling);
|
||||
//int id =
|
||||
m_app->m_instancingRenderer->registerGraphicsInstance(shapeId,position,orn,color,scaling);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ void ImportSTLDemo::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
|
||||
btVector3 shift(0,0,0);
|
||||
btVector3 scaling(10,10,10);
|
||||
int index=10;
|
||||
// int index=10;
|
||||
|
||||
{
|
||||
|
||||
@@ -161,7 +161,8 @@ void ImportSTLDemo::initPhysics(GraphicsPhysicsBridge& gfxBridge)
|
||||
int shapeId = m_app->m_instancingRenderer->registerShape(&gfxShape->m_vertices->at(0).xyzw[0], gfxShape->m_numvertices, &gfxShape->m_indices->at(0), gfxShape->m_numIndices);
|
||||
|
||||
|
||||
int id = m_app->m_instancingRenderer->registerGraphicsInstance(shapeId,position,orn,color,scaling);
|
||||
// int id =
|
||||
m_app->m_instancingRenderer->registerGraphicsInstance(shapeId,position,orn,color,scaling);
|
||||
|
||||
/*
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ bool Bullet2MultiBodyDemo::mouseMoveCallback(float x,float y)
|
||||
//keep it at the same picking distance
|
||||
btVector3 newRayTo = getRayTo(x,y);
|
||||
btVector3 rayFrom;
|
||||
btVector3 oldPivotInB = pickCon->getPivotInB();
|
||||
// btVector3 oldPivotInB = pickCon->getPivotInB();
|
||||
btVector3 newPivotB;
|
||||
m_glApp->m_instancingRenderer->getCameraPosition(rayFrom);
|
||||
btVector3 dir = newRayTo-rayFrom;
|
||||
@@ -186,7 +186,7 @@ bool Bullet2MultiBodyDemo::mouseMoveCallback(float x,float y)
|
||||
|
||||
btVector3 newRayTo = getRayTo(x,y);
|
||||
btVector3 rayFrom;
|
||||
btVector3 oldPivotInB = m_pickingMultiBodyPoint2Point->getPivotInB();
|
||||
// btVector3 oldPivotInB = m_pickingMultiBodyPoint2Point->getPivotInB();
|
||||
btVector3 newPivotB;
|
||||
btVector3 camPos;
|
||||
m_glApp->m_instancingRenderer->getCameraPosition(camPos);
|
||||
@@ -438,7 +438,7 @@ btMultiBody* FeatherstoneDemo1::createFeatherstoneMultiBody(class btMultiBodyDyn
|
||||
btVector4 halfExtents(7.5,0.45,4.5,1);
|
||||
{
|
||||
|
||||
float pos[4]={local_origin[0].x(),local_origin[0].y(),local_origin[0].z(),1};
|
||||
// float pos[4]={local_origin[0].x(),local_origin[0].y(),local_origin[0].z(),1};
|
||||
float quat[4]={-world_to_local[0].x(),-world_to_local[0].y(),-world_to_local[0].z(),world_to_local[0].w()};
|
||||
|
||||
|
||||
@@ -484,7 +484,7 @@ btMultiBody* FeatherstoneDemo1::createFeatherstoneMultiBody(class btMultiBodyDyn
|
||||
{
|
||||
|
||||
btVector3 posr = local_origin[i+1];
|
||||
float pos[4]={posr.x(),posr.y(),posr.z(),1};
|
||||
//float pos[4]={posr.x(),posr.y(),posr.z(),1};
|
||||
|
||||
float quat[4]={-world_to_local[i+1].x(),-world_to_local[i+1].y(),-world_to_local[i+1].z(),world_to_local[i+1].w()};
|
||||
|
||||
@@ -531,8 +531,8 @@ void FeatherstoneDemo1::createGround()
|
||||
{
|
||||
//create ground
|
||||
int cubeShapeId = m_glApp->registerCubeShape();
|
||||
float pos[]={0,0,0};
|
||||
float orn[]={0,0,0,1};
|
||||
//float pos[]={0,0,0};
|
||||
//float orn[]={0,0,0,1};
|
||||
|
||||
|
||||
{
|
||||
@@ -575,7 +575,8 @@ void FeatherstoneDemo1::initPhysics()
|
||||
settings.m_isFixedBase = false;
|
||||
settings.m_basePosition.setValue(0,10,0);
|
||||
settings.m_numLinks = 10;
|
||||
btMultiBody* mb = createFeatherstoneMultiBody(m_dynamicsWorld,settings);
|
||||
//btMultiBody* mb =
|
||||
createFeatherstoneMultiBody(m_dynamicsWorld,settings);
|
||||
|
||||
|
||||
m_glApp->m_instancingRenderer->writeTransforms();
|
||||
@@ -727,7 +728,7 @@ class RagDoll2
|
||||
hull->buildHull(0.01);
|
||||
|
||||
{
|
||||
int strideInBytes = 9*sizeof(float);
|
||||
// int strideInBytes = 9*sizeof(float);
|
||||
int numVertices = hull->numVertices();
|
||||
int numIndices =hull->numIndices();
|
||||
|
||||
@@ -988,7 +989,7 @@ public:
|
||||
|
||||
virtual ~RagDoll2 ()
|
||||
{
|
||||
int i;
|
||||
//int i;
|
||||
/*
|
||||
// Remove all constraints
|
||||
for ( i = 0; i < JOINT_COUNT; ++i)
|
||||
@@ -1027,8 +1028,8 @@ void FeatherstoneDemo2::initPhysics()
|
||||
settings.m_usePrismatic = true;
|
||||
btMultiBody* mb = createFeatherstoneMultiBody(m_dynamicsWorld,settings);
|
||||
*/
|
||||
btVector3 offset(0,2,0);
|
||||
RagDoll2* doll = new RagDoll2(m_dynamicsWorld,offset,m_glApp);
|
||||
// btVector3 offset(0,2,0);
|
||||
//RagDoll2* doll = new RagDoll2(m_dynamicsWorld,offset,m_glApp);
|
||||
|
||||
|
||||
m_glApp->m_instancingRenderer->writeTransforms();
|
||||
|
||||
@@ -307,7 +307,7 @@ void MultiDofDemo::addColliders_testMultiDof(btMultiBody *pMultiBody, btMultiBod
|
||||
|
||||
{
|
||||
|
||||
float pos[4]={local_origin[0].x(),local_origin[0].y(),local_origin[0].z(),1};
|
||||
// float pos[4]={local_origin[0].x(),local_origin[0].y(),local_origin[0].z(),1};
|
||||
float quat[4]={-world_to_local[0].x(),-world_to_local[0].y(),-world_to_local[0].z(),world_to_local[0].w()};
|
||||
|
||||
|
||||
@@ -348,7 +348,7 @@ void MultiDofDemo::addColliders_testMultiDof(btMultiBody *pMultiBody, btMultiBod
|
||||
{
|
||||
|
||||
btVector3 posr = local_origin[i+1];
|
||||
float pos[4]={posr.x(),posr.y(),posr.z(),1};
|
||||
// float pos[4]={posr.x(),posr.y(),posr.z(),1};
|
||||
|
||||
float quat[4]={-world_to_local[i+1].x(),-world_to_local[i+1].y(),-world_to_local[i+1].z(),world_to_local[i+1].w()};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user