Hello,
I am going through a book concerning physics simulation and gradually porting
is to AS3.
My problem is that the variable type is being called in the code, and I have no
idea what it does:
Function:
1 2 3 4 5 6 7 8 9
|
/** Turns a non-zero vector into a vector of unit length. */
void normalize()
{
real l = magnitude();
if (l > 0)
{
(*this)*=((real)1)/l;
}
}
|
Line in question:
(*this)*=((real)1)/l;
I know that 'real' is simply the data type (it's defined as a float elsewhere
in the code,) but how C++ treats it, I have no idea.
Any help would be much appreciated.
On a side note, I am currently trying to learn C++ as well but AS3 has been
giving me a good grasp on OOP basics for now, memory management and
pointers are a large headache right now and I figured developing flash games
in the meantime would expand my general knowledge.
Great community and site you got here, archaic looking, but wonderful in it's
simplicity.
-DGM