Drunk as fuck
Posted: Fri Jan 22, 2010 9:32 pm
So Kendall bought a bottle of chapmage, and I just had several beers. I've decided that it's time to sit the fuck down and dev for the day (afer playing Twilight Princess for quite awhile). Just thought that I should mention that the Elysian Shadows engiune is clearly being worked on. If you would like proof, here's my current fun ction I'm working on:
I'm not disucussing what the code is or what I'm doing. I'll probably delete this topic when I sober up. =Also, I'm trying to get enough shit done so that I, personally, will be impressed with ESRev2. If I'm not impressedw ith my own work, you arent seeing it. :D
Code: Select all
const static int positionMaxIterations = 100;
const static float penetrationEpsilon = 0.001f;
Vector2 pointOfContact, velocityChange[2];
float rotationAmount[2];
float maxPenetration;
int iterations = 0;
int currentRigidBody = 0;
int currentContact = 0;
while(iterations < positionsMaxIterations) {
maxPenetration = penetrationEpsilon;
currentRigidBody = -1;
for(unsigned int i = 0; i < currentLevel->currentArea->rigidBody.size(); ++i) {
for(unsigned int j = 0; j < currentLevel->currentArea->rigidBody[i]->collisionContact.size(); ++j) {
if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].penetration > maxPenetration) {
maxPenetration = currentLevel->currentArea->rigidBody[i]->collisionContact[j].penetration;
currentRigidBody = i;
currentContact = j;
}
}
}
if(currentRigidBody == -1) break;
//MATCH AWAKE STATE?
//c[index].matchAwakeState();
currentLevel->currentArea->rigidBody[currentRigidBody]->collisionContact[currentContact].ApplyPositionChange(velocityChange, rotationAmount);
for(unsigned int i = 0; i < currentLevel->currentArea->rigidBody.size(); ++i) {
for(unsigned int j = 0; j < currentLevel->currentArea->rigidBody[i]->collisionContact.size(); ++j) {
if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].body[0] == currentLevel->currentArea->rigidBody[currentRigidBody]->collisionContact[currentContact].body[0]) {
}
else if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].body[0] == currentLevel->currentArea->rigidBody[currentRigidBody]->collisionContact[currentContact].body[1]) {
}
if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].body[1]) {
if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].body[1] == currentLevel->currentArea->rigidBody[currentRigidBody]->collisionContact[currentContact].body[0]) {
}
else if(currentLevel->currentArea->rigidBody[i]->collisionContact[j].body[1] == currentLevel->currentArea->rigidBody[currentRigidBody]->collisionContact[currentContact].body[1]) {
}
}
}
}
}