Posts Tagged ‘physics’


first post in a long while + some erosion progress

March 15, 2009

Well apparently school takes up time.  So it’s been a while.  But here goes:

I got all A’s on my midterms, so fuck YES!  I feel happy about that.  Good times.  I have been spending an increasing amount of time with other people as well.  I know, crazy right?  It’s me.  Apparently some people don’t hate my guts, and I seem to have met some in person.  They are decidedly cool.  Hence that last post about Travis’ birthday.  So, yeah.

What else?  Oh, making progress on the Qix clone, Erosion.  Here you go:

It has a game state machine with GAME OVER and gameplay states and whatnot.  It has much better graphics now, I implemented bloom with my old shader framework and improved the color scheme.  You can die, and I’ve even got gamepad working with rumble on collisions and all.  You will also notice that I replaced the simple bouncing bar with a bar with a thruster in a damped system that actually semi-tries to follow you.  Enjoy this clip:


qix meets physics!

February 11, 2009

I’m currently working on a clone of Qix called Erosion.  It was assigned to me by Dr. Liow.

So, after getting the very basic bare bones of Erosion’s logic working, it struck me what would be about the coolest twist to Qix ever!  If I integrated physics!  Tada!!!  Fucking A!  It just so happens I’ve cooked up a little physics engine you all probably know about.  Soooooo, here you go, alpha test 1.  And hey, I was apparently listening to Opeth while coding, and it was picked up by the video recorder during the test! \m/

Bitching, yo.


physics talk abstract and slides

December 25, 2008

So now that my talk is done and over with, I guess I promised earlier to post my abstract/slides. SO IM POSTING THEM JESUS DONT KILL ME OKAY KAYTHX.

They’re here, and you must use the video signal analysis in your brain to interpret the pictures. No one ever gets that and they’re all like ROFLMAO I CANT SEE WTF. silly silly people.

download: physics_talk_08_ccis.7z

That takes care of that.


t3h engine project + games == omg no work

December 1, 2008

Seriously.  I have Portal on here now, and beat it, but it ate up like two days of work time.  And also Zombie Panic, that’s still killing time.  At least I don’t have TF2, or I’d never get anything done, ever.  EVAR  :B


I think the engine project could use some revival.  I like the code I have so far, and I still want to work on Floculate.  BY THE WAY OMFG I SPELLED IT WRONG BITCH.  It’s actually Flocculate.  And the word should be Flocculation.  Oh well.

But I want to revamp it to a certain extent.  Redo the system stuff for Win32/Linux, and less tacked on and more tied in properly support for stuff I plan to use like FBOs.  I also am strongly considering C++ for the Renderer.  The reason I am, is that it is far more flexible from a programming standpoint.

And all you people who are like “ur a devout C programmer omg thats liek total sellouting ur believes wtf!!1!”  Then I’m all “shut up foo!”  Seriously though.  C++ is appropriate in application settings.  Physics is C material.  All the necessary operations can be done in C, and it’s speed critical because it’s done on the CPU (by me anyway.)  It’s a necessity that it be as optimized as possible.  The same way OpenGL and DirectX were both written in C, because they are also optimized system level work.  But the USE of an optimized system level library like DirectX, OpenGL, or Rat Physics, is application work, and if it benefits greatly in terms of development from using C++, I’m down with that.

If you still don’t get the distinction, then either you weren’t a programmer and therefore that section is pointless to you, (you are pardoned non-programmers,) or you’re a dogmatic closed-minded jerk that doesn’t understand “circumstances” and their existence due to “dynamic reality.”  Seriously, take your fundamentalism somewhere else.  Once again, this only applies to the people screaming ‘hypocrite’ at me.  I know they exist, I know a few in person.

BTW, DirectX may be written in C++, we’ll never know.  It SHOULD be written in C.  I know it has a C interface anyway.

EDIT:  SUPER UPDATE TIME!  I now have a name for my engine, and it is made of recursive acronym GLORY!  RAVEN.  It means RAVEN Audio Video ENgine.  BRILLIANCE P0R W00T4G3!  Of course this is a part of Rampancy Engine.  The other part nearing completion is Rat Physics.  I also want to add more components, but that is for another time.


other physics videos

November 17, 2008

For those too lazy to get the engine from the repository and build it, here are more videos of it in action.  Seriously though, I can understand if you aren’t a programmer.  But for those who are, I have a link on my site, accessible from here, that goes to a publicly checkout-able repository and a jillion ways to build it.  It builds on Visual Studio 2008 (VC9) with a project file, it builds in C::B 8.02 or higher on the MinGW toolset, it has a raw makefile MinGW build, it has a GNU/Linux make GCC build, a C::B 8.02 or highter Ubuntu Linux build, I MEAN HAVE I NOT GIVEN YOU ENOUGH OPTIONS!?  JESUS GOD OMFGROFLMAO NARNIA PANTALOON SCALLYWAG! SLDKJFKLSDJSOIEOWEJOOJ!!!1!1!!1!!11!!!1!  😮 😮 😮 😀 😡  I’ll do 64-bit build when my laptop gets here as it’s 64-bit, that should make it friendlier to 64-bit types.

yay, its crazy time forever lawlz XD.

Now that we’re done with me becoming mildly volatile for a brief period, let’s get back to the videos.

wooooooooo, happy town.


pivot constraints == awesome chain physics!

November 17, 2008

In the past, I have had two different kinds of inelastic distance constraints: single distance constraints (rat_constraint_bar) and min/max distance constraints (rat_constraint_slider).  I add a new one called the pivot (rat_constraint_pivot).  Why, you ask?

Well, you might think a distance constraint with a length of zero is sufficient, but it isn’t.  Here’s why: a distance constraint uses the normal of the distance “bar” to decide how to pull or push the anchor points.  If you are a point, this value cannot exist unless the objects are separated, which means the constraint will never keep the anchors at zero distance from each other.  Furthermore, this means the pivot will never react like a revolute joint, because this behavior relies on a shared point.  So, the key is to compromise.  We use our old friend bias velocity (pseudo velocity) to keep the points together, regular distance constraint style.  But in order to get the correct pivot behavior out of it we have to calculate the impulse as if, like I said before, the anchors share a point even if they don’t.  This means instead of normals, we must create a mass matrix to get the correct torque, then apply the equal offset impulse to the anchors.  Think of it as unbreakable sticky friction.

The really cool looking result can be seen in the following video.  I can now have real segmented chains; solid segments, not distance constraints between particles!  🙂


time of impact islands + talk presentation thingy

October 23, 2008

HEY HEY HEY HEY HEY HEY HEY HEY *gets smacked down*


You’re not guessing.  I’ll tell you!  I’m actually giving a talk at Columbia College about my physics project.  Here’s essentially what I got off Dr. Liow.  Dr. Liow is probably one of the best people to recognize anything you do, because he seems like he’d be honest if he didn’t like what you’ve done.  In an email he was all: “Your program is interesting.  Do you want to give a talk about it during lunch, blabitty bloo, blabitty bloo, blabitty bloo, it’s totally unofficial, blabitty bloo, it’s in a room with some people, blabitty bloo, blabitty bloo, this is totally gonna be like a presentation during lunch so omg r u interested?”  Man, I hope he doesn’t read that.  Meh, I don’t really care.  Anyway, I was all “shit yeah” and he’s all “omg I haven’t even checked my email yet so I haven’t responded yet.”  So I’m still waiting for a reply.  But I’m psyched, and I really like the idea of publicising my physics engine, if even on a local scale, so I’m definitely going to be there.  I’m gonna make slides, demos, tacos, nachos, and paper mache!  Okay, actually just slides and demos.  Can you tell I’m giddy?  Huh?  Is it showing?  ANSWER ME!  YAAAAAAAYYYYY!!!!!!!!

This is pretty awesome.  All I’m sayin’.

NOW.  On the topic of actual work that I’m doing on physics.  You may have thought about time of impact and how it would slow everything down.  You’re damn right it will.  The question is, how can we optimize it as much as possible?  In the most accurate TOI model, you find the pending collision with the smallest TOI, advance by that amount, (of course setting a minimum fraction of total timestep so we don’t get stuck at toi==0.0 forever,) handle collisions normally, run the impulse solver, and repeat until the timestep is done.  But what about Joe McStranded off in the distance who won’t collide with anyone for at least a dozen frames?  Should we waste time sub stepping him?  NO.

The solution: islands.  This is a technique I am shamelessly stealing from Bullet Physics.  But we all stand on the shoulders of giants, right?  Anyway, an island is essentially a field of objects which will all interact with one another in the next frame.  An island of objects are all linked by constraints, contacts, and bounding box sweeps.  Anything which may collide with other bodies in the island or be affected by a body in the island is in, basically. This means the loners are all omitted from the expensive sub steps in time of impact solving, and this also means smaller islands who will do less sub steps than the bigger ones.

So, as for sweep algorithms, I have circles down, and I’m trying to do the MSA-sweep now.  I’m not exactly sure of how it will turn out on rotating bodies, as I’ve said before.  I may wind up using the conservative advancement method.  I’ve said this before, I’m just rehashing it.

Think about using islands in your own work.