# What does this code mean in the source engine [closed]

I am working on a project in which I analyze acceleration in the Source engine. Being that I have very basic knowledge of computer science, I am not very proficient in understanding the syntax.

The code that I am having trouble with is:

mv->m_vecVelocity[i] += accelspeed * wishdir[i];

I am confused as to what the " mv-> " is. Thank you for your help in advance.

line 1745

In particular I am interested in knowing what mv is and what the -> is

• To read C, learn C.
– Anko
May 20, 2015 at 15:29

It's object instance of class CMoveData. It handles movement.

This can be found from code file you posted:

CMoveData *pMove
mv = pMove;


So, mv is CMoveData

The -> is the arrow operator. You can access class pointers using (for example) mv->m_nPlayerHandle.Get(). This is somewhat hard area to understand. There are couple of good answers on stackoverflow about this

Difference of pointer and reference variables

Array operator vs dot

• Thank you. I also learned that -> is a pointer. (as you can see I am a total noob) so I am assuming that mv->m_vecvelocity[i] gets the value of velocity of the movement?
– lyna
May 20, 2015 at 5:35
• Yes, that's how it should work.
– Katu
May 20, 2015 at 5:42
• Thank you very much for your help ^^, I couldn't give you an up arrow since I am new, but take this check mark instead.
– lyna
May 20, 2015 at 5:43

Basically, "mv->" means "the following property of mv".

So, "mv->m_vecVelocity" means "the vector velocity property of the movedata".

"mv" represents kinematic state of a physical object.