[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [31936] trunk/blender/source/gameengine/ Ketsji/KX_Dome.cpp: BGE Dome: fix for " objects parented to the camera will be rendered multiple times in Dome mode "

Dalai Felinto dfelinto at gmail.com
Wed Sep 15 09:05:55 CEST 2010


Revision: 31936
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=31936
Author:   dfelinto
Date:     2010-09-15 09:05:55 +0200 (Wed, 15 Sep 2010)

Log Message:
-----------
BGE Dome: fix for "objects parented to the camera will be rendered multiple times in Dome mode"

The funny thing is: I only spotted this bug in March of this year. Almost one year after the original release. I think I don't parent objects to the camera often.

In terms of code I think that I can even think in a more elegant solution. I don't really need to rotate the camera, but simply to calculate its Modelview Matrix.
"""
m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), 1.0);
cam->SetModelviewMatrix(viewmat);
"""
The reason why I originally was rotating the camera was to make sure the frustum calculation was using the right camera frustum. For the frustum it takes the camera modelviewmatrix so the rotation really shouldn't be necessary. Leaving as it's for the time being.

* Note: the bug was never officially reported

Modified Paths:
--------------
    trunk/blender/source/gameengine/Ketsji/KX_Dome.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_Dome.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Dome.cpp	2010-09-15 06:43:36 UTC (rev 31935)
+++ trunk/blender/source/gameengine/Ketsji/KX_Dome.cpp	2010-09-15 07:05:55 UTC (rev 31936)
@@ -2049,11 +2049,11 @@
 	m_rasterizer->SetViewMatrix(viewmat, cam->NodeGetWorldOrientation(), cam->NodeGetWorldPosition(), 1.0);
 	cam->SetModelviewMatrix(viewmat);
 
-	scene->CalculateVisibleMeshes(m_rasterizer,cam);
-	scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
-	
 	// restore the original orientation
 	cam->NodeSetLocalOrientation(camori);
 	cam->NodeUpdateGS(0.f);
+
+	scene->CalculateVisibleMeshes(m_rasterizer,cam);
+	scene->RenderBuckets(camtrans, m_rasterizer, m_rendertools);
 }
 





More information about the Bf-blender-cvs mailing list