Results 1 to 4 of 4

Thread: [AI movement] Jumping using movegravity()

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Private
    Join Date
    Jan 2013
    Location
    Hungary
    Posts
    113
    Thanks
    10
    Thanked 74 Times in 45 Posts
    I have also wrote a sqrt function, its accurate to 6 decimals:
    PHP Code:
    sqrt)
    {
        
    0;
        for ( 
    1<= 1000000*= 10 )
        {
            while ( 
    <= )
                
    += (i);

            if ( 
    )
                
    -= (i);
        }

        return 
    a;

    To increase the accuracy write a bigger number in 'for' cycle.

    And an other mathematical function:
    PHP Code:
    vectorCross(vec1vec2)
    {
        
    result =
        (
    vec1[1]*vec2[2] - vec2[1]*vec1[2]) -
        (
    vec1[0]*vec2[2] - vec2[0]*vec1[2]) +
        (
    vec1[0]*vec2[1] - vec2[0]*vec1[1]);

        return 
    result;


  2. The Following 2 Users Say Thank You to randall For This Useful Post:

    kung foo man (18th May 2013),Ni3ls (18th May 2013)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •