Constraining movement along a plane (solved?)

eSalt
Posts: 15
Joined: Tue Jul 19, 2011 4:08 pm

Constraining movement along a plane (solved?)

Post by eSalt »

[I haven't used one of these forum things in a while, so bear with me]

Hello! I am a budding programmer, and have so far worked on my own. The game I am working on was started in 2D, but I soon realized that I would need to take the plunge and make it 2.5D (not 2.5D like FlatRedBall, 2.5D like Kirby 64). Currently I am testing out Irrlicht with the irrBullet wrapper. The particular feature I need in order to create 2D gameplay (constraints) is not implemented in the wrapper, but the wrapper does provide access to the Bullet internals, which is why I'm asking this here. Anyways, on to the question.

I would like some help figuring out the best way to constrain a body (although I would prefer soft [the player is a ball of goo], I know rigid is probably the only type possible) to moving along a 2dimensional plane, defined as the vertical plane passing between two points. This plane may or may not be aligned to the global x or z axes, and each area in the game will have paths which travel through consecutive points (meaning the constraint must be able to be changed/replaced to be between two different points).

One idea I have is to lock the local X axis, and make it so the object faces the vertical axis that passes through the destination point at all times (except when turning around). However, the documentation in the area of constraints is sadly quite lacking, and I haven't been able to figure them out...

Edit (July 23, 2011):
I know that I might be a bit impatient for this slow-moving forum, but I really would still appreciate help. Even just describing the functions and members of the constraint objects, so that I have the pieces to put together myself, if you know what I mean. I really would like to start this project before college picks up in the fall...

Edit (July 24, 2011): May I please have help with this? Should I bump this topic if it falls off the front page? I'm sorry I'm not a regular visitor to these forums, but I don't know much in the way of advanced physics (what I do know will be enough for this game once I get this matter taken care of). I've got Asperger's Syndrome, so I'm not very social, either. Also, does my question need to be explained more? I know people are looking at this topic...unless that's just the bots. :lol:

P.S.: Using irrBullet, I am limited to Bullet version 2.77.

Edit (July 29th): I'm about to be bumped off the front page. :( I'm running out of summer to work on my application... Please help...
Last edited by eSalt on Sun Jul 31, 2011 3:01 am, edited 1 time in total.
eSalt
Posts: 15
Joined: Tue Jul 19, 2011 4:08 pm

Re: Constraining movement along a plane (still need help/doc

Post by eSalt »

I hope I'm not breaking the rules by bumping this back to the front page...

I just really need something better than the spotty documentation in order to grasp how to use constraints, particularly in the case I give above.

Again, sorry for my impatience. I just recently got an iPad (my game will be for Windows though), and I've been "addicted" to it. Being able to work on my game again will give me plenty of reason to take a break from it... :wink:
Mako_energy02
Posts: 171
Joined: Sun Jan 17, 2010 4:47 am

Re: Constraining movement along a plane (still need help/doc

Post by Mako_energy02 »

I'm not really sure that a constraint is your best bet here. If you want to lock an object to a point on the world you could use a Generic6dofconstraint with the linear and angular axes locked...but really...that's not much better then just manually setting the location of the object assuming you know where on the plane (in global coordinates, of course) you want it to go each frame.

Unless I'm not fully understanding the issue. Is there a specific reason you can't set the location manually?
eSalt
Posts: 15
Joined: Tue Jul 19, 2011 4:08 pm

Re: Constraining movement along a plane (still need help/doc

Post by eSalt »

There isn't really an issue with setting the position manually. It's just that I want to avoid situations where the moving object gets stuck in the ground. Really, that's one of the two reasons I'm looking for a pre-built engine. (the other one being soft-bodies) I managed my own physics when the game was still a 2d prototype. I don't know how well my 2d knowledge would mesh with 3d objects, though.

...although I could make 2d profiles of the meshes and use my previous experience to wrap the 3d around the 2d physics...

On the other other hand, I never figured out how to make characters look right when they go up slopes. The game used what I called, for lack of a better term, pixel-precise terrain. The graphical tile set doubled as the terrain tile set. Because slopes could vary infinitely, I couldn't just make a sloping sprite. Anyways, after writing this paragraph, I think I could just rotate the mesh.

Yeah, I ramble a lot. I guess that still hasn't changed from when I last used a forum...I'm going to bed soon, so good night, and thank you for at least getting me to think of alternatives to constraints. :mrgreen: