GuiObjectView Rotation fix
by Glenn Bermingham · 10/16/2013 (5:23 pm) · 5 comments
Not my findings but I thought I'd share this in a resource form.
In Engine/T3D/guiObjectView.cpp
Change:
then change
Kudos:
http://www.garagegames.com/community/forums/viewthread/126414/1#comment-825677
http://www.garagegames.com/community/forums/viewthread/130599/1#comment-829003
In Engine/T3D/guiObjectView.cpp
Change:
mCameraRot.set( 0.0f, 0.0f, 3.9f ); mCameraPos.set( 0.0f, 1.75f, 1.25f );to
mCameraRot.set( 0.0f, 0.0f, 0.0f ); mCameraPos.set( 0.0f, 0.0f, 0.0f );
then change
SceneRenderState state
(
gClientSceneGraph,
SPT_Diffuse,
SceneCameraState( GFX->getViewport(), frust, GFX->getWorldMatrix(), GFX->getProjectionMatrix() ),
renderPass,
false
);toSceneRenderState state
(
gClientSceneGraph,
SPT_Diffuse,
SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
renderPass,
false
);Kudos:
http://www.garagegames.com/community/forums/viewthread/126414/1#comment-825677
http://www.garagegames.com/community/forums/viewthread/130599/1#comment-829003
About the author
I spend most of my time working on games.
#2
10/17/2013 (2:03 am)
you should add this as a pull request!
#3
10/23/2013 (5:25 am)
Same thing i had to do to fix it, but i don't think it was ever added to the repo.
#4
setting mCameraRot and mCameraPos value to 0 was an temporary fix.may be that is why, it was never merged into repo.
if u dig into github pull requests, u will see discussion on that matter.
i have fixed this issue(+some other major improvements on gui side).
i will try to test it with development branch and will push it.
10/24/2013 (5:28 am)
"i don't think it was ever added to the repo."setting mCameraRot and mCameraPos value to 0 was an temporary fix.may be that is why, it was never merged into repo.
if u dig into github pull requests, u will see discussion on that matter.
i have fixed this issue(+some other major improvements on gui side).
i will try to test it with development branch and will push it.
#5
i have cheched it out.then tried to build.
got 18 errors into "gfx\gl\gfxglwindowtarget.cpp".
"
Error 22 error C2664: 'GFXGLPreserveInteger::GFXGLPreserveInteger(GLenum,GLint,GFXGLPreserveInteger::BindFn)' :
cannot convert parameter 3 from 'void (__stdcall *)(GLenum,GLuint)' to 'GFXGLPreserveInteger::BindFn' d:\torque3d git\engine\source\gfx\gl\gfxglwindowtarget.cpp 62
"
************************************************
for now,here is quick copy paste:
at end of
"void GuiObjectView::setObjectModel( const String& modelName)"
and
"bool GuiObjectView::onWake()"
add:
10/24/2013 (5:32 am)
dont know what wrong is happening on developemnt branch!!!!!!!!!!!!!!i have cheched it out.then tried to build.
got 18 errors into "gfx\gl\gfxglwindowtarget.cpp".
"
Error 22 error C2664: 'GFXGLPreserveInteger::GFXGLPreserveInteger(GLenum,GLint,GFXGLPreserveInteger::BindFn)' :
cannot convert parameter 3 from 'void (__stdcall *)(GLenum,GLuint)' to 'GFXGLPreserveInteger::BindFn' d:\torque3d git\engine\source\gfx\gl\gfxglwindowtarget.cpp 62
"
************************************************
for now,here is quick copy paste:
void GuiObjectView::fitToShape()
{
if ( !mModel )
return;
Box3F bounds;
if ( mModel )
mModel->computeBounds( 0, bounds );
mOrbitPos = bounds.getCenter();
F32 len_x = bounds.len_x();
F32 len_z = bounds.len_z();
F32 shapeRadius = mSqrt( len_x*len_x + len_z*len_z ) / 2;
F32 viewRadius = 0.45f * getMin( getExtent().x, getExtent().y );
mOrbitDist = ( shapeRadius / viewRadius ) * mSaveWorldToScreenScale.y;
}at end of
"void GuiObjectView::setObjectModel( const String& modelName)"
and
"bool GuiObjectView::onWake()"
add:
fitToShape();
mCameraRot.set( 0.0f, 0.0f, 3.9f ); mCameraPos.set( 0.0f, 1.75f, 1.25f );
SceneRenderState state
(
gClientSceneGraph,
SPT_Diffuse,
SceneCameraState( GFX->getViewport(), frust, MatrixF::Identity, GFX->getProjectionMatrix() ),
renderPass,
false
); 
Torque Owner Quinton Delpeche
Gobbo Games
Thanks ... now I can remove that and let players rotate their model. 8-}
Much obliged ... 8-}