CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: error 2064

  1. #1
    Join Date
    Feb 2010
    Posts
    1

    Unhappy 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!?

  2. #2
    Join Date
    Sep 2004
    Location
    Holland (land of the dope)
    Posts
    4,123

    Re: error 2064

    Code:
    Vec2DNormalize(const Vector2D &v)
    Code:
    Vec2DNormalize(TargetPos - pRunner->Pos())
    You aren't parsing a Vector2D object, but a number.

  3. #3
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656

    Re: error 2064

    Quote Originally Posted by Skizmo View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured