mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 05:40:05 +00:00
don't pass width/height into renderObject
This commit is contained in:
parent
d2e50d045b
commit
e0c3392cee
@ -363,7 +363,7 @@ void TinyRendererSetup::stepSimulation(float deltaTime)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TinyRenderer::renderObject(*m_internalData->m_renderObjects[o], m_internalData->m_width,m_internalData->m_height);
|
TinyRenderer::renderObject(*m_internalData->m_renderObjects[o]);
|
||||||
}
|
}
|
||||||
//m_app->drawText("hello",500,500);
|
//m_app->drawText("hello",500,500);
|
||||||
render->activateTexture(m_internalData->m_textureHandle);
|
render->activateTexture(m_internalData->m_textureHandle);
|
||||||
|
@ -576,7 +576,7 @@ void TinyRendererVisualShapeConverter::render(const float viewMat[16], const flo
|
|||||||
renderObj->m_lightDirWorld = lightDirWorld;
|
renderObj->m_lightDirWorld = lightDirWorld;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TinyRenderer::renderObject(*renderObj,m_data->m_swWidth,m_data->m_swHeight);
|
TinyRenderer::renderObject(*renderObj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//printf("write tga \n");
|
//printf("write tga \n");
|
||||||
|
@ -110,7 +110,7 @@ public:
|
|||||||
int shapeIndex = OpenGLGuiHelper::registerGraphicsShape(vertices,numvertices,indices,numIndices);
|
int shapeIndex = OpenGLGuiHelper::registerGraphicsShape(vertices,numvertices,indices,numIndices);
|
||||||
if (shapeIndex>=0)
|
if (shapeIndex>=0)
|
||||||
{
|
{
|
||||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_swWidth,m_swHeight,m_rgbColorBuffer,m_depthBuffer);
|
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
|
||||||
float rgbaColor[4] = {1,1,1,1};
|
float rgbaColor[4] = {1,1,1,1};
|
||||||
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
||||||
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
||||||
|
@ -253,7 +253,7 @@ struct TinyRendererGUIHelper : public GUIHelperInterface
|
|||||||
{
|
{
|
||||||
int shapeIndex = m_swRenderObjects.size();
|
int shapeIndex = m_swRenderObjects.size();
|
||||||
|
|
||||||
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_swWidth,m_swHeight,m_rgbColorBuffer,m_depthBuffer);
|
TinyRenderObjectData* swObj = new TinyRenderObjectData(m_rgbColorBuffer,m_depthBuffer);
|
||||||
float rgbaColor[4] = {1,1,1,1};
|
float rgbaColor[4] = {1,1,1,1};
|
||||||
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
swObj->registerMeshShape(vertices,numvertices,indices,numIndices,rgbaColor);
|
||||||
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
//swObj->createCube(1,1,1);//MeshShape(vertices,numvertices,indices,numIndices);
|
||||||
|
@ -231,8 +231,11 @@ TinyRenderObjectData::~TinyRenderObjectData()
|
|||||||
delete m_model;
|
delete m_model;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TinyRenderer::renderObject(TinyRenderObjectData& renderData, int width, int height)
|
void TinyRenderer::renderObject(TinyRenderObjectData& renderData)
|
||||||
{
|
{
|
||||||
|
int width = renderData.m_rgbColorBuffer.get_width();
|
||||||
|
int height = renderData.m_rgbColorBuffer.get_height();
|
||||||
|
|
||||||
Vec3f light_dir_local = Vec3f(renderData.m_lightDirWorld[0],renderData.m_lightDirWorld[1],renderData.m_lightDirWorld[2]);
|
Vec3f light_dir_local = Vec3f(renderData.m_lightDirWorld[0],renderData.m_lightDirWorld[1],renderData.m_lightDirWorld[2]);
|
||||||
Model* model = renderData.m_model;
|
Model* model = renderData.m_model;
|
||||||
if (0==model)
|
if (0==model)
|
||||||
|
@ -47,7 +47,7 @@ struct TinyRenderObjectData
|
|||||||
class TinyRenderer
|
class TinyRenderer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void renderObject(TinyRenderObjectData& renderData, int width, int height);
|
static void renderObject(TinyRenderObjectData& renderData);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // TINY_RENDERER_Hbla
|
#endif // TINY_RENDERER_Hbla
|
||||||
|
@ -86,7 +86,7 @@ int main(int argc, char* argv[])
|
|||||||
b3AlignedObjectArray<float> depthBuffer;
|
b3AlignedObjectArray<float> depthBuffer;
|
||||||
depthBuffer.resize(gWidth*gHeight);
|
depthBuffer.resize(gWidth*gHeight);
|
||||||
|
|
||||||
TinyRenderObjectData renderData(textureWidth, textureHeight,rgbColorBuffer,depthBuffer);//, "african_head/african_head.obj");//floor.obj");
|
TinyRenderObjectData renderData(rgbColorBuffer,depthBuffer);//, "african_head/african_head.obj");//floor.obj");
|
||||||
|
|
||||||
//renderData.loadModel("african_head/african_head.obj");
|
//renderData.loadModel("african_head/african_head.obj");
|
||||||
renderData.loadModel("floor.obj");
|
renderData.loadModel("floor.obj");
|
||||||
|
Loading…
Reference in New Issue
Block a user