I'm posting fairly early because I'm decently excited. Last night I spent a few hours working on coding and it at last culminated in my being able to attach multiple objects together. The process wasn't all that laborious, due in large part to my having planned it out ahead of time.
Basically what I have is my physical object which contains a linked list of the shapes of which it's comprised, a compound collision shape object (used by Bullet) and a rigid body object (used by bullet). When a new object is joined, I take the data of its collision shape, create a new collision shape and add that to the compound object. I then remove the added shape's rigid body object from the simulation and remove/delete the physical object from the game. After that, I have to remove the main physical object's rigid body from the simulation and delete it. I am then able to construct it anew using the new compound shape (with the added shape in place).
I did realize on my drive to work this morning that I'm not updating the new compound object mass appropriately, so I'll have to do that. Also, there seems to be a bug that causes the game to crash after a bunch of objects have been combined and some time has elapsed. I had no time to look into that last night, so I'll investigate tonight.
And what's that? A screenshot? Yes I know it's not much, but at this point there's been such a drought regarding visuals that it's better than nothing.
There's still more work to do on handling the shape selection and whatnot but I've got a plan for it and so I expect little trouble moving forward.
I'm very happy with the way this is working now. The method I was using previously (as demonstrated in the videos and such) of using joint constraints was just unsatisfactory. They weren't solid joints, they were more springy and that didn't serve the purpose for which I need them. Granted, I think I'll still use them later on for legitimate moving joints between objects but, for now, they will remain relegated to /*commented out*/.
Anyways once I get the whole object-addition thing straightened out and bug-free, I can begin the task of separating them. The hurdle there is the condition wherein I remove an object from a series of objects. That is to say that if an object is acting as a bridge between two other objects and I remove it from the compound shape, how do I notify the others to then behave independent of each other? I'm going to have to keep track of contacts between objects and make sure that I can trace one object to another in order to leave it in the compound shape. If not, it gets the boot. This will be fun! /sarcasm
And now having come close to some great things, I think I might actually allow myself to finally purchase Portal 2. I've been staving off so as to not distract myself from Rustbot, but I think there's a little less urgency with Rustbot right now and that I can therefore proceed with 73H P0R7415.
Still have to finish Uncharted, too. And Scratches. And about 22 other games (yes, I made a list and yes, it's depressing).
No comments:
Post a Comment