GuiObjectView issue
by Ron Yacketta · in Torque Game Engine · 04/04/2002 (8:26 am) · 10 replies
Folks,
I have noticed that the GuiObjectView (perso.wanadoo.fr/hysteria/docs/guiCtrls.htm)
is a bit wierd ;)
If you rotate the object in the view, switch to a different object the new object still has the same rotation as the previous.
I have not looked into the code, but it would seem that a simple call to setEmpty() before viewing a new object could resolve this.
-Ron
I have noticed that the GuiObjectView (perso.wanadoo.fr/hysteria/docs/guiCtrls.htm)
is a bit wierd ;)
If you rotate the object in the view, switch to a different object the new object still has the same rotation as the previous.
I have not looked into the code, but it would seem that a simple call to setEmpty() before viewing a new object could resolve this.
-Ron
#2
10/22/2002 (8:41 pm)
How do you rotate an object around in the object view automatically?
#3
10/23/2002 (12:24 am)
There is an attribute 'rotate' (from memory) that you can set to 1 if you need the object to rotate around its Z axis.
#4
10/30/2002 (9:38 pm)
the cameraZRot property setting seems to have no bearing. I must be missing something obvious.
#5
2 things I am stuck with,
1. I uncommented the animation code to make the objects run the ambient animation sequence but it played very choppy, not constant and smooth.
2. I can't figure out how to clear the view so that no shape is shown.
Any pointers? Thank you.
Robert
11/17/2002 (3:06 pm)
I must be missing something because I don't have a rotate property in my guiobjectview. Is there a newer version of the downloadable source than what I have?2 things I am stuck with,
1. I uncommented the animation code to make the objects run the ambient animation sequence but it played very choppy, not constant and smooth.
2. I can't figure out how to clear the view so that no shape is shown.
Any pointers? Thank you.
Robert
#6
11/17/2002 (6:39 pm)
The only thing I dont like and the real reason I dont use the control is that it uses a different resManager file. Is there no way to use the original manager to call this? I may be paranoid but changing the resManager to accept 1 var instead of 2, wouldnt that effect the other files that havent been edited that are calling resManager and are still using 2 vars?
#7
11/17/2002 (11:28 pm)
There should be no pb as i just overload the function. So if the function is called with two parameters, then it will not use mine :)
#8
11/18/2002 (7:47 pm)
Oh, Robert I dont think the control renders in OpenGL mode, I may be mistaken but I think the TS Controls are the only ones that do ( Like in -show ). This may be why its choppy.
#9
I wonder if the strange axis is a world orientation instead of an object orientation?
Researching.
05/29/2004 (12:44 pm)
CameraZRot seems to rotate around a strange axis. Or else the objects I am pickig up all have their origins in wierd places. When I rotate the object in increments it rotates out of view.I wonder if the strange axis is a world orientation instead of an object orientation?
Researching.
#10
Robert, you can simply rotate an object automatically around, in the object view, with small changes in the engine code.
If you are using the GuiObjectView Tutorial under the page:
perso.wanadoo.fr/hysteria/docs/guiCtrls.htm
all you need to do is to add the following lines to the guiObjectView.h and guiObjectView.cc :
* New Lines in guiObjectView.h:
First we should add a variable for rotation. So add the line
bool rotatingObj;
to the end of the protected variables in guiObjectView.h
**New Lines in guiObjectView.cc:
add the following line to the end of the constructor (that is GuiObjectView::GuiObjectView() : GuiTSCtrl() )
rotatingObj = true;
and add the following lines at the
beginning of the function " bool GuiObjectView::processCameraQuery( CameraQuery* query ) "
//rotate Object
if(rotatingObj)
mCameraRot.z += 0.01 ;
Thus, you start with a rotating object in GuiObjectView and you can stop the rotation by setting rotatingObj to false ( but you need to add a set method since we have set the rotatingObj variable as protected.)
If I haven't misunderstand what you are looking for this should solve the rotation problem.
11/01/2006 (4:22 am)
Hi,Robert, you can simply rotate an object automatically around, in the object view, with small changes in the engine code.
If you are using the GuiObjectView Tutorial under the page:
perso.wanadoo.fr/hysteria/docs/guiCtrls.htm
all you need to do is to add the following lines to the guiObjectView.h and guiObjectView.cc :
* New Lines in guiObjectView.h:
First we should add a variable for rotation. So add the line
bool rotatingObj;
to the end of the protected variables in guiObjectView.h
**New Lines in guiObjectView.cc:
add the following line to the end of the constructor (that is GuiObjectView::GuiObjectView() : GuiTSCtrl() )
rotatingObj = true;
and add the following lines at the
beginning of the function " bool GuiObjectView::processCameraQuery( CameraQuery* query ) "
//rotate Object
if(rotatingObj)
mCameraRot.z += 0.01 ;
Thus, you start with a rotating object in GuiObjectView and you can stop the rotation by setting rotatingObj to false ( but you need to add a set method since we have set the rotatingObj variable as protected.)
If I haven't misunderstand what you are looking for this should solve the rotation problem.
Torque 3D Owner Frank Bignone
Darkhand Studio