Pixle Calc. Problem

This is a discussion on Pixle Calc. Problem within the Game Programming forums, part of the General Programming Boards category; 1) Yes, it is as you guessed it, to allow the programmer to use the returnvalue if he or she ...

  1. #16
    Registered User
    Join Date
    Aug 2003
    Posts
    1,200
    1) Yes, it is as you guessed it, to allow the programmer to use the returnvalue if he or she wants to instead of setting a global flag.

    2) I do that to have smaller values on speeds and suck. If I didnt multiply with 50.0f all values (read all speed-values) would have to be 50 times bigger than what they are now. This can by the way be any number of your choice, so it is not required for the function to work.

    3) Because that is how you get the time elapsed betwean 2 QueryPerformanceCounter calls, you have to divide them with the frequency.

  2. #17
    Call me AirBronto
    Join Date
    Sep 2004
    Location
    Indianapolis, Indiana
    Posts
    195
    sorry but i dont really understand your second explination.

    First off, whouldnt multiplying the time by a number over one, ie 50, make speed and other such values bigger, not smaller?

    Second, i have changed that value a number of times and it has not altered the speed, or any such variable connected with time, like gravity. i changed it to 150, 200, 1, ect., so i did change it an amount that should of been noticeable.

  3. #18
    S Sang-drax's Avatar
    Join Date
    May 2002
    Location
    GŲteborg, Sweden
    Posts
    2,072
    Quote Originally Posted by loopshot
    Second, i have changed that value a number of times and it has not altered the speed, or any such variable connected with time, like gravity. i changed it to 150, 200, 1, ect., so i did change it an amount that should of been noticeable.
    You have to actually use procPower when you are calculating the movement of your objects.
    Last edited by Sang-drax : Tomorrow at 02:21 AM. Reason: Time travelling

  4. #19
    Registered User
    Join Date
    Aug 2003
    Posts
    1,200
    Ok ill try to explain better, here is some code that I think will do:
    Code:
    // This is what it looks like with that function as is:
    car.posX += car.speed*car.normalVectorX*procPower;
    car.posY += car.speed*car.normalVectorY*procPower;
    Now, if I didnt multiply with 50.0f when I calculate procPower car.speed would have to be 50 times bigger to get the same result.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 10:22 AM
  2. Someone having same problem with Code Block?
    By ofayto in forum C++ Programming
    Replies: 1
    Last Post: 07-12-2007, 08:38 AM
  3. A question related to strcmp
    By meili100 in forum C++ Programming
    Replies: 6
    Last Post: 07-07-2007, 02:51 PM
  4. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  5. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 05:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21