Game Development Community

[BUG 1.1Beta1] Orbit Camera Current Distance is ignored - LOGGED

by Justin Knight · in Torque 3D Professional · 03/01/2010 (4:45 am) · 2 replies

When setting the camera into orbit camera mode using the setOrbitMode method there is an option 'curDist' parameter which should set the current distance of the camera from the object being orbited. This parameter is saved in a member variable of the camera but never used. The camera distance appears to be being set to maxDist instead.

In terms of functionality it would also be useful to have methods to set and get the current camera distance. I implemented these before I noticed that mCurOrbitDist was being ignored:

Add to public section in camera.h:
F32 getOrbitDistance() {  return mCurOrbitDist; };
   void setOrbitDistance( F32 dist) {  mCurOrbitDist = dist; };

Add to camera.cpp:
ConsoleMethod( Camera, setOrbitDistance, void, 3, 3, "(F32)"
              " - Set orbit distance used in orbit camera mode")
{
   object->setOrbitDistance(dAtof(argv[2]));
}

ConsoleMethod( Camera, getOrbitDistance, const char *, 2, 2, "()"
              " - Get the current orbit distance used in orbit camera mode.nn"
              "@returns The orbit distance.")
{
   static char buffer[256];

   F32 orbitDistance = object->getOrbitDistance();
   dSprintf(buffer, sizeof(buffer),"%g",orbitDistance);
   return buffer;
}

#1
08/21/2010 (6:46 am)
Logged as TQA-866.
#2
09/08/2011 (12:00 pm)
This is fixed in Final (thanks GG :)

Using the console methods I outlined before now correctly allow you to zoom in and out whilst in orbit camera mode.