Game Development Community

C++ Type Help

by Richard_H · in Torque Game Engine · 09/20/2006 (3:13 pm) · 3 replies

Question 1:
I am learning to alter the torque source, but I can't remember where all the types are (F32, S32 stuff like that). A main type I am looking for is either a string or a vector.

Question 2:
Once I find a vector how could I use it to complete my code below (in math/mConsoleFunctions.cc) .
(I added #include "console/consoleFunctions.cc" to allow for getWord)
ConsoleFunction( RotateVectorOnZ, VECTOR, 2, 2, "(vector Vec, float angle)")
{
	double X = dAtof(getUnit(argv[1],1," \t\n"));
	double Y = dAtof(getUnit(argv[1],2," \t\n"));
	double Z = dAtof(getUnit(argv[1],3," \t\n"));
	
	double rdAngle = mDegToRad(dAtof(argv[1]));
	
	double rX = (X*mCos(rdAngle))-(Y*mSin(rdAngle));
	double rY = (X*mSin(rdAngle))+(Y*mCos(rdAngle));
	double rZ = Z;
	//Code needed for converting to a vector and returning it
}
Note I am converting code from this forum to C++ to make it run faster.
www.garagegames.com/mg/forums/result.thread.php?qt=33277

Any help fixing and optimizing my code would be greatly apreciated, just try not to keep it way over my head.
Thanks in advance. :)

#1
09/20/2006 (7:53 pm)
If you are using Visual Studio, you can just right-click the type you want, and choose "go to declaration" to see where it is declared.
#2
09/21/2006 (3:45 am)
I'm using XCode on a mac so I can't do that, but can you check where they are defined? Maybe it's all one file I'm missing.
#3
09/30/2006 (8:22 am)
Found it!

types.h under the platform folder