Game Development Community

World editor Axis Gizmo bug fix

by Drew Parker · in Torque Game Engine · 01/11/2005 (7:56 am) · 4 replies

Hi all,

Here is a bugfix for the World Editor's axis gizmo.

Updating world editor "axis gizmos"

This is from a thread a while back, but I didn't see it posted to the bugs section, so I want to make sure people know about it, and hopefully Ben or someone can stick it in the HEAD. I"ve been using it in my build for a number of months and haven't had any problems.


The culprit is in WorldEditor::collideAxisGizmo(...) in worldeditor.cc
Change this:
bool WorldEditor::collideAxisGizmo(const Gui3DMouseEvent & event)
{
   //...

   // get the projected size...
   SceneObject * obj = getControlObject();
   if(!obj)
      return(false);

   //
   Point3F camPos;
   obj->getTransform().getColumn(3, &camPos);

   //...

To this:

bool WorldEditor::collideAxisGizmo(const Gui3DMouseEvent & event)
{
  // ...

   // get the projected size...
   GameConnection* connection = GameConnection::getServerConnection();
   if(!connection)
      return false;
   
   // Grab the camera's transform
   MatrixF mat;
   connection->getControlCameraTransform(0, &mat);

   // Get the camera position
   Point3F camPos;
   mat.getColumn(3,&camPos);

   //....

#1
01/12/2005 (3:49 pm)
I was looking for something to fix this, gets really annoying.
Off-topic: I saw you found a solution for the orbit camera so it's controlled by the mouse and smoother, and I was wondering if you could help me out to implement it, it's exactly the type of camera I'm looking for my game.
Thanks
#2
03/26/2005 (11:46 am)
@Drew,
my god man thank you for this. I can't believe I lived with that problem for so long much nicer :)

spring cleaning -clint
#3
03/26/2005 (1:04 pm)
Thank you - I love it!
#4
03/27/2005 (8:35 am)
.