Beispiel #1
0
void SceneObject::Draw(GraphicContext &gc, const Mat4f &current_modelview)
{
	UpdateOrientationMatrix();
	UpdateModelViewMatrix(current_modelview);

	std::vector<SceneObject *>::size_type size, cnt;
	size = child_objects.size();
	for (cnt=0; cnt< size; cnt++)
	{
		child_objects[cnt]->Draw(gc, modelview_matrix);
	}
}
void SceneObject::Draw(CL_GraphicContext &gc, const CL_Mat4f &current_modelview, bool is_draw_shadow)
{
	UpdateOrientationMatrix();
	UpdateModelViewMatrix(current_modelview);

	if (!model.is_null())
		model.Draw(gc, scene->gs, modelview_matrix, is_draw_shadow);

	std::vector<SceneObject *>::size_type size, cnt;
	size = child_objects.size();
	for (cnt=0; cnt< size; cnt++)
	{
		child_objects[cnt]->Draw(gc, modelview_matrix, is_draw_shadow);
	}
}
void BallsView::Activate(){
	if(!active){
		glGetDoublev(GL_PROJECTION_MATRIX, savedProjMatrix.elements);
		glGetDoublev(GL_MODELVIEW_MATRIX, savedModelViewMatrix.elements);
		if(needProjUpdate){
			UpdateProjectionMatrix();
			needProjUpdate = false;
		}
		if(needModelViewUpdate || camera.IsChanged()){
			UpdateModelViewMatrix();
			needModelViewUpdate = false;
		}
		glMatrixMode(GL_PROJECTION);
		glLoadMatrixd(projMatrix.elements);
		glMatrixMode(GL_MODELVIEW);
		glLoadMatrixd(modelViewMatrix.elements);
		active = true;
	}
}