• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

320 Neutral

About GreenToad

  • Rank
  1. Collision Detection with Rotation ?

    A simple way to handle collision detection with rotated 2D objects (convex polygons) is to use Separating Axis Theorem. See here: http://www.gamedev.net/reference/programming/features/2dRotatedRectCollision/ http://www.metanetsoftware.com/technique/tutorialA.html
  2. Anyone know any good stocks to invest in?

    So I've been trading, investing, gambling, whatever you want to call it in individual for about 2 years now. It's definitely a very scary roller coaster to be on and you must be prepared to lose any money you put in (don't invest/trade with your rent money!). Like people have been saying, bigger returns require bigger risks, and sometimes they just don't pan out. I tend to follow and trade computer industry stocks, along with some random other stocks as well. My 'strategy' is to watch them and try to identify and buy when they are undervalued. This is of course, all just guess work, and I place stops to make sure I don't lose too much when I guess wrong (which is often). If you only want to risk $1000, buying and holding some sort of mutual fund is going to be the way to go. If you try trading individual stocks with $1000, you're going to lose it very quickly, as each trade will cost you a commission fee, and that will fast eat into your profits and further deepen your losses.
  3. Hey chadsxe, So I tried this in my own engine, it looks like stopping and starting the voice is similar to pausing and playing. Looks like if you want to completely restart the sound, I'd stop the voice, delete it, and make a new one. You could also try doing something along the lines of calling voice->FlushSourceBuffers(), then resubmitting the sample using voice->SubmitSourceBuffer, though I'm not sure if this will work. For reference, that text I quoted is in DirectX Audio > Referece > Xaudio2 > Interfaces > IXaudio2SourceVoice > Stop.
  4. Definitely check out the docs for XAudio2: "After Start is called it has no further effect if called again before IXAudio2SourceVoice::Stop is called. In addition multiple calls to Start without matching calls to IXAudio2SourceVoice::Stop will result in warning messages in debug builds." So yeah, just call Stop first, then Start again.
  5. btHeightfieldTerrainShape

    Hi, I had trouble with the heightfield shape too. You're correct in that it only wants your y (height) values. When I was setting mine up, I thought it was working at first, but then I realized everything was offset funky. It turns out (using the newest constructor at least) you have to 're-offset' things vertically because bullet recenters the heights around 0 (or something like that). Anyway, here's the code I use: float minH,maxH; //this is the minimum and maximum value from my data btHeightfieldTerrainShape * heightfieldShape = new btHeightfieldTerrainShape(width,height,data 1, minH, maxH, 1, PHY_FLOAT, false); float offset = (minH + maxH) * 0.5f; //here we go calculating the offset to compensate for bullet btTransform startTrans = btTransform::getIdentity(); startTrans.setOrigin(btVector3(0,offset,0); //this should put things back where you'd expect //and so on... btMotionState* ms = new btDefaultMotionState(startTrans); btRigidBody::btRigidBodyConstructionInfo info(0,ms,heightfieldShape,btVector3(0,0,0)); Hope this helps!
  6. XAudio2 and OGG as resource

    Hey man, I actually just wrote code today that does exactly what you want to do, load an entire ogg file into a buffer. It was slightly tricky, as like you mention, it's hard to determine the right buffer size. It turns out you can call ov_pcm_total() but then you have to multiply that length by the number of channels in the file. Here's what I had to do: ogg_int64_t bufSize = ov_pcm_total(m_vorbisFile, -1) * m_soundFormat->nChannels; //this is the key! char* buffer = new char[bufSize]; char array[BUFFER_SIZE]; //BUFFER_SIZE = 32768 int bytes = 0; //now keep reading until we've read everything do { // ov_read only reads a 'packet' so we have to keep calling it to get everything bytes = ov_read(&oggFile, array, BUFFER_SIZE, endian, 2, 1, &bitStream); // copy to our buffer at the end memcpy(buffer + size,array,bytes); size += bytes; if(bytes <= 0 || size >= totalSize) break; } while (bytes > 0); // and so on and so forth... Hope this helps!
  7. Is DirectX Dying?

    DirectX is dying in the same way you and I die a little bit everyday. Also, XNA is just a relatively thin wrapper around DirectX.
  8. Craziest/most far out book you ever read?

    The Wasp Factory: not only is the book fucked up, it makes you feel like you discovered a fucked up part of yourself you did not know was there.
  9. [Resolved] Can anyone test my game game please?

    Add screen shots too.
  10. Holy...EA and THQ could be gone!!!

    These were absolutely ridiculous rumors, but serious money moved around - I hope you guys sold EA shares yesterday (I know I did!).
  11. separate ok but together not?

    Quote:Original post by Programmer One Quote:Original post by szecs How about sphere ships? If we ever be in space (arggh my English), sphere would be an optimal shape, it has the smallest surface at a given volume, and stress distribution is more optional too. OMG I'm so f. clever Yeah but then it would look like the Death Star. [grin] And the borg have dibs on the sphere shape as well:
  12. Selling Rights to my game

    $100 and it's a deal.
  13. Coraline

    Anyone seen this? I saw it this weekend in THREE DEE. The movie itself is great and very well done, a lot of impressive scenes for stop-motion. The story is well adapted from the book and sufficiently creepy (made some kids cry in the theater). I loved all the textures as well: since it's stop motion, all the props and characters are real, including hand knitted tiny sweaters, mittens, real mud, fabric. It's very cool. Related, how about them 3D movies? I think they're alright, but to me, while watching I constantly feel like I'm waking up, like I'm still groggy and my vision isn't clear yet. After the movie, I feel like I just came out of a long dream - it's sort of disconcerting. So how about it, anyone else seen Coraline, potentially in THREE DIMENSIONS?!
  14. Getting started with Scheme

    I just downloaded DrScheme and wrote a couple little programs, and it appears to be a great place to start. I'll suppose I'll move on to MIT/GNU scheme later on. Thanks guys!
  15. Hey guys, I'm looking to get started programming with Scheme, and I've been looking around for scheme compilers/IDEs. So far I've been looking at MIT/GNU Scheme, which seems like an ok set-up, but I was wondering if anyone had any experience with this or other Scheme compilers/IDEs. What you guys think the best compiler/IDE would be for compiling/writing Scheme programs?
  • Advertisement