• Content count

  • Joined

  • Last visited

Community Reputation

1019 Excellent

About Kazade

  • Rank
    Advanced Member
  1. Randy, I'm not sure what you mean about fixing up the velocity, could you elaborate? Thanks!
  2. Thanks Randy, that's really helpful. I think I'm basically doing the right thing but something else is wrong... I realized I should probably be dividing impulse by the timestep right? (e.g. * (1/60))
  3. OK, I'm having much more trouble with this than I expected...   Say that 3 "wheels" intersect with the terrain, and I have their intersection points, penetration depths and impact normals, I assumed that I could move the car back a little bit so it wasn't intersecting, and then apply impulses at each of the 3 points (using the velocities at those points multiplied by the mass) to orient the vehicle with the terrain. In my mind that would work just as you'd expect - except that doesn't work at all - the car just flips around and flies into the air.   Can anyone give me some guidance on how to calculate the impulses to apply at each wheel? Also, what vector should I be using to move the car so that it's not intersecting? I figured I'd just move it by the greatest penetration depth of all the wheels, but then should I only apply an impulse on the wheel with the deepest penetration?
  4. Yeah, you're totally right. I should move the body first by the direction of the floor's normal * the penetration depth. Then apply an impulse of the reverse of the velocity projected onto the normal.   I was thinking I could do everything with impulses, but I'm not sure that's possible (you need to move the body from penetrating in a single step and changing the velocity isn't going to help with that).
  5. Hi!   I'm working on a game that features a tank running over a heightmap terrain (and other objects). I have a basic rigid body physics engine with OBB colliders, I also have the ability to cast rays that intersect the terrain. What I want to do is project 5 individual rays downward to orient the tank with the terrain. That's 1 ray per corner of the OBB, and an additional ray at its center so that things don't look weird if it drives over the edge of something. The tank is affected by gravity.   When a ray intersects the ground, I need to apply an upward impulse to the body at the intersection point which needs to counteract the downward velocity, but also move the body so that it's no longer intersecting.   So my question is... given the following inputs:    - Ray start, direction and length  - Intersection point, distance and normal  - Body linear velocity at the intersection point   How do I calculate the upward impulse to apply for that ray to keep it from sinking, or bouncing? I just want the tank to hug the terrain tightly so I'm hoping I can avoid all the spring/suspension forces that are normally applied to cars.   Thanks!  
  6. I've implemented 2D collision detection using the GJK and EPA algorithms which provides the intersection normal and penetration depth, but to implement decent collision response I need to find the intersection point. I've been searching for the answer for a while now but I can't find anything. Could someone explain how to find the intersection point?
  7. @Mike, just a few questions about that equation: Is "timestep" the fractional 1/60.0 or the number of steps in a second (e.g. 60)? Is "angle", the result of acos(desired.dot(current)) ? Is "angular velocity" the current angular velocity of the ship? What's "moment of inertia"? Sorry if I'm being dumb :)
  8. Yeah, I need to do that. So I've worked out that angular rotation is represented by the axis of rotation, and the magnitude is the amount of rotation. This means that I can use the cross-product between the two vectors to work out the torque I need to apply.   This seems to work for small rotations, but the moment my ship crashes into something the whole thing goes haywire. I'm going to debug some more but if using the cross-product is a bad idea for some reason please let me know! Are there edge cases when the difference between the two vectors is large?
  9. This seems like it should be simple, but I've been struggling with it for a while.   I have a starship that has an associated ODE body. I'm trying to get the starship to follow a path. So I calculate the desired heading as a vector.   The problem is I need to find the angular force to apply (as a vector) to rotate the ship from its current heading (forward vector) to face the desired heading.   Could someone explain how to calculate that angular force?    
  10. I'm working on some basic AI for a fighter game, and I'm trying to get the ships to fly into a formation. To calculate the amount of torque I need to apply to each ship so that it turns towards the desired heading I'm using a PID controller very similar to the one in the first answer here: http://answers.unity3d.com/questions/199055/addtorque-to-rotate-rigidbody-to-look-at-a-point.html   So, I have the current heading of the ship, and the desired heading, and I need to pass an error value into the PID controller so that it can correct the heading.   In the linked example, the poster uses the cross product of the desired heading and current heading. This works perfectly if the angle between the headings is < 90 degrees, if it's greater than 90 degrees then the cross product is flipped and the PID controller starts correcting to the opposite direction than I want!   I'm struggling to figure out what vec3 error value will work in all cases, even if there is a large angle between the desired and actual heading. Any ideas?
  11. Radial Blur tutorial link broken?

    Should be working fine now
  12. Hi torelocks, Sorry you are having trouble with the source code that came with the book. Could you try the latest bug fix release from here: http://www.kazade.co.uk/downloads/boglgp/ Let me know if you still have trouble, Thanks, Luke.
  13. NeHe's legacy tutorials and LWJGL are outdated!

    [quote name='TranquilMarmot' timestamp='1314666290' post='4855269'] LWJGL has been updated many (many) times since all the tutorials were written, or at least since they were converted. I'm going to be reading through (hopefully) all of the tutorials and converting them to LWJGL for my own learning purposes anyway, so i figure i might as well share the code. No use keeping to myself what I can share for free. I guess what I came here to ask is whether or not it would be worth it to go through the extra time and effort to add extra comments, write readmes, etc. etc. If I were to do all that and put them in a nice zip or jar file, would I be able to send them to NeHe and have them replace the old, outdated conversions? Or is the website 'dead'? [/quote] Hey, We are planning a new set of tutorials that will bring the old ones up-to-date. So, it's probably not worth updating the existing ones. But, when the new ones are released you are more than welcome to port those! The delay at the moment is that the site is now hosted on Google AppEngine and they dropped a bombshell price increase on us the other day so all my free time is going on optimizing the site to reduce the billing cost. Just a bit more optimizing to do and then I can begin work on the new lessons Stay tuned! Luke.
  14. Licencing for NeHe's TGA image loader

    IANAL, but the original tutorials were written to be used freely, so you should be fine. The NeHe readme says "If you use this code in project of your own, send a shout out to the author!" so I think as long as you name the authors of the tutorial (normally Jeff Molofee combined with another contributor), you should be all good. That said, the original tutorials didn't contain any real "license" for use, so I guess they are a legal grey area, although it's highly unlikely one of the authors is going to cause a fuss over it. When we release the new set of tutorials we will make sure that the license is specified and liberal. For your specific use-case you might be better off using the [url="http://www.lonesock.net/soil.html"]SOIL library[/url] which is public domain, easy to use and supports loads of formats.
  15. The DevC++ links should be fixed Luke.