Advertisement Jump to content
  • Advertisement

erissian

Member
  • Content Count

    1141
  • Joined

  • Last visited

Community Reputation

727 Good

About erissian

  • Rank
    Contributor
  1. erissian

    splitting function declarations

    More specifically: // BloodyMess.h #include "ExampleFrameListener.h" Quote:Original post by SiCrane class BloodyMessTutorial2Listener : public ExampleFrameListener { public: BloodyMessTutorial2Listener(RenderWindow *win, Camera *cam); bool frameStarted(const FrameEvent& evt); protected: }; // BloodyMess.cpp #include "BloodyMess.h" Quote: BloodyMessTutorial2Listener::BloodyMessTutorial2Listener(RenderWindow *win, Camera *cam) : ExampleFrameListener(win, cam) { } bool BloodyMessTutorial2Listener::frameStarted(const FrameEvent& evt) { return ExampleFrameListener::frameStarted(evt); }
  2. erissian

    Why Are My Random Numbers Not Random?

    Quote:Original post by OneThreeThreeSeven learn to write your own functions D: Did you have something to contribute to that process?
  3. erissian

    Why is this crawling?

    Quote:Original post by smchugh1982 [...] maybe one of you will have a better idea about what is going on. Nope. Try these guys.
  4. erissian

    2D Text and Image Engine

    Most people tend to use 3D libraries even when programming 2D games. Modern computers have special hardware for 3D environments, so you might as well take advantage of that. SDL is a library that does fairly well at abstracting the 3D stuff so you can focus on the 2D. Here's a tutorial on that: http://www.gamedev.net/reference/programming/features/sdl2/default.asp If you've never written a game before, I would take a look at the following, as there really is no such thing as a simple game: http://www.gamedev.net/reference/start_here/
  5. erissian

    How to tell if two segments intersect.

    Please don't crosspost.
  6. erissian

    Ball never stops bouncing

    I'm sure it was the first thing that everybody scrutinized. It is correct as long as your CoR is in [0,1] Feed me numbers: what is the initial velocity? what is the velocity when it collides? does it not slow down at all? you said a certain threshold; what threshold? what is your timestep? Are you handling the collision at the exact moment of intersection?
  7. erissian

    Ball never stops bouncing

    Your velocity will reduce with each bounce, but will continue to have a non-zero velocity. It will follow the pattern vn=viCRn, where n is the number of bounces. The best you can do is set a threshold below which the velocity is set to 0, and work out how many bounces you will allow before it stops. For instance, lets say you have a velocity of 10, you set a threshold of 0.001, and you want it to come to a halt after 6 bounces: CR = n√(vthreshold/vi) CR = 6√(0.001/10) = 0.215 My rule with games is rigid formula, arbitrary numbers; so just tweak the values until it does what you want it to.
  8. Quote:Original post by Ameise I was originally going to determine that body by which body puts the greatest force onto it, but that won't work with an object like the Moon, as technically the Moon orbits the Sun (it pulls with twice the force of the Earth). Note however, that the potential of the Earth-Moon system is significantly less than that of the Sun-Moon system. Approaching this from the perspective of a randomized system, I would do something like this: for each pair if is object A moving fast enough to escape object B continue if is object B moving fast enough to escape object A continue add pair to list keep pair with least potential if A.mass < B.mass A orbits B else B orbits A
  9. Out of curiosity, what is your target and testing architecture?
  10. erissian

    Problem with srand()

    Quote:Original post by birdkingz So is that mean I should use something like time(10) instead of time(0) ? Nope, just listen to Washu and call srand(time(NULL)) a single time: during your initialization routine. My point earlier was that repeatedly seeding with the same number was the likely cause of your problem.
  11. erissian

    Problem with srand()

    Quote:Original post by birdkingz After I change and call the srand once and it's work now :D Thanks Not having seen the actual code used, I can't be positive, but having made this mistake a few times I have a good guess as to what is happening: 1) time(0) returns the time in seconds 2) rand() will return the same sequence of numbers given the same seed value .: srand(time(0)) will seed the same sequence of numbers no matter how many times it is called, until a whole second has passed If you were to collect a coin, your score would implement by 1, and then a new coin is generated. It is possible that the new coin could generate in a position near enough to the last coin that you would collect it immediately. Then, srand(time(0)) would be called again right away - and if less than a second has passed, time(0) would return the same time as it did before, therefore seeding with the same value used before. The following calls to rand() would produce the same output they did previously, causing a coin to generate exactly where it did before. This, of course, would cause you to collect the new coin immediately - and then a new coin would be generated in the same spot again. This would continue to happen until you moved far away enough from that spot, or until a whole second has elapsed. I could easily see this cycle happening several times in a second.
  12. erissian

    What is difference between Velocity and Speed?

    In a practical sense, the above posts are correct. In a computational sense, you will treat speed as the magnitude of a velocity vector. However, the more proper interpretation is that velocity is a measure of displacement over time, where speed is the rate of displacement over time. In other words, a velocity vector may be used to represent that I've moved twelve meters to the left over a period of 50 seconds, even though my path of motion may not have been in a straight line, and my speed has not been constant.
  13. erissian

    Converting from global to local space - problem

    You will have to show how you generate the local transformations in the first place, or else we can't tell if your inversion is correct.
  14. erissian

    DevIL compiler problems

    You should list your libraries in the order of dependencies first. For instance, ILU depends on DevIL, so ILU should be listed first. I'll also take this time to recommend SOIL.
  15. erissian

    The Point of Contact

    Quote:Original post by kryotech I can't really say much about the collision algorithm Can't or won't? If you can't tell us how it works, at least show us some code so we can try to understand what you're using. If you won't, then I reserve the right to be unhelpful and possibly hostile :)
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!