|
-
February 21st, 2010, 05:39 PM
#1
error 2064
Okay. Trying to work out the seek algorithm and I ran into this problem.
error 2064 term does not evaluate to a function taking 0 arguments
this is the piece of code that the error message takes me to
//----------------------------------------------------------------------------
Vector2D SteeringBehaviors::Seek(Vector2D TargetPos)
{
THIS ONE---> Vector2D DesiredVelocity = Vec2DNormalize(TargetPos - pRunner->Pos())* pRunner->maxSpeed();
return (DesiredVelocity - pRunner->Velocity);
}
here is the normalize function from my Vector2D class
//------------------------------------------------------------------------
inline Vector2D Vec2DNormalize(const Vector2D &v)
{
Vector2D vec = v;
double vector_length = vec.Length();
if (vector_length > std::numeric_limits<double>::epsilon())
{
vec.x /= vector_length;
vec.y /= vector_length;
}
return vec;
}
cany anyone tell me why I'm getting this error message!?
-
February 21st, 2010, 06:12 PM
#2
Re: error 2064
Code:
Vec2DNormalize(const Vector2D &v)
Code:
Vec2DNormalize(TargetPos - pRunner->Pos())
You aren't parsing a Vector2D object, but a number.
-
February 22nd, 2010, 12:23 AM
#3
Re: error 2064
 Originally Posted by Skizmo
You aren't parsing a Vector2D object, but a number.
Although this is wrong, I think that OP's error is different. I guess that either Pos or maxSpeed is a data member of pRunner. not a function.
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|