update tutorial for SIGGRAPH course
allow multiple graphing windows at the same time
This commit is contained in:
@@ -109,8 +109,15 @@ static ExampleEntry gDefaultExamples[]=
|
||||
ExampleEntry(1,"Constraint Feedback", "The example shows how to receive joint reaction forces in a btMultiBody. Also the applied impulse is available for a btMultiBodyJointMotor", MultiBodyConstraintFeedbackCreateFunc),
|
||||
ExampleEntry(1,"Inverted Pendulum PD","Keep an inverted pendulum up using open loop PD control", InvertedPendulumPDControlCreateFunc),
|
||||
|
||||
|
||||
ExampleEntry(0,"Tutorial"),
|
||||
ExampleEntry(1,"Free Rigid Body","(Preliminary work in progress) Free moving rigid body, without external or constraint forces", TutorialCreateFunc,0),
|
||||
ExampleEntry(1,"Constant Velocity","Free moving rigid body, without external or constraint forces", TutorialCreateFunc,TUT_VELOCITY),
|
||||
ExampleEntry(1,"Gravity Acceleration","Motion of a free falling rigid body under constant gravitational acceleration", TutorialCreateFunc,TUT_ACCELERATION),
|
||||
ExampleEntry(1,"Contact Computation","Discrete Collision Detection for sphere-sphere", TutorialCreateFunc,TUT_COLLISION),
|
||||
ExampleEntry(1,"Solve Contact Constraint","Compute and apply the impulses needed to satisfy non-penetrating contact constraints", TutorialCreateFunc,TUT_SOLVE_CONTACT_CONSTRAINT),
|
||||
|
||||
|
||||
|
||||
ExampleEntry(1,"Spring constraint","A rigid body with a spring constraint attached", Dof6ConstraintTutorialCreateFunc,0),
|
||||
|
||||
#ifdef INCLUDE_CLOTH_DEMOS
|
||||
|
||||
@@ -603,14 +603,18 @@ struct QuickCanvas : public Common2dCanvasInterface
|
||||
if (m_curNumGraphWindows<MAX_GRAPH_WINDOWS)
|
||||
{
|
||||
//find a slot
|
||||
int slot = 0;//hardcoded for now
|
||||
int slot = m_curNumGraphWindows;
|
||||
btAssert(slot<MAX_GRAPH_WINDOWS);
|
||||
if (slot>=MAX_GRAPH_WINDOWS)
|
||||
return 0;//don't crash
|
||||
|
||||
m_curNumGraphWindows++;
|
||||
|
||||
MyGraphInput input(gui->getInternalData());
|
||||
input.m_width=width;
|
||||
input.m_height=height;
|
||||
input.m_xPos = 300;
|
||||
input.m_yPos = height-input.m_height;
|
||||
input.m_xPos = 10000;//GUI will clamp it to the right//300;
|
||||
input.m_yPos = 10000;//GUI will clamp it to bottom
|
||||
input.m_name=canvasName;
|
||||
input.m_texName = canvasName;
|
||||
m_gt[slot] = new GraphingTexture;
|
||||
@@ -625,22 +629,21 @@ struct QuickCanvas : public Common2dCanvasInterface
|
||||
}
|
||||
virtual void destroyCanvas(int canvasId)
|
||||
{
|
||||
btAssert(canvasId==0);//hardcoded to zero for now, only a single canvas
|
||||
btAssert(m_curNumGraphWindows==1);
|
||||
btAssert(canvasId>=0);
|
||||
destroyTextureWindow(m_gw[canvasId]);
|
||||
m_curNumGraphWindows--;
|
||||
}
|
||||
virtual void setPixel(int canvasId, int x, int y, unsigned char red, unsigned char green,unsigned char blue, unsigned char alpha)
|
||||
{
|
||||
btAssert(canvasId==0);//hardcoded
|
||||
btAssert(m_curNumGraphWindows==1);
|
||||
btAssert(canvasId>=0);
|
||||
btAssert(canvasId<m_curNumGraphWindows);
|
||||
m_gt[canvasId]->setPixel(x,y,red,green,blue,alpha);
|
||||
}
|
||||
|
||||
virtual void getPixel(int canvasId, int x, int y, unsigned char& red, unsigned char& green,unsigned char& blue, unsigned char& alpha)
|
||||
{
|
||||
btAssert(canvasId==0);//hardcoded
|
||||
btAssert(m_curNumGraphWindows==1);
|
||||
btAssert(canvasId>=0);
|
||||
btAssert(canvasId<m_curNumGraphWindows);
|
||||
m_gt[canvasId]->getPixel(x,y,red,green,blue,alpha);
|
||||
}
|
||||
|
||||
@@ -982,7 +985,7 @@ void OpenGLExampleBrowser::update(float deltaTime)
|
||||
|
||||
static int skip = 0;
|
||||
skip++;
|
||||
if (skip>10)
|
||||
if (skip>4)
|
||||
{
|
||||
skip=0;
|
||||
//printf("gPngFileName=%s\n",gPngFileName);
|
||||
|
||||
Reference in New Issue
Block a user