You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(25) |
Oct
(64) |
Nov
(74) |
Dec
(22) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(14) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: julien r. <jul...@us...> - 2004-11-22 21:18:56
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25646 Modified Files: aicontroller.cc aicontroller.h controller.cc controller.h game.cc playercontroller.cc playercontroller.h Log Message: bugfixes ! Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** game.cc 20 Nov 2004 09:05:11 -0000 1.37 --- game.cc 22 Nov 2004 21:18:44 -0000 1.38 *************** *** 68,81 **** void Game::_CreatePlayers () { - //création du joueur local - //on ajoute _pas_ le pawn au scenemanager - #ifndef TGWIN32 - #define CAM_SPEED 450 - #else - #define CAM_SPEED 4500 - #endif - Camera* cam = new Camera (0.025f,CAM_SPEED, Vector3 (0, 100,0)); - - //préchargement des meshes pEngine->pMeshManager->Load("guardian", "data/models/guardian/guardian.md5mesh"); pEngine->pMeshManager->LoadAnim("guardian", "data/models/guardian/death.md5anim"); --- 68,71 ---- *************** *** 90,94 **** pEngine->pMeshManager->Load("rocket", "data/models/rocket/rocket.md5mesh"); ! //creation du joueur Pawn* p = new Pawn(); pSceneManager->SetCamera(cam); --- 80,95 ---- pEngine->pMeshManager->Load("rocket", "data/models/rocket/rocket.md5mesh"); ! ! //création du joueur local ! //on ajoute _pas_ le pawn au scenemanager ! #ifndef TGWIN32 ! #define CAM_SPEED 450 ! #else ! #define CAM_SPEED 4500 ! #endif ! Camera* cam = new Camera (0.025f,CAM_SPEED, Vector3 (0, 100,0)); ! ! //préchargement des meshes ! //creation du joueur Pawn* p = new Pawn(); pSceneManager->SetCamera(cam); *************** *** 105,108 **** --- 106,110 ---- p->SetMoveSpeed (CAM_SPEED); p->SetVisible(false); + p->SetClip(true); //p->GetCamera()->SetPhysicCallBack(pLocalController); *************** *** 117,121 **** p->SetMoveSpeed(CAM_SPEED); p->SetVelocity(Vector3(0,0,0)); ! //p->SetRotation(Quaternion(-90, Vector3(1,0,0))); p->SetPosition(pWorld->GetStartPosition(0)); p->SetBB(Vector3(-15, 0, -15), Vector3(15, 80, 15)); --- 119,123 ---- p->SetMoveSpeed(CAM_SPEED); p->SetVelocity(Vector3(0,0,0)); ! //p->SetRotation(Quaternion(-90, Vector3::UNIT_X)); p->SetPosition(pWorld->GetStartPosition(0)); p->SetBB(Vector3(-15, 0, -15), Vector3(15, 80, 15)); Index: controller.h =================================================================== RCS file: /cvsroot/epfl/tggame/controller.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** controller.h 17 Nov 2004 23:12:56 -0000 1.11 --- controller.h 22 Nov 2004 21:18:44 -0000 1.12 *************** *** 30,34 **** protected: Pawn* pPawn; ! bool bDir[4]; int iLife; --- 30,34 ---- protected: Pawn* pPawn; ! bool bDir[6]; int iLife; Index: aicontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** aicontroller.h 17 Nov 2004 23:12:56 -0000 1.8 --- aicontroller.h 22 Nov 2004 21:18:44 -0000 1.9 *************** *** 11,14 **** --- 11,16 ---- static int STRAFELEFT; static int STRAFERIGHT; + static int JUMP; + static int CROUCH; DebugSphere* pSphere; Index: playercontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** playercontroller.h 17 Nov 2004 23:12:56 -0000 1.11 --- playercontroller.h 22 Nov 2004 21:18:44 -0000 1.12 *************** *** 19,22 **** --- 19,24 ---- static int STRAFELEFT; static int STRAFERIGHT; + static int JUMP; + static int CROUCH; RocketLauncher* pRocketLauncher; *************** *** 32,36 **** void Exec (const std::string& s, int arg) { switch(arg) { ! case CLIP: pPawn->SetClip(pPawn->GetClip() ? false:true); break; default: break; } --- 34,38 ---- void Exec (const std::string& s, int arg) { switch(arg) { ! case CLIP: pPawn->SetClip(pPawn->GetClip()?false:true); break; default: break; } Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** playercontroller.cc 19 Nov 2004 12:05:14 -0000 1.21 --- playercontroller.cc 22 Nov 2004 21:18:44 -0000 1.22 *************** *** 9,12 **** --- 9,14 ---- int PlayerController::STRAFELEFT = 2; int PlayerController::STRAFERIGHT = 3; + int PlayerController::JUMP = 4; + int PlayerController::CROUCH = 5; PlayerController::PlayerController(Pawn* p) : Controller (p) *************** *** 124,127 **** --- 126,135 ---- SoundManager::pSoundManager->PlaySound("step"); break; + case TGKEY_SPACE: + bDir[JUMP] = true; + break; + case TGKEY_LCTRL: + bDir[CROUCH] = true; + break; case TGKEY_RIGHT: pPawn->SetPosition(Game::pSelf->GetWorld()->GetRandomStartPosition()+Vector3(20,80,20)); *************** *** 153,156 **** --- 161,170 ---- SoundManager::pSoundManager->StopSound("step"); break; + case TGKEY_SPACE: + bDir[JUMP] = false; + break; + case TGKEY_LCTRL: + bDir[CROUCH] = false; + break; default: break; Index: controller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/controller.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** controller.cc 17 Nov 2004 23:12:56 -0000 1.12 --- controller.cc 22 Nov 2004 21:18:44 -0000 1.13 *************** *** 10,14 **** vViewOffset.Null(); //iForward = iStrafe = 0; ! for (int i=0; i<4; i++) { bDir[i] = false; } --- 10,14 ---- vViewOffset.Null(); //iForward = iStrafe = 0; ! for (int i=0; i<6; i++) { bDir[i] = false; } *************** *** 29,40 **** vLastVel.Null(); ! Vector3 x, z; //x = rot.Rotate(Vector3::UNIT_X); //z = rot.Rotate(Vector3::UNIT_Z); x = rot.GetXAxis(); z = rot.GetZAxis(); ! //le joueur ne peut pas choisir de se déplacer sur les y (vertical) ! x.y = 0; ! z.y = 0; if (bDir[0]) vLastVel = vVelocity -= z*fSpeed; --- 29,47 ---- vLastVel.Null(); ! Vector3 x, z, y; //x = rot.Rotate(Vector3::UNIT_X); //z = rot.Rotate(Vector3::UNIT_Z); x = rot.GetXAxis(); z = rot.GetZAxis(); ! y = rot.GetYAxis(); ! //le joueur ne peut pas choisir de se déplacer sur les y en avancant/reculant s'il 'clip'(vertical) ! /*if (pPawn->GetClip()) ! { ! x.y = 0; ! z.y = 0; ! }*/ ! ! y.x = 0; ! y.z = 0; if (bDir[0]) vLastVel = vVelocity -= z*fSpeed; *************** *** 45,48 **** --- 52,59 ---- if (bDir[3]) vLastVel = vVelocity += x*fSpeed; + if (bDir[4]) + vLastVel = vVelocity += y*fSpeed; + if (bDir[5]) + vLastVel = vVelocity -= y*fSpeed; pPawn->SetVelocity(pPawn->GetVelocity()+vVelocity); Index: aicontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** aicontroller.cc 19 Nov 2004 12:05:14 -0000 1.13 --- aicontroller.cc 22 Nov 2004 21:18:44 -0000 1.14 *************** *** 15,18 **** --- 15,20 ---- int AIController::STRAFELEFT = 0; int AIController::STRAFERIGHT = 1; + int AIController::JUMP = 4; + int AIController::CROUCH = 5; AIController::AIController(Pawn* p) : Controller(p) *************** *** 38,41 **** --- 40,52 ---- } + static float rotY = 0.0f; + float test = Util::Random(); + if (test < 0.5f) + test *= -1; + + rotY += test; + + pPawn->SetRotation(Quaternion(rotY, Vector3::UNIT_Y)); + //bDir[FORWARD] = 1; /* *************** *** 44,48 **** */ // Vector3 pos = pPawn->GetPosition(); // position du perso AI ! Vector3 vPos = Game::pSelf->GetSceneManager()->GetCamera()->GetPosition(); // position de la camera Vector3 vCentre = Game::pSelf->GetSceneManager()->Trace(vPos, --- 55,59 ---- */ // Vector3 pos = pPawn->GetPosition(); // position du perso AI ! /* Vector3 vPos = Game::pSelf->GetSceneManager()->GetCamera()->GetPosition(); // position de la camera Vector3 vCentre = Game::pSelf->GetSceneManager()->Trace(vPos, *************** *** 57,61 **** << " Position : " << vPos << " Distance : " << abs(fVarZ) << std::endl; ! #endif //pPawn->SetRotation(Quaternion(rot++, Vector3::UNIT_Y)); --- 68,72 ---- << " Position : " << vPos << " Distance : " << abs(fVarZ) << std::endl; ! #endif*/ //pPawn->SetRotation(Quaternion(rot++, Vector3::UNIT_Y)); |
|
From: Seb <whi...@us...> - 2004-11-22 18:07:05
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13105 Modified Files: soundmanager.cc soundmanager.h Log Message: Remplace le facteur de mise a l'echelle par un define (plus pratique pour tester differentes echelles) Index: soundmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** soundmanager.cc 20 Nov 2004 16:08:26 -0000 1.19 --- soundmanager.cc 22 Nov 2004 18:06:41 -0000 1.20 *************** *** 98,101 **** --- 98,102 ---- #endif + // Bool to enable the soundmanager enable = true; } *************** *** 105,113 **** { #ifdef SOUND_DEBUG ! //cout << "[OpenAL] SetListenerPosition (" << x << "," << y << "," << z << ")" << endl; #endif //set the position using 3 seperate floats ! alListener3f(AL_POSITION, x/100,y/100,z/100); } --- 106,114 ---- { #ifdef SOUND_DEBUG ! //cout << "[OpenAL] SetListenerPosition (" << x/FACT << "," << y/FACT << "," << z/FACT << ")" << endl; #endif //set the position using 3 seperate floats ! alListener3f(AL_POSITION, x/FACT,y/FACT,z/FACT); } *************** *** 498,505 **** { #ifdef SOUND_DEBUG ! cout << "[OpenAL] SetSoundProperties: " << name << "(" << x << "," << y << "," << z << ")" << endl; #endif ! alSource3f(SoundList[name],AL_POSITION,x/100,y/100,z/100); alSource3f(SoundList[name],AL_VELOCITY,vx,vy,vz); } --- 499,506 ---- { #ifdef SOUND_DEBUG ! cout << "[OpenAL] SetSoundProperties: " << name << "(" << x/FACT << "," << y/FACT << "," << z/FACT << ")" << endl; #endif ! alSource3f(SoundList[name],AL_POSITION,x/FACT,y/FACT,z/FACT); alSource3f(SoundList[name],AL_VELOCITY,vx,vy,vz); } *************** *** 650,653 **** --- 651,655 ---- } + // To avoid seg fault, return a undefined SoundNode return (new SoundNode("undefined")); } Index: soundmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** soundmanager.h 20 Nov 2004 16:08:27 -0000 1.10 --- soundmanager.h 22 Nov 2004 18:06:41 -0000 1.11 *************** *** 26,29 **** --- 26,30 ---- #define BUFFER_SIZE 32768 // 32 KB buffers + #define FACT 100 // Divide each coordinate by FACT using std::string; *************** *** 70,73 **** --- 71,77 ---- void DisableSoundManager(); + void ParseSoundFile (char* filename); // Parse a file to load sounds + + // To enable/disable the soundmanager by registering two function to the console enum { *************** *** 91,97 **** void Init(); ! ! static int MainLoop(void* arg); ! string GetALErrorString(ALenum err); string GetALCErrorString(ALenum err); --- 95,99 ---- void Init(); ! string GetALErrorString(ALenum err); string GetALCErrorString(ALenum err); *************** *** 107,112 **** void LoadOGG(char *fileName, vector<char> &buffer, ALenum &format, ALsizei &freq); - void ParseSoundFile (char* filename); - vector<string> LoadedFiles; // Holds loaded file paths temporarily. vector<ALuint> Buffers; // Holds all loaded buffers. --- 109,112 ---- |
|
From: Yohann C. <pl...@us...> - 2004-11-22 13:52:24
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12007 Modified Files: Convert.java Log Message: et encore une modif... Index: Convert.java =================================================================== RCS file: /cvsroot/epfl/tgtools/Convert.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Convert.java 22 Nov 2004 12:43:18 -0000 1.2 --- Convert.java 22 Nov 2004 13:52:12 -0000 1.3 *************** *** 154,163 **** s = s.replaceAll("\\)", " )"); // s = s.replaceAll(" ", "_"); ! s = s.replaceAll("( -?\\d+){8}", " 0 0 0 0.500000 0.500000 0 0 0"); ! if(s.indexOf("vaxis") != -1 || s.indexOf("uaxis") != -1 || s.indexOf("material") != -1 ! || s.indexOf("plane") != -1 || s.indexOf("side") != -1 ! || s.indexOf("solid") != -1 || s.indexOf("[") != -1 || s.indexOf("]") != -1 ! || (s.indexOf("\"") != -1 && s.indexOf("classname") == -1) ) { System.out.println("---------\n"+s); System.exit(0); --- 154,169 ---- s = s.replaceAll("\\)", " )"); // s = s.replaceAll(" ", "_"); ! s = s.replaceAll("( -?\\d+\\.?\\d*){8}", " 0 0 0 0.500000 0.500000 0 0 0"); ! if(s.indexOf("vaxis") != -1 ! || s.indexOf("uaxis") != -1 ! || s.indexOf("material") != -1 ! || s.indexOf("plane") != -1 ! || s.indexOf("side") != -1 ! || s.indexOf("solid") != -1 ! || s.indexOf("[") != -1 || s.indexOf("]") != -1 ! || (s.indexOf("\"") != -1 && s.indexOf("classname") == -1) ! // && !s.matches("\\{|\\}|(\\(( -?\\d+.?\\d*){3} \\) ){3} \\w*\\/\\w* ( -?\\d+){8}") ! ) { System.out.println("---------\n"+s); System.exit(0); |
|
From: Yohann C. <pl...@us...> - 2004-11-22 12:43:27
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29690 Modified Files: Convert.java Log Message: modif: les derniers chiffres sont TOUJOURS 0 0 0 0.500000 0.500000 0 0 0 cêst pas gagné.... Index: Convert.java =================================================================== RCS file: /cvsroot/epfl/tgtools/Convert.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** Convert.java 17 Nov 2004 21:43:47 -0000 1.1.1.1 --- Convert.java 22 Nov 2004 12:43:18 -0000 1.2 *************** *** 2,32 **** import java.util.regex.*; ! class Convert { ! public static void main(String [] args) { Convert c = new Convert(args[0]); } private int state = 0; ! // 0 = on n'est nulle part.... ! // 1 = on est dans le world ! // 2 = on est dans un solid ! // 3 = on est dans un side ! Convert(String file) { ! String fichier = LireFichier(file); ! // System.out.println(fichier+"-------------\n"+fichier.indexOf("world")+"\n"); ! fichier = cleanFile(fichier); ! // fichier = removeNotWorld(fichier); ! String mapFile = makeMap(fichier); ! System.out.println(mapFile); } ! String LireFichier(String monFichier) { int nAccolade = 0; ! int nAccolade1 = 0; int nBadAccolade1 = 0; ! int nAccolade2 = 0; int nBadAccolade2 = 0; ! int nAccolade3 = 0; int nBadAccolade3 = 0; boolean add = false; ! try{ RandomAccessFile raf = new RandomAccessFile(monFichier, "r"); String line = ""; --- 2,40 ---- import java.util.regex.*; ! class Convert ! { ! public static void main(String [] args) ! { Convert c = new Convert(args[0]); } private int state = 0; ! // 0 = on n'est nulle part.... ! // 1 = on est dans le world ! // 2 = on est dans un solid ! // 3 = on est dans un side ! Convert(String file) ! { ! // String fichier = LireFichier(file); ! LireFichier(file); ! // System.out.println(fichier+"-------------\n"+fichier.indexOf("world")+"\n"); ! // fichier = cleanFile(fichier); ! // fichier = removeNotWorld(fichier); ! // String mapFile = makeMap(fichier); ! // System.out.println(mapFile); } ! void LireFichier(String monFichier) { int nAccolade = 0; ! int nAccolade1 = 0; ! int nBadAccolade1 = 0; ! int nAccolade2 = 0; ! int nBadAccolade2 = 0; ! int nAccolade3 = 0; ! int nBadAccolade3 = 0; boolean add = false; ! boolean traite = false; ! try { RandomAccessFile raf = new RandomAccessFile(monFichier, "r"); String line = ""; *************** *** 35,38 **** --- 43,47 ---- while ( (line = raf.readLine()) != null ) { add = false; + traite = false; if(state == 0) { if(line.indexOf("world") != -1) { *************** *** 58,61 **** --- 67,71 ---- if(nAccolade1 == 0) { state = 0; + traite = true; } add = true; *************** *** 80,83 **** --- 90,94 ---- if(nAccolade2 == 0) { state = 1; + traite = true; } add = true; *************** *** 92,96 **** nBadAccolade3++; } ! }else if(line.indexOf("}") != -1) { if(nBadAccolade3 > 0) { nBadAccolade3--; --- 103,107 ---- nBadAccolade3++; } ! } else if(line.indexOf("}") != -1) { if(nBadAccolade3 > 0) { nBadAccolade3--; *************** *** 99,102 **** --- 110,114 ---- if(nAccolade3 == 0) { state = 2; + // traite = true; } add = true; *************** *** 104,110 **** } if(line.indexOf("plane") != -1 || ! line.indexOf("material") != -1 || ! line.indexOf("uaxis") != -1 || ! line.indexOf("vaxis") != -1) { add = true; } --- 116,122 ---- } if(line.indexOf("plane") != -1 || ! line.indexOf("material") != -1 || ! line.indexOf("uaxis") != -1 || ! line.indexOf("vaxis") != -1) { add = true; } *************** *** 114,136 **** oldLine = line; } } ! return fichierContenu; } catch (IOException e) { System.out.println("erreur: " + e); } ! return ""; } String makeMap(String s) { ! s = s.replaceAll("solid\n\\{", "\\{"); ! s = s.replaceAll("side\n\\{", ""); ! s = s.replaceAll("\"plane\" \"", " "); s = s.replaceAll("\"\n\"material\" \"", " "); s = s.replaceAll("\"\n\"uaxis\" \"\\[", " "); ! s = s.replaceAll("\\] [0-9]*\"\n\"vaxis\" \"\\[", " "); s = s.replaceAll("\\].*\n\\}", ""); s = s.replaceAll("\n\n", "\n"); ! s = s.replaceAll("world\n\\{", "\\{\n\"classname\" \"worldspawn\""); return s; } --- 126,166 ---- oldLine = line; } + if (traite) { + // System.out.println("---------------------"); + System.out.print(makeMap(cleanFile(fichierContenu))); + fichierContenu = ""; + } } ! System.out.print(makeMap(cleanFile(fichierContenu))); ! // return fichierContenu; } catch (IOException e) { System.out.println("erreur: " + e); } ! // return ""; } String makeMap(String s) { ! s = s.replaceAll("solid.?\n\\{", "{"); ! s = s.replaceAll("side.?\n\\{", ""); ! s = s.replaceAll("\"plane\" \"", ""); s = s.replaceAll("\"\n\"material\" \"", " "); s = s.replaceAll("\"\n\"uaxis\" \"\\[", " "); ! s = s.replaceAll("\\] -?[0-9]*\\.?[0-9]*\"\n\"vaxis\" \"\\[", " "); s = s.replaceAll("\\].*\n\\}", ""); s = s.replaceAll("\n\n", "\n"); ! s = s.replaceAll("world.?\n\\{", "{\n\"classname\" \"worldspawn\""); ! s = s.replaceAll("\\(", "( "); ! s = s.replaceAll("\\)", " )"); ! // s = s.replaceAll(" ", "_"); ! s = s.replaceAll("( -?\\d+){8}", " 0 0 0 0.500000 0.500000 0 0 0"); ! if(s.indexOf("vaxis") != -1 || s.indexOf("uaxis") != -1 || s.indexOf("material") != -1 ! || s.indexOf("plane") != -1 || s.indexOf("side") != -1 ! || s.indexOf("solid") != -1 || s.indexOf("[") != -1 ! || s.indexOf("]") != -1 ! || (s.indexOf("\"") != -1 && s.indexOf("classname") == -1) ) { ! System.out.println("---------\n"+s); ! System.exit(0); ! } return s; } *************** *** 140,158 **** String clean = s; ! String[] paterns = { ! "//.*", ! " *$" ! // "\t", ! // "^.*(\"id\"|\"rotation\"|\"lightmapscale\"|\"smoothing_groups\").*$", ! // ".*worldspawn" }; ! for(int j = 0; j < paterns.length; j++) ! { ! Pattern p = Pattern.compile(paterns[j], Pattern.MULTILINE); Matcher m = p.matcher(clean); ! clean = m.replaceAll(""); } ! // clean = clean.replaceAll(p, ""); return clean; } --- 170,191 ---- String clean = s; ! String[][] paterns = { ! { "//.*", "" }, ! { "^$", ""}, ! // { "^[\\W]*$", "" }, ! { " *$", "" }, ! { "^[\\s]*", ""}, ! // "^[\\W]?side.*{$" ! // "\t", ! { "^[\\W](\"id\"|\"rotation\"|\"lightmapscale\"|\"smoothing_groups\").*$", ""} ! // ".*worldspawn" }; ! for(int j = 0; j < paterns.length; j++) { ! Pattern p = Pattern.compile(paterns[j][0], Pattern.MULTILINE); Matcher m = p.matcher(clean); ! clean = m.replaceAll(paterns[j][1]); } ! // clean = clean.replaceAll(p, ""); return clean; } |
|
From: Yohann C. <pl...@us...> - 2004-11-21 15:37:42
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3566 Modified Files: updateall Log Message: :-P pour seb ;-) Index: updateall =================================================================== RCS file: /cvsroot/epfl/tgtools/updateall,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** updateall 21 Nov 2004 14:31:10 -0000 1.2 --- updateall 21 Nov 2004 15:10:33 -0000 1.3 *************** *** 91,95 **** echo " --- Mise a jour de TGEngine" cd tgengine-0.1 - make clean cvs update cd .. --- 91,94 ---- *************** *** 100,104 **** echo " --- Mise a jour de TGGame" cd tggame - make clean cvs update cd .. --- 99,102 ---- *************** *** 116,121 **** --- 114,121 ---- echo " --- compilation avec $optmake" cd tgengine-0.1 + make clean make $optmake cd ../tggame + make clean make $optmake fi |
|
From: Seb <whi...@us...> - 2004-11-21 15:30:40
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7141 Modified Files: updateall Log Message: Quelques corrections pour que le script fonctionne ;-) Index: updateall =================================================================== RCS file: /cvsroot/epfl/tgtools/updateall,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** updateall 21 Nov 2004 15:10:33 -0000 1.3 --- updateall 21 Nov 2004 15:30:09 -0000 1.4 *************** *** 8,12 **** opthelp=0 optOsX=0 ! optmake="debug" while getopts "UAeEgGtTcCrRhHxXdD" option --- 8,12 ---- opthelp=0 optOsX=0 ! optmake="Debug" while getopts "UAeEgGtTcCrRhHxXdD" option *************** *** 40,44 **** echo " -t : Mise a jour de TGTools" echo "" ! echo "Par défault donc, TGEngine et TGGame sont mis a jour" echo "avec CVS. il faut ajouter -t pour en faire de meme avec" echo "TGTools." --- 40,44 ---- echo " -t : Mise a jour de TGTools" echo "" ! echo "Par default donc, TGEngine et TGGame sont mis a jour" echo "avec CVS. il faut ajouter -t pour en faire de meme avec" echo "TGTools." *************** *** 107,113 **** if [ "$optOsX" == "1" ] then ! optmake="-osx"$optmake else ! optmake="-linux"$optmake fi --- 107,113 ---- if [ "$optOsX" == "1" ] then ! optmake="osx"$optmake else ! optmake="linux"$optmake fi |
|
From: Yohann C. <pl...@us...> - 2004-11-21 14:31:47
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26686 Modified Files: updateall Log Message: ajout du tag -x pour lacompilation sous OsX, et du tag -d qui desactive la compilation en mode debug (fera une compilation normale) Les éventuelles compilations se font à la fin maintenant. Index: updateall =================================================================== RCS file: /cvsroot/epfl/tgtools/updateall,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** updateall 21 Nov 2004 10:03:12 -0000 1.1 --- updateall 21 Nov 2004 14:31:10 -0000 1.2 *************** *** 7,12 **** optrun=0 opthelp=0 ! while getopts "UAeEgGtTcCrRhH" option do case $option in --- 7,14 ---- optrun=0 opthelp=0 + optOsX=0 + optmake="debug" ! while getopts "UAeEgGtTcCrRhHxXdD" option do case $option in *************** *** 15,22 **** t | T) opttools=1;; c | C) optcompile=0;; ! r | R) optrun=1;; h | H) opthelp=1;; U) optupdate=1;; ! A) optall=1;; *) echo "Option -$OPTARG inconnue" opthelp=1 ;; --- 17,26 ---- t | T) opttools=1;; c | C) optcompile=0;; ! r | R) optrun=1;; h | H) opthelp=1;; U) optupdate=1;; ! A) optall=1;; ! x | X) optOsX=1;; ! d | D) optmake="";; *) echo "Option -$OPTARG inconnue" opthelp=1 ;; *************** *** 32,49 **** echo "Usage : $0 [options] [dossier contenant TGGame, TGEngine et TGTools]"; echo "Options :" ! echo " -e : Desactive les operations sur TGEngine" ! echo " -g : Desactive les operations sur TGGame" echo " -t : Mise a jour de TGTools" echo "Par défault donc, TGEngine et TGGame sont mis a jour" echo "avec CVS. il faut ajouter -t pour en faire de meme avec" ! echo "TGTools." echo "En plus de cela, pour TGE et TGG, la compilation est" ! echo "par default effectuee apres la mis a jour. on peut" ! echo "cependant ajouter l'option:" echo " -c : desactive la compilation apres la mis a jour CVS" echo "Enfin, les dernieres options disponibles:" echo " -r : Lancement de TG a la fin des operations" echo " -U : mise a jour de TGE, TGG et TGT uniquement (-tc)" ! echo " -A : effectue toutes les operations (-Ucr)" echo " -h : affiche cette aide" exit 0 --- 36,60 ---- echo "Usage : $0 [options] [dossier contenant TGGame, TGEngine et TGTools]"; echo "Options :" ! echo " -e : Desactive la mise a jour de TGEngine" ! echo " -g : Desactive la mise a jour de TGGame" echo " -t : Mise a jour de TGTools" + echo "" echo "Par défault donc, TGEngine et TGGame sont mis a jour" echo "avec CVS. il faut ajouter -t pour en faire de meme avec" ! echo "TGTools." ! echo "" echo "En plus de cela, pour TGE et TGG, la compilation est" ! echo "par default effectuee apres la mis a jour, avec le tag debug." ! echo "on peut cependant ajouter les options :" ! echo "" echo " -c : desactive la compilation apres la mis a jour CVS" + echo " -x : compilera avec -osx" + echo " -d : compilera sans le tag debug" + echo "" echo "Enfin, les dernieres options disponibles:" + echo "" echo " -r : Lancement de TG a la fin des operations" echo " -U : mise a jour de TGE, TGG et TGT uniquement (-tc)" ! echo " -A : effectue toutes les operations (-Ucr)" echo " -h : affiche cette aide" exit 0 *************** *** 73,77 **** cd tgtools cvs update ! cd .. fi --- 84,88 ---- cd tgtools cvs update ! cd .. fi *************** *** 82,91 **** make clean cvs update ! if [ "$optcompile" == "1" ] ! then ! make ! fi ! cd .. ! fi if [ "$optgame" == "1" ] --- 93,98 ---- make clean cvs update ! cd .. ! fi if [ "$optgame" == "1" ] *************** *** 95,103 **** make clean cvs update ! if [ "$optcompile" == "1" ] then ! make fi ! cd .. fi --- 102,122 ---- make clean cvs update ! cd .. ! fi ! ! if [ "$optcompile" == "1" ] ! then ! if [ "$optOsX" == "1" ] then ! optmake="-osx"$optmake ! else ! optmake="-linux"$optmake fi ! ! echo " --- compilation avec $optmake" ! cd tgengine-0.1 ! make $optmake ! cd ../tggame ! make $optmake fi *************** *** 105,109 **** then echo " --- Lancement de TG" ! cd tggame ./tg & fi --- 124,128 ---- then echo " --- Lancement de TG" ! cd tggame ./tg & fi |
|
From: Yohann C. <pl...@us...> - 2004-11-21 10:04:08
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv701 Modified Files: pictconvert Added Files: updateall Log Message: ajout de updateall: permet la mise a jour / compilation... de TG complet. Lancez cd script depuis le dossier tgtools: ./updateall -A ../ (exemple effectuant toutes les possibilites offertes par ce script. le ../ indique le chemin vers le dossier contenant les 3 sous-repertoires tgengine-0.1 tggame et tgtools) bien-sûr, l'option -h vous en dira plus ;-) --- NEW FILE: updateall --- #!/bin/bash optengine=1 optgame=1 opttools=0 optcompile=1 optrun=0 opthelp=0 while getopts "UAeEgGtTcCrRhH" option do case $option in e | E) optengine=0;; g | G) optgame=0;; t | T) opttools=1;; c | C) optcompile=0;; r | R) optrun=1;; h | H) opthelp=1;; U) optupdate=1;; A) optall=1;; *) echo "Option -$OPTARG inconnue" opthelp=1 ;; esac done shift $((OPTIND - 1)) cd $1 if [ "$opthelp" == "1" ] then echo "Usage : $0 [options] [dossier contenant TGGame, TGEngine et TGTools]"; echo "Options :" echo " -e : Desactive les operations sur TGEngine" echo " -g : Desactive les operations sur TGGame" echo " -t : Mise a jour de TGTools" echo "Par défault donc, TGEngine et TGGame sont mis a jour" echo "avec CVS. il faut ajouter -t pour en faire de meme avec" echo "TGTools." echo "En plus de cela, pour TGE et TGG, la compilation est" echo "par default effectuee apres la mis a jour. on peut" echo "cependant ajouter l'option:" echo " -c : desactive la compilation apres la mis a jour CVS" echo "Enfin, les dernieres options disponibles:" echo " -r : Lancement de TG a la fin des operations" echo " -U : mise a jour de TGE, TGG et TGT uniquement (-tc)" echo " -A : effectue toutes les operations (-Ucr)" echo " -h : affiche cette aide" exit 0 fi if [ "$optupdate" == "1" ] then optengine=1 optgame=1 opttools=1 optcompile=0 optrun=0 fi if [ "$optall" == "1" ] then optengine=1 optgame=1 opttools=1 optcompile=1 optrun=1 fi if [ "$opttools" == "1" ] then echo " --- Mise a jour de TGTools" cd tgtools cvs update cd .. fi if [ "$optengine" == "1" ] then echo " --- Mise a jour de TGEngine" cd tgengine-0.1 make clean cvs update if [ "$optcompile" == "1" ] then make fi cd .. fi if [ "$optgame" == "1" ] then echo " --- Mise a jour de TGGame" cd tggame make clean cvs update if [ "$optcompile" == "1" ] then make fi cd .. fi if [ "$optrun" == "1" ] then echo " --- Lancement de TG" cd tggame ./tg & fi Index: pictconvert =================================================================== RCS file: /cvsroot/epfl/tgtools/pictconvert,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pictconvert 20 Nov 2004 10:39:24 -0000 1.4 --- pictconvert 21 Nov 2004 10:03:12 -0000 1.5 *************** *** 15,19 **** # optjpgbmp=0; ! while getopts "tTJdrRh" option do case $option in --- 15,19 ---- # optjpgbmp=0; ! while getopts "tTJrRh" option do case $option in *************** *** 25,29 **** h) opthelp=1;; *) echo "Option -$OPTARG inconnue" ! optaide=1 ;; esac options="$options$option" --- 25,29 ---- h) opthelp=1;; *) echo "Option -$OPTARG inconnue" ! opthelp=1 ;; esac options="$options$option" |
|
From: Seb <whi...@us...> - 2004-11-20 16:08:38
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29219 Modified Files: soundmanager.cc soundmanager.h Log Message: Plus de thread pour activer/desactiver le soundmanager Utilisation de l'enregistrement de fonctions dans la console -sound active le son -nosound désactive le son Index: soundmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** soundmanager.cc 20 Nov 2004 08:38:25 -0000 1.18 --- soundmanager.cc 20 Nov 2004 16:08:26 -0000 1.19 *************** *** 24,29 **** Init(); - - LoopThread = SDL_CreateThread(SoundManager::MainLoop,NULL); } --- 24,27 ---- *************** *** 71,100 **** #endif ! Engine::pVarManager->AddVar("sound", 1); ! enable = &Engine::pVarManager->GetVar("sound")->intValue; ! ParseSoundFile("data/sounds/file.snd"); - - } - - // Main Loop running in LoopThread - int SoundManager::MainLoop(void* arg) - { - bool done = false; - int* check; - - while (!done) - { - check = &Engine::pVarManager->GetVar("sound")->intValue; - - if(!*check) - pSoundManager->DisableSoundManager(); - //else - //pSoundManager->EnableSoundManager(); - - SDL_Delay(80); - } - - return 0; } --- 69,78 ---- #endif ! Engine::pConsole->Register("nosound", this, DISABLE); ! Engine::pConsole->Register("sound", this, ENABLE); ! ! enable = true; ! ParseSoundFile("data/sounds/file.snd"); } *************** *** 102,105 **** --- 80,89 ---- void SoundManager::DisableSoundManager() { + #ifdef SOUND_DEBUG + cout << "[OpenAL] DisableSoundManager" << endl; + #endif + + enable = false; + map<string, ALuint>::iterator iter = SoundList.begin (); for (; iter!=SoundList.end(); iter++) *************** *** 110,113 **** --- 94,102 ---- void SoundManager::EnableSoundManager() { + #ifdef SOUND_DEBUG + cout << "[OpenAL] EnableSoundManager" << endl; + #endif + + enable = true; } *************** *** 584,592 **** bool SoundManager::CheckSound(string name) { - enable = &Engine::pVarManager->GetVar("sound")->intValue; - if(SoundList[name] && SoundNodeList[name]) { ! if(*enable) { return AL_TRUE; --- 573,579 ---- bool SoundManager::CheckSound(string name) { if(SoundList[name] && SoundNodeList[name]) { ! if(enable) { return AL_TRUE; *************** *** 662,665 **** --- 649,654 ---- return SoundNodeList[name]; } + + return (new SoundNode("undefined")); } Index: soundmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** soundmanager.h 20 Nov 2004 08:38:25 -0000 1.9 --- soundmanager.h 20 Nov 2004 16:08:27 -0000 1.10 *************** *** 23,32 **** #include <vorbis/vorbisfile.h> - #ifdef TGWIN32 - #include <SDL/SDL_thread.h> - #else - #include <SDL_thread.h> - #endif - #include "engine.h" --- 23,26 ---- *************** *** 43,47 **** //SoundManager ! class SoundManager { --- 37,41 ---- //SoundManager ! class SoundManager: public Function { *************** *** 49,55 **** static SoundManager* pSoundManager; ! int* enable; // Check if soundmanager is enable or not ! ~SoundManager(); SoundManager(); --- 43,49 ---- static SoundManager* pSoundManager; ! bool enable; // Check if soundmanager is enable or not ! virtual ~SoundManager(); SoundManager(); *************** *** 75,84 **** void EnableSoundManager(); void DisableSoundManager(); private: int endian; // 0 for Little-Endian, 1 for Big-Endian - - SDL_Thread *LoopThread; void Init(); --- 69,92 ---- void EnableSoundManager(); void DisableSoundManager(); + + enum + { + ENABLE=1, + DISABLE=2 + }; + + void Exec (const string& s, int arg) + { + switch(arg) + { + case ENABLE: EnableSoundManager(); break; + case DISABLE: DisableSoundManager(); break; + default: break; + } + } private: int endian; // 0 for Little-Endian, 1 for Big-Endian void Init(); |
|
From: Yohann C. <pl...@us...> - 2004-11-20 10:39:34
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32105 Modified Files: pictconvert Log Message: remodifs. en esperant que tout marche chez tout le monde... Index: pictconvert =================================================================== RCS file: /cvsroot/epfl/tgtools/pictconvert,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pictconvert 20 Nov 2004 10:12:13 -0000 1.3 --- pictconvert 20 Nov 2004 10:39:24 -0000 1.4 *************** *** 67,84 **** file=`echo $1 | sed -e "s/\/$//"` ! let as=$(echo $file | wc -c) ! let fillsize=$(( ($TERMWIDTH - $as) / 2 )) fill="" ! while [ "$fillsize" -gt "0" ] do fill="${fill} " ! let fillsize=${fillsize}-1 done line="" ! let fillsize=$TERMWIDTH ! while [ "$fillsize" -gt "0" ] do line="${line}=" ! let fillsize=${fillsize}-1 done echo $line --- 67,85 ---- file=`echo $1 | sed -e "s/\/$//"` ! string=$(echo $file | wc -c) ! # let fillsize=$(( ($TERMWIDTH - $string) / 2 )) ! ((fillsize=($TERMWIDTH-$string)/2)) fill="" ! while [ $fillsize -gt 0 ] do fill="${fill} " ! fillsize=$(($fillsize-1)) done line="" ! fillsize=$TERMWIDTH ! while [ $fillsize -gt 0 ] do line="${line}=" ! fillsize=$(($fillsize-1)) done echo $line *************** *** 146,157 **** result="[PASS]" fi ! let affichesize=$(echo $affiche | wc -c) ! let resultsize=$(echo $result | wc -c) ! let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " ! let fillsize=${fillsize}-1 done echo "$affiche$fill$result" --- 147,162 ---- result="[PASS]" fi ! # let affichesize=$(echo $affiche | wc -c) ! affichesize=$(echo $affiche | wc -c) ! # let resultsize=$(echo $result | wc -c) ! resultsize=$(echo $result | wc -c) ! # let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 ! fillsize=$(($TERMWIDTH-$affichesize-$resultsize-3)) fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " ! # let fillsize=${fillsize}-1 ! fillsize=$(($fillsize-1)) done echo "$affiche$fill$result" |
|
From: Yohann C. <pl...@us...> - 2004-11-20 10:12:25
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26969 Modified Files: pictconvert Log Message: ...erreur dans les options: le -J était considéré comme un paramètre inconnu.... tentative de correction pour OsX.... mais au pif... Index: pictconvert =================================================================== RCS file: /cvsroot/epfl/tgtools/pictconvert,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pictconvert 19 Nov 2004 23:10:58 -0000 1.2 --- pictconvert 20 Nov 2004 10:12:13 -0000 1.3 *************** *** 15,19 **** # optjpgbmp=0; ! while getopts "tTjdrRh" option do case $option in --- 15,19 ---- # optjpgbmp=0; ! while getopts "tTJdrRh" option do case $option in *************** *** 68,72 **** let as=$(echo $file | wc -c) ! let fillsize=$(( ($TERMWIDTH - $as) /2 )) fill="" while [ "$fillsize" -gt "0" ] --- 68,72 ---- let as=$(echo $file | wc -c) ! let fillsize=$(( ($TERMWIDTH - $as) / 2 )) fill="" while [ "$fillsize" -gt "0" ] |
|
From: Seb <whi...@us...> - 2004-11-20 09:05:20
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14848 Modified Files: game.cc rocket.cc rocketlauncher.cc Log Message: Son a l'explosion contre un mur ou autre objet ;-) J'ai aussi enleve les son de tonnerre et autre. Maintenant, il reste: - Le bruit de la rocket qui part - Le bruit de la rocket qui explose Donc -> Il faut charger une nouvelle archive Sound.tgz Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** game.cc 19 Nov 2004 18:54:45 -0000 1.36 --- game.cc 20 Nov 2004 09:05:11 -0000 1.37 *************** *** 38,72 **** SoundManager::pSoundManager = pSoundManager; - - /* - On ajoute plus les sons ici. On utilise un fichier file.snd qui contient le nom des - sons a ajouter. Il faut creer le fichier file.snd qui contient: - - fire 0 1 - thunder 0 1 - scared2 0 1 - step 1 1 - gun 1 1 - - et placer le dans data/sounds - - */ - - //On prend les coordonnees de la tete de mort avec la lumiere rose - Vector3 soundtestpos = pWorld->GetPointLightPos(5); - - //On ajoute le son de feu a cette position - pSoundManager->SetSoundProperties("fire",soundtestpos.x,soundtestpos.y,soundtestpos.z,0.0,0.0,0.0); - - //On ajoute le son thunder a la position 0,70,0 - pSoundManager->SetSoundProperties("thunder",0,70,0,0,0,0); - - //On baisse le volume de la musique d'ambiance - pSoundManager->SetSoundVolume("Music",0.5); - - //On joue les sons - pSoundManager->PlaySound("fire"); - pSoundManager->PlaySound("thunder"); - pSoundManager->PlaySound("Music"); } --- 38,41 ---- Index: rocketlauncher.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rocketlauncher.cc 19 Nov 2004 12:05:14 -0000 1.3 --- rocketlauncher.cc 20 Nov 2004 09:05:11 -0000 1.4 *************** *** 31,34 **** cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal);*/ ! SoundManager::pSoundManager->PlaySound("gun"); } --- 31,34 ---- cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal);*/ ! SoundManager::pSoundManager->PlaySound("fire"); } Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** rocket.cc 20 Nov 2004 08:41:37 -0000 1.5 --- rocket.cc 20 Nov 2004 09:05:11 -0000 1.6 *************** *** 25,29 **** pModel->Attach("HEAD", pEmit); ! pModel->Attach("", SoundManager::pSoundManager->GetSoundNode("gun")); //pPhysic->SetSpeed --- 25,32 ---- pModel->Attach("HEAD", pEmit); ! if(SoundManager::pSoundManager->CheckSound("fire")) ! pModel->Attach("", SoundManager::pSoundManager->GetSoundNode("fire")); ! if(SoundManager::pSoundManager->CheckSound("bomb")) ! pModel->Attach("", SoundManager::pSoundManager->GetSoundNode("bomb")); //pPhysic->SetSpeed *************** *** 49,52 **** --- 52,58 ---- if (other != NULL && other->GetPhysicCallBack() != NULL) //on a touche un objet other->GetPhysicCallBack()->Collide(NULL, vPoint, vCollisionNormal); + + SoundManager::pSoundManager->PlaySound("bomb"); + delete this; } |
|
From: Seb <whi...@us...> - 2004-11-20 08:41:48
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11392 Modified Files: Makefile.OSX Makefile.OSXVideo rocket.cc Log Message: Ajout d'un SoundNode aux rocket Nouveau Makefile OSX pour optimiser le code pour le processeur 750(G3) Index: Makefile.OSXVideo =================================================================== RCS file: /cvsroot/epfl/tggame/Makefile.OSXVideo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.OSXVideo 17 Nov 2004 23:12:55 -0000 1.2 --- Makefile.OSXVideo 20 Nov 2004 08:41:37 -0000 1.3 *************** *** 1,4 **** # TG Makefile ! CFLAGS = -O3 -DDEBUG -DTGOSX -DTGVIDEO INCLUDEPATH = -I/sw/include/SDL -I/sw/include/ffmpeg -I./ -I../tgengine-0.1 LINKPATH = -L../tgengine-0.1/out --- 1,4 ---- # TG Makefile ! CFLAGS = -O3 -mcpu=750 -mtune=750 -DDEBUG -DTGOSX -DTGVIDEO INCLUDEPATH = -I/sw/include/SDL -I/sw/include/ffmpeg -I./ -I../tgengine-0.1 LINKPATH = -L../tgengine-0.1/out Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** rocket.cc 19 Nov 2004 18:54:45 -0000 1.4 --- rocket.cc 20 Nov 2004 08:41:37 -0000 1.5 *************** *** 2,5 **** --- 2,7 ---- #include "game.h" #include <vector3.h> + #include <soundmanager.h> + #include <soundnode.h> const float Rocket::fSpeed = 900.0f; *************** *** 22,25 **** --- 24,29 ---- Game::pSelf->GetSceneManager()->AddParticlesEmitter(pEmit); pModel->Attach("HEAD", pEmit); + + pModel->Attach("", SoundManager::pSoundManager->GetSoundNode("gun")); //pPhysic->SetSpeed Index: Makefile.OSX =================================================================== RCS file: /cvsroot/epfl/tggame/Makefile.OSX,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.OSX 17 Nov 2004 23:12:55 -0000 1.8 --- Makefile.OSX 20 Nov 2004 08:41:37 -0000 1.9 *************** *** 1,4 **** # TG Makefile ! CFLAGS = -O3 -DDEBUG -DTGOSX INCLUDEPATH = -I/sw/include/SDL -I./ -I../tgengine-0.1 LINKPATH = -L../tgengine-0.1/out --- 1,4 ---- # TG Makefile ! CFLAGS = -O3 -mcpu=750 -mtune=750 -DDEBUG -DTGOSX INCLUDEPATH = -I/sw/include/SDL -I./ -I../tgengine-0.1 LINKPATH = -L../tgengine-0.1/out |
|
From: Seb <whi...@us...> - 2004-11-20 08:38:34
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10875 Modified Files: Makefile.OSX soundmanager.cc soundmanager.h Added Files: soundnode.cc soundnode.h Log Message: Ajout de la classe SoundNode pour attacher un son a un objet en mouvement. Nouveau Makefile OSX pour optimiser pour le processeur 750(G3) Modification du SoundManager pour gerer les SoundNode --- NEW FILE: soundnode.h --- // Sebastien "Whistle Master or Seb" Samyn: sebastien.samyn *at* epfl.ch #ifndef _TGSOUNDNODE_H #define _TGSOUNDNODE_H #include "base.h" #include "vector3.h" #include "scenenode.h" #include "soundmanager.h" using std::string; namespace tg { class SoundNode : public SceneNode { public: SoundNode(string name); void SetPosition(Vector3 v); string GetSoundNodeName() { return sNodeName; } void PreRender (float x) {}; private: Vector3 vSpeed; string sNodeName; }; } //END tg #endif Index: Makefile.OSX =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/Makefile.OSX,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile.OSX 17 Nov 2004 23:12:37 -0000 1.13 --- Makefile.OSX 20 Nov 2004 08:38:25 -0000 1.14 *************** *** 6,14 **** OBJS = $(addsuffix .${OBJ_EXT}, $(basename $(OBJSRC))) LIBS = -lvorbis -lvorbisfile -framework OpenAL `sdl-config --libs` -lSDL_image -lavcodec ! CFLAGS = -DTGOSX -O3 -DDEBUG -DSOUND_DEBUG CC = g++ .cc.${OBJ_EXT}: ! $(CC) -c $(CFLAGS) -Wall -I/sw/include/SDL -I./ $< -o $@ all : $(OBJS) --- 6,14 ---- OBJS = $(addsuffix .${OBJ_EXT}, $(basename $(OBJSRC))) LIBS = -lvorbis -lvorbisfile -framework OpenAL `sdl-config --libs` -lSDL_image -lavcodec ! CFLAGS = -O3 -mcpu=750 -mtune=750 -DTGOSX -DDEBUG -DSOUND_DEBUG CC = g++ .cc.${OBJ_EXT}: ! $(CC) -c $(CFLAGS) -Wall -I/sw/include/SDL -I./ $< -o $@ all : $(OBJS) Index: soundmanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.cc,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** soundmanager.cc 17 Nov 2004 23:12:39 -0000 1.17 --- soundmanager.cc 20 Nov 2004 08:38:25 -0000 1.18 *************** *** 2,5 **** --- 2,6 ---- #include "soundmanager.h" + #include "soundnode.h" using std::string; *************** *** 158,162 **** // Add a Wav or Ogg sound to the sounds list ! void SoundManager::AddSound(string name, bool relative,bool looping) { string ogg_tmp_name, wav_tmp_name; --- 159,163 ---- // Add a Wav or Ogg sound to the sounds list ! void SoundManager::LoadSound(string name, bool relative,bool looping) { string ogg_tmp_name, wav_tmp_name; *************** *** 166,170 **** { #ifdef SOUND_DEBUG ! cout << "[OpenAL] AddSound: " << name << endl; #endif --- 167,171 ---- { #ifdef SOUND_DEBUG ! cout << "[OpenAL] LoadSound: " << name << endl; #endif *************** *** 178,182 **** { SoundList[name] = LoadOggALSample("data/sounds/"+name+".ogg", looping); ! if(relative) alSourcei(SoundList[name],AL_SOURCE_RELATIVE,AL_TRUE); --- 179,184 ---- { SoundList[name] = LoadOggALSample("data/sounds/"+name+".ogg", looping); ! SoundNodeList[name] = new SoundNode(name); ! if(relative) alSourcei(SoundList[name],AL_SOURCE_RELATIVE,AL_TRUE); *************** *** 184,189 **** else if (fopen(wav_path, "rb") != NULL) { ! SoundList[name] = LoadWavALSample("data/sounds/"+name+".wav", looping); ! if(relative) alSourcei(SoundList[name],AL_SOURCE_RELATIVE,AL_TRUE); --- 186,192 ---- else if (fopen(wav_path, "rb") != NULL) { ! SoundList[name] = LoadWavALSample("data/sounds/"+name+".wav", looping); ! SoundNodeList[name] = new SoundNode(name); ! if(relative) alSourcei(SoundList[name],AL_SOURCE_RELATIVE,AL_TRUE); *************** *** 583,587 **** enable = &Engine::pVarManager->GetVar("sound")->intValue; ! if(SoundList[name]) { if(*enable) --- 586,590 ---- enable = &Engine::pVarManager->GetVar("sound")->intValue; ! if(SoundList[name] && SoundNodeList[name]) { if(*enable) *************** *** 644,648 **** { file >> name >> relative >> looping ; ! AddSound(name,relative,looping); } } --- 647,664 ---- { file >> name >> relative >> looping ; ! LoadSound(name,relative,looping); ! } ! } ! ! // Get SoundNode ! SoundNode* SoundManager::GetSoundNode(string name) ! { ! if(CheckSound(name)) ! { ! #ifdef SOUND_DEBUG ! cout << "[OpenAL] GetSoundNode: " << name << endl; ! #endif ! ! return SoundNodeList[name]; } } Index: soundmanager.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/soundmanager.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** soundmanager.h 17 Nov 2004 23:12:39 -0000 1.8 --- soundmanager.h 20 Nov 2004 08:38:25 -0000 1.9 *************** *** 40,43 **** --- 40,45 ---- { + class SoundNode; + //SoundManager class SoundManager *************** *** 52,56 **** SoundManager(); ! void AddSound(string name, bool relative,bool looping); bool CheckSound(string name); --- 54,58 ---- SoundManager(); ! void LoadSound(string name, bool relative,bool looping); bool CheckSound(string name); *************** *** 67,70 **** --- 69,74 ---- void UpdateListener(Camera* ListenerCam); + SoundNode* GetSoundNode(string name); + void KillALData(); *************** *** 102,106 **** map<string, ALuint> SoundList; // Hold all sounds. ! }; --- 106,110 ---- map<string, ALuint> SoundList; // Hold all sounds. ! map<string, SoundNode*> SoundNodeList; // Hold all sounds node. }; --- NEW FILE: soundnode.cc --- // Sebastien "Whistle Master or Seb" Samyn: sebastien.samyn *at* epfl.ch #include "soundnode.h" namespace tg { SoundNode::SoundNode(string name) { sNodeName = name; } void SoundNode::SetPosition(Vector3 v) { vPosition = v; pBBox->Move (v); SoundManager::pSoundManager->SetSoundProperties(sNodeName,v.x,v.y,v.z,0.0,0.0,0.0); } } //END tg |
|
From: Yohann C. <pl...@us...> - 2004-11-19 23:11:08
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2407 Modified Files: pictconvert Log Message: j'enlève la fonction pour supprimer tous les .bmp... c'est trop dangereux... (je parle en connaissance de cause...) Index: pictconvert =================================================================== RCS file: /cvsroot/epfl/tgtools/pictconvert,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pictconvert 19 Nov 2004 22:50:22 -0000 1.1 --- pictconvert 19 Nov 2004 23:10:58 -0000 1.2 *************** *** 21,25 **** t) opttgajpg=1;;#conversion ".tga" ".jpg" "$OPTIND";; # convertit les tga en jpg J) optjpgbmp=1;;#conversion ".jpg" ".bmp" "$OPTIND";; # convertit les jpg en bmp ! d) optdelbmp=1;; # suprime les bmp (sauf si -t ou -j r | R) optrecursif=1 ;; # recursif h) opthelp=1;; --- 21,25 ---- t) opttgajpg=1;;#conversion ".tga" ".jpg" "$OPTIND";; # convertit les tga en jpg J) optjpgbmp=1;;#conversion ".jpg" ".bmp" "$OPTIND";; # convertit les jpg en bmp ! # d) optdelbmp=1;; # suprime les bmp (sauf si -t ou -j r | R) optrecursif=1 ;; # recursif h) opthelp=1;; *************** *** 37,41 **** echo " -t : convertit les .tga en .jpg" echo " -J : convertit les .jpg en .bmp" ! echo " -d : supprime les .bmp (donc -T et -J ignores)" echo " -r | -R : recursif pour tous les sous-repertoires" echo " -h : affiche cette aide" --- 37,41 ---- echo " -t : convertit les .tga en .jpg" echo " -J : convertit les .jpg en .bmp" ! # echo " -d : supprime les .bmp (donc -T et -J ignores)" echo " -r | -R : recursif pour tous les sous-repertoires" echo " -h : affiche cette aide" *************** *** 111,125 **** fi ! if [ "$optdelbmp" == "1" ] ! then ! echo " >>> suppression des .bmp de ce repertoire" ! for ENTREE in $file/*.bmp ! do ! if [ -e $ENTREE ] ! then ! rm $ENTREE ! fi ! done ! fi fi done --- 111,125 ---- fi ! # if [ "$optdelbmp" == "1" ] ! # then ! # echo " >>> suppression des .bmp de ce repertoire" ! # for ENTREE in $file/*.bmp ! # do ! # if [ -e $ENTREE ] ! # then ! # rm $ENTREE ! # fi ! # done ! # fi fi done |
|
From: Yohann C. <pl...@us...> - 2004-11-19 22:50:33
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29347 Added Files: pictconvert Removed Files: jpgbmp Log Message: "renomage" et modification du script. pleins d'options ! faites ./pictconvert -h pour en savoir plus... --- jpgbmp DELETED --- --- NEW FILE: pictconvert --- #!/bin/bash function explore() { if [ "$COLUMNS" == "" ] then TERMWIDTH=80 else TERMWIDTH=$COLUMNS fi # optrecursif=0; # optdelbmp=0; # opttgabmp=0; # opttgajpg=0; # optjpgbmp=0; while getopts "tTjdrRh" option do case $option in T) opttgabmp=1;; ##conversion ".tga" ".bmp" "$OPTIND";; # convertit les tga en bmp t) opttgajpg=1;;#conversion ".tga" ".jpg" "$OPTIND";; # convertit les tga en jpg J) optjpgbmp=1;;#conversion ".jpg" ".bmp" "$OPTIND";; # convertit les jpg en bmp d) optdelbmp=1;; # suprime les bmp (sauf si -t ou -j r | R) optrecursif=1 ;; # recursif h) opthelp=1;; *) echo "Option -$OPTARG inconnue" optaide=1 ;; esac options="$options$option" done # echo $options if [ "$opthelp" == "1" ] then echo "Usage : $0 [options] [dossier a explorer]"; echo "Options :" echo " -T : convertit les .tga en .bmp" echo " -t : convertit les .tga en .jpg" echo " -J : convertit les .jpg en .bmp" echo " -d : supprime les .bmp (donc -T et -J ignores)" echo " -r | -R : recursif pour tous les sous-repertoires" echo " -h : affiche cette aide" echo "----------------------------------------------------" echo "sorties:" echo " [OK]" echo " fichier correctement converti" echo " [FAILED]" echo " erreur dans la conversion du fichier" echo " verifier la presence de ImageMacick" echo " [PASS]" echo " le fichier de destination existait deja" echo " le fichier a donc ete ignoree" exit 0 fi if [ "$optdelbmp" == "1" ] then optjpgbmp=0 opttgabmp=0 fi shift $((OPTIND - 1)) ################################################################ for file in $* do # echo $file if [ -e $file ] then file=`echo $1 | sed -e "s/\/$//"` let as=$(echo $file | wc -c) let fillsize=$(( ($TERMWIDTH - $as) /2 )) fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " let fillsize=${fillsize}-1 done line="" let fillsize=$TERMWIDTH while [ "$fillsize" -gt "0" ] do line="${line}=" let fillsize=${fillsize}-1 done echo $line echo "$fill$file" echo $line if [ "$opttgabmp" == "1" ] then conversion ".tga" ".bmp" $file fi if [ "$opttgajpg" == "1" ] then conversion ".tga" ".jpg" $file fi if [ "$optjpgbmp" == "1" ] then conversion ".jpg" ".bmp" $file fi if [ "$optrecursif" == "1" ] then for FICHIER in $file/* do if test -d $FICHIER then explore $options $FICHIER fi done fi if [ "$optdelbmp" == "1" ] then echo " >>> suppression des .bmp de ce repertoire" for ENTREE in $file/*.bmp do if [ -e $ENTREE ] then rm $ENTREE fi done fi fi done } function conversion () { # echo "conversion de $1 en $2 -> $3" for ENTREE in $3/*$1 do if [ -e ./$ENTREE ] then SORTIE=$(echo $ENTREE | sed -e s/$1/$2/) affiche=" --- `basename $ENTREE` -> $2" if [ ! -e $SORTIE ] then convert $ENTREE $SORTIE if [ -e $SORTIE ] then result="[OK]" else result="[FAILED]" fi else result="[PASS]" fi let affichesize=$(echo $affiche | wc -c) let resultsize=$(echo $result | wc -c) let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 fill="" while [ "$fillsize" -gt "0" ] do fill="${fill} " let fillsize=${fillsize}-1 done echo "$affiche$fill$result" fi done } explore $* |
|
From: julien r. <jul...@us...> - 2004-11-19 18:54:55
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2342 Modified Files: game.cc rocket.cc rocket.h Log Message: particules roquettes :) Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rocket.cc 19 Nov 2004 12:05:14 -0000 1.3 --- rocket.cc 19 Nov 2004 18:54:45 -0000 1.4 *************** *** 14,17 **** --- 14,26 ---- pPhysic->SetVelocity(vVeloc); pPhysic->SetPhysicCallBack(this); + + + pEmit = new ParticleEmitter (100, Vector3(0,0,0), Game::pSelf->GetEngine()->pTextureManager->LoadTexture("data/particle.jpg", TG_TEXTURE_2D), 20.0f); + pEmit->SetParticlesSpeed (-vVeloc/100); + pEmit->SetLife(30.0f); + pEmit->Initialize (); + Game::pSelf->GetSceneManager()->AddParticlesEmitter(pEmit); + pModel->Attach("HEAD", pEmit); + //pPhysic->SetSpeed } *************** *** 19,23 **** Rocket::~Rocket () { ! } --- 28,32 ---- Rocket::~Rocket () { ! delete pEmit; } *************** *** 25,28 **** --- 34,39 ---- { Game::pSelf->RemovePawn(this); + Game::pSelf->GetSceneManager()->RemoveParticlesEmitter(pEmit); + if (other == NULL) //on a touche la map { Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** game.cc 19 Nov 2004 12:05:14 -0000 1.35 --- game.cc 19 Nov 2004 18:54:45 -0000 1.36 *************** *** 120,129 **** pEngine->pMeshManager->Load("rocket", "data/models/rocket/rocket.md5mesh"); - - ParticleEmitter* pEmit = new ParticleEmitter (100, Vector3(0,0,0), pEngine->pTextureManager->LoadTexture("data/particle.jpg", TG_TEXTURE_2D), 10.0f); - pEmit->SetParticlesSpeed (Vector3(90,0,0)); - pEmit->SetLife(30.0f); - pEmit->Initialize (); - pSceneManager->AddParticlesEmitter(pEmit); //creation du joueur --- 120,123 ---- Index: rocket.h =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** rocket.h 19 Nov 2004 12:05:14 -0000 1.3 --- rocket.h 19 Nov 2004 18:54:45 -0000 1.4 *************** *** 3,6 **** --- 3,7 ---- #include "projectile.h" + #include <particleemitter.h> class Rocket : public Projectile *************** *** 12,15 **** --- 13,17 ---- protected: static const float fSpeed; + ParticleEmitter* pEmit; }; |
|
From: julien r. <jul...@us...> - 2004-11-19 18:54:55
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2336 Modified Files: glrenderer.cc md5instance.cc md5instance.h mesh.h physicengine.cc Log Message: particules roquettes :) Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** physicengine.cc 19 Nov 2004 12:04:04 -0000 1.28 --- physicengine.cc 19 Nov 2004 18:54:42 -0000 1.29 *************** *** 42,49 **** if (trace.AllSolid) { ! //vVelocity.y = 0; //FIXME: ça ne semble plus poser problème et ça évite les objets traversant les murs //en fait, on devrait plutot tenter de renvoyer les objets en arriere jusqu'a ce que AllSolid devienne faux (en stockant la position précédente des objets et en y revenant par exemple ! vVelocity.Null(); return; } --- 42,49 ---- if (trace.AllSolid) { ! vVelocity.y = 0; //FIXME: ça ne semble plus poser problème et ça évite les objets traversant les murs //en fait, on devrait plutot tenter de renvoyer les objets en arriere jusqu'a ce que AllSolid devienne faux (en stockant la position précédente des objets et en y revenant par exemple ! //vVelocity.Null(); return; } Index: md5instance.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5instance.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** md5instance.h 19 Nov 2004 12:04:04 -0000 1.10 --- md5instance.h 19 Nov 2004 18:54:42 -0000 1.11 *************** *** 48,51 **** --- 48,52 ---- void Attach (const std::string& jointName, SceneNode* s); + void Detach (const std::string& jointName, SceneNode* s); int GetVertexStride () { return 0; } Index: glrenderer.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/glrenderer.cc,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** glrenderer.cc 19 Nov 2004 12:04:04 -0000 1.22 --- glrenderer.cc 19 Nov 2004 18:54:42 -0000 1.23 *************** *** 310,314 **** glLoadIdentity(); #define FOV 120 ! gluPerspective(FOV/2, ratio, 0.1f, 10000.0f); glMatrixMode(GL_MODELVIEW); --- 310,314 ---- glLoadIdentity(); #define FOV 120 ! gluPerspective(FOV/2, ratio, 4.0f, 4000.0f); glMatrixMode(GL_MODELVIEW); Index: md5instance.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5instance.cc,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** md5instance.cc 19 Nov 2004 12:04:04 -0000 1.14 --- md5instance.cc 19 Nov 2004 18:54:42 -0000 1.15 *************** *** 170,173 **** --- 170,202 ---- } + void MD5Instance::Detach (const std::string& jointName, SceneNode* s) + { + if (jointName == "") + { + std::vector<SceneNode*>::iterator start = vNodes.begin(); + std::vector<SceneNode*>::iterator end = vNodes.end(); + std::vector<SceneNode*>::iterator iter; + + iter = find(start,end,s); + if (iter != end) + vNodes.erase(iter); + return; + } + for (int i=0; i<iNumJoints; i++) + { + if (pJoints[i].sName == jointName) + { + std::vector<SceneNode*>::iterator start = pJoints[i].vNodes.begin(); + std::vector<SceneNode*>::iterator end = pJoints[i].vNodes.end(); + std::vector<SceneNode*>::iterator iter; + + iter = find(start,end,s); + if (iter != end) + pJoints[i].vNodes.erase(iter); + + } + } + } + void MD5Instance::_SkinMesh () { Index: mesh.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/mesh.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mesh.h 19 Nov 2004 12:04:04 -0000 1.4 --- mesh.h 19 Nov 2004 18:54:42 -0000 1.5 *************** *** 76,79 **** --- 76,80 ---- */ virtual void Attach (const std::string& jointName, SceneNode* s) = 0; + virtual void Detach (const std::string& jointName, SceneNode* s) = 0; |
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6108 Modified Files: aicontroller.cc game.cc pawn.cc pawn.h playercontroller.cc projectile.cc projectile.h rocket.cc rocket.h rocketlauncher.cc Log Message: rockets Index: projectile.cc =================================================================== RCS file: /cvsroot/epfl/tggame/projectile.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** projectile.cc 17 Nov 2004 23:12:56 -0000 1.2 --- projectile.cc 19 Nov 2004 12:05:14 -0000 1.3 *************** *** 1,7 **** #include "projectile.h" ! Projectile::Projectile() : Pawn () { - } --- 1,7 ---- #include "projectile.h" + #include "controller.h" ! Projectile::Projectile() : Pawn ("rocket") { } Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** game.cc 17 Nov 2004 23:12:56 -0000 1.34 --- game.cc 19 Nov 2004 12:05:14 -0000 1.35 *************** *** 83,86 **** --- 83,87 ---- void Game::AddPawn (Pawn* p, bool physic = true, bool scene = true) { + vPawns.push_back(p); if (scene) p->Add(pSceneManager); *************** *** 93,96 **** --- 94,98 ---- p->Remove(pSceneManager); p->Remove(pPhysicEngine); + //TODO: il faut enlever le pawn de vPawns; } *************** *** 117,134 **** pEngine->pMeshManager->LoadAnim("pinky", "data/models/player/death.md5anim"); ! pEngine->pMeshManager->Load("rocket", "data/models/player/hazmat.md5mesh"); ! ! //creation de l'arme ! /*MD5Instance* pModel = Engine::pMeshManager->LoadInstance("machinegun"); ! pModel->SetAnimation("idle"); ! pModel->bCamera = true; ! pModel->SetRotation(Quaternion(90, Vector3(0,0,1))); ! pModel->SetPosition(Vector3(5,0,-5)); ! pSceneManager->AddWorldObject(pModel);*/ //creation du joueur Pawn* p = new Pawn(); pSceneManager->SetCamera(cam); - vPawns.push_back(p); this->AddPawn(p); pLocalController = new PlayerController(p); --- 119,133 ---- pEngine->pMeshManager->LoadAnim("pinky", "data/models/player/death.md5anim"); ! pEngine->pMeshManager->Load("rocket", "data/models/rocket/rocket.md5mesh"); + ParticleEmitter* pEmit = new ParticleEmitter (100, Vector3(0,0,0), pEngine->pTextureManager->LoadTexture("data/particle.jpg", TG_TEXTURE_2D), 10.0f); + pEmit->SetParticlesSpeed (Vector3(90,0,0)); + pEmit->SetLife(30.0f); + pEmit->Initialize (); + pSceneManager->AddParticlesEmitter(pEmit); + //creation du joueur Pawn* p = new Pawn(); pSceneManager->SetCamera(cam); this->AddPawn(p); pLocalController = new PlayerController(p); *************** *** 136,139 **** --- 135,139 ---- cam->SetViewOffset(Vector3(0,70,0)); pLocalController->SetViewOffset(Vector3(0,60,0)); + p->SetBB(Vector3(-15, 0, -15), Vector3(15, 80, 15)); //p->SetPosition(pWorld->GetRandomStartPosition()+Vector3(20,80,20)); *************** *** 147,152 **** //for (int i=0; i<pWorld->GetNumStartPositions(); i++) //{ ! p = new Pawn(); ! vPawns.push_back(p); this->AddPawn(p); Controller* c = new AIController(p); --- 147,152 ---- //for (int i=0; i<pWorld->GetNumStartPositions(); i++) //{ ! p = new Pawn("pinky"); ! p->SetAnimation("stand"); this->AddPawn(p); Controller* c = new AIController(p); *************** *** 156,159 **** --- 156,160 ---- //p->SetRotation(Quaternion(-90, Vector3(1,0,0))); p->SetPosition(pWorld->GetStartPosition(0)); + p->SetBB(Vector3(-15, 0, -15), Vector3(15, 80, 15)); c->SetViewOffset(Vector3(0,70,0)); //} Index: rocketlauncher.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rocketlauncher.cc 17 Nov 2004 23:12:56 -0000 1.2 --- rocketlauncher.cc 19 Nov 2004 12:05:14 -0000 1.3 *************** *** 20,34 **** fCoolDown = fFireRate; - Rocket* pRocket = new Rocket (); - pRocket->Add(Game::pSelf->GetSceneManager()); - pRocket->Add(Game::pSelf->GetPhysicEngine()); - Vector3 target = vPosition - vTarget*10000; ! CollisionResult cR = Game::pSelf->Trace(vPosition, target, p); if (cR.pNode == NULL) //on a touche la map Game::pSelf->GetSceneManager()->GetDecalManager()->AddDecal(cR.EndPoint, cR.Normal, 1.0f, 1.0f, Engine::pTextureManager->LoadTexture("data/textures/decals/mgun.bmp", TG_TEXTURE_2D), 10.0f); if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) //on a touche un objet ! cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal); SoundManager::pSoundManager->PlaySound("gun"); --- 20,33 ---- fCoolDown = fFireRate; Vector3 target = vPosition - vTarget*10000; + + Rocket* pRocket = new Rocket (vPosition, target); + Game::pSelf->AddPawn(pRocket, true, true); ! /*CollisionResult cR = Game::pSelf->Trace(vPosition, target, p); if (cR.pNode == NULL) //on a touche la map Game::pSelf->GetSceneManager()->GetDecalManager()->AddDecal(cR.EndPoint, cR.Normal, 1.0f, 1.0f, Engine::pTextureManager->LoadTexture("data/textures/decals/mgun.bmp", TG_TEXTURE_2D), 10.0f); if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) //on a touche un objet ! cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal);*/ SoundManager::pSoundManager->PlaySound("gun"); Index: rocket.h =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rocket.h 17 Nov 2004 23:12:56 -0000 1.2 --- rocket.h 19 Nov 2004 12:05:14 -0000 1.3 *************** *** 7,12 **** { public: ! Rocket (); protected: }; --- 7,15 ---- { public: ! Rocket (const Vector3& vPosition, const Vector3& vTarget); ! ~Rocket (); ! void Collide (PhysicNode* other,const Vector3& vPoint, const Vector3& vCollisionNormal); protected: + static const float fSpeed; }; Index: projectile.h =================================================================== RCS file: /cvsroot/epfl/tggame/projectile.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** projectile.h 17 Nov 2004 23:12:56 -0000 1.2 --- projectile.h 19 Nov 2004 12:05:14 -0000 1.3 *************** *** 6,18 **** #include <md5instance.h> #include <physicnode.h> using namespace tg; ! class Projectile : public Pawn { public: ! Projectile (); ! virtual ~Projectile (); ! protected: }; --- 6,19 ---- #include <md5instance.h> #include <physicnode.h> + #include <physiccallback.h> using namespace tg; ! class Projectile : public Pawn, public PhysicCallBack { public: ! Projectile (); ! virtual ~Projectile (); ! virtual void Collide (PhysicNode* other,const Vector3& vPoint, const Vector3& vCollisionNormal) = 0; protected: }; Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** rocket.cc 17 Nov 2004 23:12:56 -0000 1.2 --- rocket.cc 19 Nov 2004 12:05:14 -0000 1.3 *************** *** 1,9 **** #include "rocket.h" ! Rocket::Rocket () : Projectile () { ! /*pModel = Engine::pMeshManager->LoadInstance("rocket"); ! pPhysic = new PhysicNode(pModel); ! pModel->GetBBox()->vMin.Set(-5,-5,-5); ! pModel->GetBBox()->vMax.Set(5,5,5);*/ ! } \ No newline at end of file --- 1,37 ---- #include "rocket.h" + #include "game.h" + #include <vector3.h> ! const float Rocket::fSpeed = 900.0f; ! ! Rocket::Rocket (const Vector3& vPosition, const Vector3& vTarget) : Projectile () { ! pPhysic->SetGravityFactor(0.0f); ! pPhysic->SetPosition(vPosition); ! Vector3 vVeloc = (vTarget-vPosition).Normalize(); ! vVeloc *= fSpeed; ! //std::cout << "[TGGAME] " << vVeloc << std::endl; ! pPhysic->SetVelocity(vVeloc); ! pPhysic->SetPhysicCallBack(this); ! //pPhysic->SetSpeed ! } ! ! Rocket::~Rocket () ! { ! ! } ! ! void Rocket::Collide (PhysicNode* other,const Vector3& vPoint, const Vector3& vCollisionNormal) ! { ! Game::pSelf->RemovePawn(this); ! if (other == NULL) //on a touche la map ! { ! //FIXME: Ugly hack pour que le decal soit fixé contre le mur. Le vPoint est en fait la position du node au moment de la collision. Hors, le node a une bounding box, ce qui fait que le vPoint est éloigné du mur. ! Vector3 cP = vPoint - vCollisionNormal*15; ! Game::pSelf->GetSceneManager()->GetDecalManager()->AddDecal(cP, vCollisionNormal, 50.0f, 50.0f, Engine::pTextureManager->LoadTexture("data/textures/decals/rocket.jpg", TG_TEXTURE_2D), 10.0f); ! } ! ! if (other != NULL && other->GetPhysicCallBack() != NULL) //on a touche un objet ! other->GetPhysicCallBack()->Collide(NULL, vPoint, vCollisionNormal); ! delete this; ! } Index: pawn.cc =================================================================== RCS file: /cvsroot/epfl/tggame/pawn.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pawn.cc 17 Nov 2004 23:12:56 -0000 1.13 --- pawn.cc 19 Nov 2004 12:05:14 -0000 1.14 *************** *** 3,13 **** using namespace tg; ! Pawn::Pawn() : Actor () { ! pModel = Engine::pMeshManager->LoadInstance("pinky"); ! pModel->SetAnimation("stand"); pPhysic = new PhysicNode(pModel); - pModel->GetBBox()->vMin.Set(-15,0,-15); - pModel->GetBBox()->vMax.Set(15,80,15); //pPhysic->SetClip(false); fMoveSpeed = 0.0f; --- 3,11 ---- using namespace tg; ! Pawn::Pawn(const std::string& mesh) : Actor () { ! pModel = Engine::pMeshManager->LoadInstance(mesh); ! //pModel->SetAnimation("stand"); pPhysic = new PhysicNode(pModel); //pPhysic->SetClip(false); fMoveSpeed = 0.0f; Index: pawn.h =================================================================== RCS file: /cvsroot/epfl/tggame/pawn.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pawn.h 17 Nov 2004 23:12:56 -0000 1.13 --- pawn.h 19 Nov 2004 12:05:14 -0000 1.14 *************** *** 23,27 **** * Constructeur */ ! Pawn (); virtual ~Pawn (); /** --- 23,27 ---- * Constructeur */ ! Pawn (const std::string& mesh="pinky"); virtual ~Pawn (); /** Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** playercontroller.cc 17 Nov 2004 23:12:56 -0000 1.20 --- playercontroller.cc 19 Nov 2004 12:05:14 -0000 1.21 *************** *** 29,33 **** { vTarget = pPawn->GetRotation().GetZAxis(); ! vPosition = pPawn->GetPosition()+vViewOffset; pWeapon->Fire (vPosition, vTarget, pPawn); } --- 29,33 ---- { vTarget = pPawn->GetRotation().GetZAxis(); ! vPosition = pPawn->GetPosition()+vViewOffset-vTarget*50; pWeapon->Fire (vPosition, vTarget, pPawn); } Index: aicontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.cc,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** aicontroller.cc 17 Nov 2004 23:12:56 -0000 1.12 --- aicontroller.cc 19 Nov 2004 12:05:14 -0000 1.13 *************** *** 67,70 **** --- 67,71 ---- { iLife -= 5; + std::cout << "OUCH" << std::endl; if (!bAlive) { |
|
From: julien r. <jul...@us...> - 2004-11-19 12:04:14
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5723 Modified Files: camera.h glrenderer.cc md5instance.cc md5instance.h md5mesh10.cc md5mesh10.h mesh.h particleemitter.cc particleemitter.h physicengine.cc physicnode.cc physicnode.h scenemanager.cc scenenode.h Log Message: rockets Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** physicengine.cc 17 Nov 2004 23:21:42 -0000 1.27 --- physicengine.cc 19 Nov 2004 12:04:04 -0000 1.28 *************** *** 42,46 **** if (trace.AllSolid) { ! vVelocity.y = 0; return; } --- 42,49 ---- if (trace.AllSolid) { ! //vVelocity.y = 0; ! //FIXME: ça ne semble plus poser problème et ça évite les objets traversant les murs ! //en fait, on devrait plutot tenter de renvoyer les objets en arriere jusqu'a ce que AllSolid devienne faux (en stockant la position précédente des objets et en y revenant par exemple ! vVelocity.Null(); return; } *************** *** 143,149 **** if (trace.AllSolid) vUpNewPos = trace.EndPoint; - //appel de la callback pour les collisions avec la map. Ca permet aux objets style rockets de savoir s'ils doivent exploser - if (trace.Fraction < 1.0f && n->GetPhysicCallBack() != NULL) - n->GetPhysicCallBack()->Collide(trace.pNode, trace.EndPoint, trace.Normal); if (updist > dist) //on passe l'obstacle --- 146,149 ---- *************** *** 200,214 **** //on a un objet qui doit subir les forces et les collisions ! Vector3 vVelocity = n->GetVelocity(); ! if (!n->OnGround()) ! vVelocity.y = -(*pGravity); ! else if (vVelocity.y < 0) //si l'objet touche le sol, il faut ramener la gravité à zéro, sinon, l'objet va se retrouver avec une gravité négative très grande (ça l'empeche de sauter notamment) ! vVelocity.y = 0; ! //std::cout << "OnGround : " << n->OnGround(); ! //std::cout << "Accel : \t" << n->GetAccel() << std::endl; ! //int red[]={1,0,0}; ! //Engine::pEngine->pRenderer->drawDebugArrow(n->vPosition, n->vPosition+n->vAccel*5, red); ! //std::cout << n->GetVelocity() << std::endl; ! n->SetVelocity(vVelocity); //mise a jour des volumes englobants n->CalculateBoundingVolume(); --- 200,218 ---- //on a un objet qui doit subir les forces et les collisions ! if (n->GetGravityFactor() > EPSILON) //on évite de s'amuser si l'objet se fout de la gravité ! { ! Vector3 vVelocity = n->GetVelocity(); ! if (!n->OnGround()) ! vVelocity.y = -(*pGravity)*n->GetGravityFactor(); ! else if (vVelocity.y < 0) //si l'objet touche le sol, il faut ramener la gravité à zéro, sinon, l'objet va se retrouver avec une gravité négative très grande (ça l'empeche de sauter notamment) ! vVelocity.y = 0; ! ! //std::cout << "OnGround : " << n->OnGround(); ! //std::cout << "Accel : \t" << n->GetAccel() << std::endl; ! //int red[]={1,0,0}; ! //Engine::pEngine->pRenderer->drawDebugArrow(n->vPosition, n->vPosition+n->vAccel*5, red); ! //std::cout << n->GetVelocity() << std::endl; ! n->SetVelocity(vVelocity); ! } //mise a jour des volumes englobants n->CalculateBoundingVolume(); *************** *** 217,222 **** --- 221,234 ---- if (pLevel) { + //appel de la callback pour les collisions avec la map. Ca permet aux objets style rockets de savoir s'ils doivent exploser + CollisionResult trace = Trace(n->GetPosition(), n->GetPosition()+n->GetVelocity()*eTime, n->GetBBox()->vMin, n->GetBBox()->vMax, n); + if ((trace.Fraction < 1.0f || trace.AllSolid) && n->GetPhysicCallBack() != NULL) + n->GetPhysicCallBack()->Collide(trace.pNode, trace.EndPoint, trace.Normal); + + if (n==NULL) //il est possible que l'appel a la callback entraine la suppression de l'objet (la rocket explose), on doit donc verifier que le pointeur soit toujours valide avant de continuer + continue; _TryToStep(n, eTime); + Quaternion q = n->GetRotationVelocity()*eTime; q.Normalize(); Index: particleemitter.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/particleemitter.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** particleemitter.cc 17 Nov 2004 23:12:38 -0000 1.3 --- particleemitter.cc 19 Nov 2004 12:04:04 -0000 1.4 *************** *** 4,10 **** { ! ParticleEmitter::ParticleEmitter (int numParticles, Vector3 vOrig, Material* m, float s) : SceneNode (vOrig) { _TG_INIT_DLINKEDNODE(NULL, NULL) iNumParticles = numParticles; --- 4,12 ---- { ! ParticleEmitter::ParticleEmitter (int numParticles, Vector3 vOrig, Texture* m, float s) : SceneNode (vOrig) { _TG_INIT_DLINKEDNODE(NULL, NULL) + + fTime = -1; iNumParticles = numParticles; *************** *** 23,31 **** fRandomMultiplier = 1.0f; ! pMat = m; ! for(int i=0; i<iNumParticles; i++) { ! pQuads[i] = new float[7]; pPartArray[i].active = true; pPartArray[i].life = fLife; --- 25,40 ---- fRandomMultiplier = 1.0f; ! pTex = m; ! ! bInitialized = false; ! } ! ! void ParticleEmitter::Initialize () ! { for(int i=0; i<iNumParticles; i++) { ! if (!bInitialized) //on ne recrée pas le tableau si ça a déjà été fait ! pQuads[i] = new float[7]; ! pPartArray[i].active = true; pPartArray[i].life = fLife; *************** *** 52,61 **** pPartArray[i].vPosition = vPosition; } ! } void ParticleEmitter::PreRender (float elapsedTime) { ! static Particle* pTemp; vPosition += vSpeed*elapsedTime; --- 61,72 ---- pPartArray[i].vPosition = vPosition; } ! bInitialized = true; } void ParticleEmitter::PreRender (float elapsedTime) { ! if (!bInitialized) ! return; ! Particle* pTemp; vPosition += vSpeed*elapsedTime; *************** *** 67,71 **** { pTemp->vPosition += pPartArray[i].vSpeed*elapsedTime; - pTemp->life -= pTemp->fade*elapsedTime; --- 78,81 ---- Index: scenemanager.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenemanager.cc,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** scenemanager.cc 17 Nov 2004 23:12:39 -0000 1.19 --- scenemanager.cc 19 Nov 2004 12:04:04 -0000 1.20 *************** *** 39,43 **** void SceneManager::_ProcessTimedObject (ParticleEmitter* s, float t) { ! if (s->fTime < -1) //l'objet ne tient pas compte du temps return; --- 39,43 ---- void SceneManager::_ProcessTimedObject (ParticleEmitter* s, float t) { ! if (s->fTime == -1) //l'objet ne tient pas compte du temps return; *************** *** 46,50 **** { RemoveParticlesEmitter(s); ! //delete s; } } --- 46,50 ---- { RemoveParticlesEmitter(s); ! delete s; } } *************** *** 196,200 **** Engine::pRenderer->End2D(); #endif - ParticleEmitter* p = pFirstEmitter; if (p != NULL) --- 196,199 ---- Index: physicnode.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicnode.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** physicnode.cc 17 Nov 2004 23:12:39 -0000 1.10 --- physicnode.cc 19 Nov 2004 12:04:04 -0000 1.11 *************** *** 14,17 **** --- 14,18 ---- vPosition.Null(); vAccel.Null(); + fGravityFactor = 1.0f; //vEuler.Null(); Index: physicnode.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicnode.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** physicnode.h 17 Nov 2004 23:12:39 -0000 1.8 --- physicnode.h 19 Nov 2004 12:04:04 -0000 1.9 *************** *** 31,34 **** --- 31,37 ---- SceneNode* GetSceneNode (int i = 0) { return vNodes[i]; } + inline float GetGravityFactor () { return fGravityFactor; } + inline void SetGravityFactor (float f) { fGravityFactor = f; } + /** * Retourne un pointeur sur la classe servant de callback en cas de collision *************** *** 129,132 **** --- 132,137 ---- bool bOnGround; bool bBlockTrace; + /* Comment cet objet est-il influencé par la gravité */ + float fGravityFactor; Vector3 vAccel; Index: particleemitter.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/particleemitter.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** particleemitter.h 17 Nov 2004 23:12:38 -0000 1.3 --- particleemitter.h 19 Nov 2004 12:04:04 -0000 1.4 *************** *** 19,26 **** public: ! ParticleEmitter (int numParticles, Vector3 vOrig, Material*, float s); virtual ~ParticleEmitter() {} void PreRender (float ); void SetPosition (Vector3 pos) { vPosition = pos; } --- 19,28 ---- public: ! ParticleEmitter (int numParticles, Vector3 vOrig, Texture*, float s); virtual ~ParticleEmitter() {} void PreRender (float ); + + void Initialize (); void SetPosition (Vector3 pos) { vPosition = pos; } *************** *** 53,57 **** void SetShape (EmitterShape* s) { pShape = s; } ! Material* GetMaterial () { return pMat; } protected: int iNumParticles; --- 55,59 ---- void SetShape (EmitterShape* s) { pShape = s; } ! Texture* GetTexture () { return pTex; } protected: int iNumParticles; *************** *** 63,71 **** float** pQuads; //les quads qui doivent être rendus ! Particle* pPartArray; EmitterShape* pShape; ! Material* pMat; Vector3 vSpeed; --- 65,74 ---- float** pQuads; //les quads qui doivent être rendus ! ! bool bInitialized; Particle* pPartArray; EmitterShape* pShape; ! Texture* pTex; Vector3 vSpeed; Index: mesh.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/mesh.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mesh.h 17 Nov 2004 23:12:38 -0000 1.3 --- mesh.h 19 Nov 2004 12:04:04 -0000 1.4 *************** *** 70,73 **** --- 70,79 ---- virtual void DrawVisibleEdges () = 0; + + /** + * Permet d'attacher des scenode à des joints ou a des mesh + * Ne __pas__ attacher de scenenode étant déjà attaché à un physicnode + */ + virtual void Attach (const std::string& jointName, SceneNode* s) = 0; *************** *** 86,89 **** --- 92,96 ---- float** pTexCoordList; Face* pTrianglesList; + std::vector<SceneNode*> vNodes; }; Index: md5mesh10.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5mesh10.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** md5mesh10.h 17 Nov 2004 23:12:38 -0000 1.7 --- md5mesh10.h 19 Nov 2004 12:04:04 -0000 1.8 *************** *** 44,47 **** --- 44,48 ---- inline Quaternion& GetJointOrientation(int i) { return pJoints[i].qOrientation; } inline int GetNumBaseJoints() { return iNumBaseJoints; } + inline std::string GetJointName(int i) { return pJoints[i].sName; } //Meshes informations Index: camera.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/camera.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** camera.h 17 Nov 2004 23:12:37 -0000 1.5 --- camera.h 19 Nov 2004 12:04:04 -0000 1.6 *************** *** 41,47 **** bool bShift; ! Vector3 GetForward () { return vForward; } ! Vector3 GetUp () { return vUp; } ! Vector3 GetRight () { return vRight; } Frustum frustum; --- 41,47 ---- bool bShift; ! Vector3 GetForward () { return -qRotation.GetZAxis(); } ! Vector3 GetUp () { return qRotation.GetYAxis(); } ! Vector3 GetRight () { return qRotation.GetXAxis(); } Frustum frustum; Index: md5instance.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5instance.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** md5instance.h 17 Nov 2004 23:12:38 -0000 1.9 --- md5instance.h 19 Nov 2004 12:04:04 -0000 1.10 *************** *** 46,50 **** /*bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); bool TriangleTrace(Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal);*/ ! int GetVertexStride () { return 0; } --- 46,51 ---- /*bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); bool TriangleTrace(Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal);*/ ! ! void Attach (const std::string& jointName, SceneNode* s); int GetVertexStride () { return 0; } *************** *** 81,84 **** --- 82,86 ---- struct Joint { + std::string sName; int iNumber; int iParent; *************** *** 89,92 **** --- 91,95 ---- Joint** pChildrens; int iNumChildrens; + std::vector<SceneNode*> vNodes; }; Index: glrenderer.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/glrenderer.cc,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** glrenderer.cc 17 Nov 2004 23:12:37 -0000 1.21 --- glrenderer.cc 19 Nov 2004 12:04:04 -0000 1.22 *************** *** 73,78 **** ! Vector3 horiz=0.5*axis[1]*10; ! Vector3 vert=0.5*axis[2]*10; (*_glActiveTextureARB)(GL_TEXTURE0); glEnable (GL_TEXTURE_2D); --- 73,78 ---- ! Vector3 horiz=0.5*axis[1]*d->fSizeX; ! Vector3 vert=0.5*axis[2]*d->fSizeY; (*_glActiveTextureARB)(GL_TEXTURE0); glEnable (GL_TEXTURE_2D); *************** *** 601,605 **** glBlendFunc( GL_SRC_ALPHA, GL_ONE ); ! BindMaterial (p->GetMaterial()); for (int i=0; i<p->GetParticlesCount();i++) --- 601,608 ---- glBlendFunc( GL_SRC_ALPHA, GL_ONE ); ! //BindMaterial (p->GetMaterial()); ! (*_glActiveTextureARB)(GL_TEXTURE0); ! glEnable (GL_TEXTURE_2D); ! glBindTexture(GL_TEXTURE_2D, p->GetTexture()->iId); for (int i=0; i<p->GetParticlesCount();i++) *************** *** 902,906 **** { float matrix[16]; ! s->GetRotation().GetMatrix(matrix); glMultMatrixf (matrix); /*glRotatef(s->GetRotation().x, 1, 0, 0); --- 905,909 ---- { float matrix[16]; ! s->GetFinalRotation().GetMatrix(matrix); glMultMatrixf (matrix); /*glRotatef(s->GetRotation().x, 1, 0, 0); *************** *** 1189,1193 **** glLoadIdentity (); ! glTranslatef(mesh->GetPosition().x, mesh->GetPosition().y, mesh->GetPosition().z); #ifdef DEBUG if (!mesh->bCamera) { --- 1192,1196 ---- glLoadIdentity (); ! glTranslatef(mesh->GetFinalPosition().x, mesh->GetFinalPosition().y, mesh->GetFinalPosition().z); #ifdef DEBUG if (!mesh->bCamera) { Index: md5instance.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5instance.cc,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** md5instance.cc 17 Nov 2004 23:12:38 -0000 1.13 --- md5instance.cc 19 Nov 2004 12:04:04 -0000 1.14 *************** *** 26,29 **** --- 26,30 ---- for (int i=0; i<iNumJoints; i++) { + pJoints[i].sName = pData->GetJointName(i); pJoints[i].iNumber = i; pJoints[i].iParent = pData->GetJointParent(i); *************** *** 120,124 **** --- 121,133 ---- void MD5Instance::PreRender(float fTime) { + _ComputeFinalPosAndRot (); + fCurrentTime += fTime; + for (unsigned int i=0; i<vNodes.size(); i++) + { + vNodes[i]->SetPosition(vFinalPosition); + vNodes[i]->SetRotation(qFinalRotation); + } + if (iCurrentAnimation < 0) return; *************** *** 146,149 **** --- 155,173 ---- } + void MD5Instance::Attach (const std::string& jointName, SceneNode* s) + { + if (jointName == "") //on l'attache au mesh + { + vNodes.push_back(s); + return; + } + for (int i=0; i<iNumJoints; i++) + { + if (pJoints[i].sName == jointName) + pJoints[i].vNodes.push_back(s); + } + vNodes.push_back(s); //si on ne trouve pas de joint, on l'attache au mesh + } + void MD5Instance::_SkinMesh () { *************** *** 258,261 **** --- 282,291 ---- } + for (unsigned int i=0; i<pJoint->vNodes.size(); i++) + { + pJoint->vNodes[i]->SetPosition(vFinalPosition+pJoint->vPosition); + pJoint->vNodes[i]->SetRotation(qFinalRotation*pJoint->qOrientation); + } + //std::cout << pJoint->vPosition << std::endl; for (int i = 0; i < pJoint->iNumChildrens; i++) Index: md5mesh10.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/md5mesh10.cc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** md5mesh10.cc 17 Nov 2004 23:12:38 -0000 1.8 --- md5mesh10.cc 19 Nov 2004 12:04:04 -0000 1.9 *************** *** 77,80 **** --- 77,83 ---- NEXT("\"") pJoints[i].sName = buffer; + pJoints[i].sName.erase(0,1); //on efface le premier " + int last = pJoints[i].sName.find_last_of('\"'); + pJoints[i].sName.erase(last); //std::cout << pJoints[i].sName << std::endl; Quaternion q; Index: scenenode.h =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/scenenode.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** scenenode.h 17 Nov 2004 23:12:39 -0000 1.9 --- scenenode.h 19 Nov 2004 12:04:04 -0000 1.10 *************** *** 36,57 **** virtual void SetPosition (Vector3 v); Vector3 GetPosition () { return vPosition; } /* Rotation */ inline Quaternion GetRotation () { return qRotation; } inline void SetRotation (const Quaternion& q) { qRotation=q; } ! /*Vector3 GetRotation () { return vEuler; } ! virtual void SetRotation (const Vector3& v) { vEuler = v; } ! inline float GetXRot () { return vEuler.x; } ! inline float GetYRot () { return vEuler.y; } ! inline float GetZRot () { return vEuler.z; } ! inline void SetXRot (float f) { vEuler.x = f; } ! inline void SetYRot (float f) { vEuler.y = f; } ! inline void SetZRot (float f) { vEuler.z = f; } ! inline void AddXRot (float f) { vEuler.x += f; } ! inline void AddYRot (float f) { vEuler.y += f; } ! inline void AddZRot (float f) { vEuler.z += f; }*/ /* Autres */ //virtual void CalculateBoundingVolume (); virtual bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); --- 36,63 ---- virtual void SetPosition (Vector3 v); Vector3 GetPosition () { return vPosition; } + /** + * SetLocalPosition permet de décaler l'objet par rapport a son propre systeme de coordonnes + */ + inline void SetLocalPosition (const Vector3& v) { vLocalPosition = v; } + inline Vector3 GetLocalPosition () { return vLocalPosition; } + + /** + * Retourne la position 'finale', c'est à dire vLocalPosition + vPosition + */ + inline Vector3 GetFinalPosition () { return vFinalPosition; } /* Rotation */ inline Quaternion GetRotation () { return qRotation; } inline void SetRotation (const Quaternion& q) { qRotation=q; } ! inline void SetLocalRotation (const Quaternion& q) { qLocalRotation = q; } ! inline Quaternion GetLocalRotation () { return qLocalRotation; } + /** + * Retourne la rotation 'finale', c'est à dire qRotation*qLocalRotation + */ + inline Quaternion GetFinalRotation () { return qFinalRotation; } /* Autres */ //virtual void CalculateBoundingVolume (); + // virtual bool Trace (Vector3 Begin, Vector3 End, Vector3& colPoint, Vector3& colNormal); *************** *** 63,66 **** --- 69,74 ---- float fTime; protected: + inline void _ComputeFinalPosAndRot () { vFinalPosition = vPosition+vLocalPosition; qFinalRotation = qRotation*qLocalRotation; } + //PhysicCallBack* pPhysicCallBack; bool bRender; *************** *** 68,71 **** --- 76,83 ---- Quaternion qRotation; Vector3 vPosition; + Vector3 vLocalPosition; + Quaternion qLocalRotation; + Vector3 vFinalPosition; + Quaternion qFinalRotation; BoundingBox* pBBox; |
|
From: Yohann C. <pl...@us...> - 2004-11-18 07:02:34
|
Update of /cvsroot/epfl/tgtools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20232 Modified Files: jpgbmp Log Message: convertit maintenant les .tga en .jpg uniquement.... Index: jpgbmp =================================================================== RCS file: /cvsroot/epfl/tgtools/jpgbmp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** jpgbmp 17 Nov 2004 21:48:23 -0000 1.1 --- jpgbmp 18 Nov 2004 07:02:25 -0000 1.2 *************** *** 32,62 **** done ! for ENTREE in $file/*.jpg ! do ! if [ -e ./$ENTREE ]; then ! affiche=" --- `basename $ENTREE`" ! SORTIE=$(echo $ENTREE | sed -e s/jpg/bmp/) ! if [ ! -e $SORTIE ]; then ! convert $ENTREE $SORTIE ! if [ -e $SORTIE ]; then ! result="[OK]" ! else ! result="[FAILED]" ! fi ! else ! result="[PASS]" ! fi ! let affichesize=$(echo $affiche | wc -c) ! let resultsize=$(echo $result | wc -c) ! let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 ! fill="" ! while [ "$fillsize" -gt "0" ] ! do ! fill="${fill} " ! let fillsize=${fillsize}-1 ! done ! echo "$affiche$fill$result" ! fi ! done for ENTREE in $file/*.tga --- 32,62 ---- done ! # for ENTREE in $file/*.jpg ! # do ! # if [ -e ./$ENTREE ]; then ! # affiche=" --- `basename $ENTREE`" ! # SORTIE=$(echo $ENTREE | sed -e s/jpg/bmp/) ! # if [ ! -e $SORTIE ]; then ! # convert $ENTREE $SORTIE ! # if [ -e $SORTIE ]; then ! # result="[OK]" ! # else ! # result="[FAILED]" ! # fi ! # else ! # result="[PASS]" ! # fi ! # let affichesize=$(echo $affiche | wc -c) ! # let resultsize=$(echo $result | wc -c) ! # let fillsize=${TERMWIDTH}-${affichesize}-${resultsize}-3 ! # fill="" ! # while [ "$fillsize" -gt "0" ] ! # do ! # fill="${fill} " ! # let fillsize=${fillsize}-1 ! # done ! # echo "$affiche$fill$result" ! # fi ! # done for ENTREE in $file/*.tga *************** *** 64,68 **** if [ -e ./$ENTREE ]; then affiche=" --- `basename $ENTREE`" ! SORTIE=$(echo $ENTREE | sed -e s/tga/bmp/) if [ ! -e $SORTIE ]; then convert $ENTREE $SORTIE --- 64,68 ---- if [ -e ./$ENTREE ]; then affiche=" --- `basename $ENTREE`" ! SORTIE=$(echo $ENTREE | sed -e s/tga/jpg/) if [ ! -e $SORTIE ]; then convert $ENTREE $SORTIE |
|
From: julien r. <jul...@us...> - 2004-11-17 23:21:55
|
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23704 Modified Files: physicengine.cc Log Message: sigsev destruction Index: physicengine.cc =================================================================== RCS file: /cvsroot/epfl/tgengine-0.1/physicengine.cc,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** physicengine.cc 17 Nov 2004 23:12:39 -0000 1.26 --- physicengine.cc 17 Nov 2004 23:21:42 -0000 1.27 *************** *** 144,148 **** vUpNewPos = trace.EndPoint; //appel de la callback pour les collisions avec la map. Ca permet aux objets style rockets de savoir s'ils doivent exploser ! if (trace.Fraction < 1.0f) n->GetPhysicCallBack()->Collide(trace.pNode, trace.EndPoint, trace.Normal); --- 144,148 ---- vUpNewPos = trace.EndPoint; //appel de la callback pour les collisions avec la map. Ca permet aux objets style rockets de savoir s'ils doivent exploser ! if (trace.Fraction < 1.0f && n->GetPhysicCallBack() != NULL) n->GetPhysicCallBack()->Collide(trace.pNode, trace.EndPoint, trace.Normal); |
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21461 Modified Files: Makefile Makefile.Linux Makefile.LinuxVideo Makefile.OSX Makefile.OSXVideo actor.h aicontroller.cc aicontroller.h config.cfg controller.cc controller.h dox_config game.cc game.h gamedefs.h model.cc model.h pawn.cc pawn.h playercontroller.cc playercontroller.h projectile.cc projectile.h rocket.cc rocket.h rocketlauncher.cc rocketlauncher.h tg.cc weapon.cc weapon.h world.cc world.h Log Message: force commit Index: projectile.cc =================================================================== RCS file: /cvsroot/epfl/tggame/projectile.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** projectile.cc 17 Nov 2004 22:56:27 -0000 1.1 --- projectile.cc 17 Nov 2004 23:12:56 -0000 1.2 *************** *** 1,5 **** #include "projectile.h" ! Projectile::Projectile() : Actor () { --- 1,5 ---- #include "projectile.h" ! Projectile::Projectile() : Pawn () { Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** game.cc 17 Nov 2004 22:56:27 -0000 1.33 --- game.cc 17 Nov 2004 23:12:56 -0000 1.34 *************** *** 116,119 **** --- 116,121 ---- pEngine->pMeshManager->LoadAnim("pinky", "data/models/player/stand.md5anim"); pEngine->pMeshManager->LoadAnim("pinky", "data/models/player/death.md5anim"); + + pEngine->pMeshManager->Load("rocket", "data/models/player/hazmat.md5mesh"); //creation de l'arme Index: rocket.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocket.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rocket.cc 17 Nov 2004 22:56:27 -0000 1.1 --- rocket.cc 17 Nov 2004 23:12:56 -0000 1.2 *************** *** 3,9 **** Rocket::Rocket () : Projectile () { ! pModel = Engine::pMeshManager->LoadInstance("rocket"); pPhysic = new PhysicNode(pModel); pModel->GetBBox()->vMin.Set(-5,-5,-5); ! pModel->GetBBox()->vMax.Set(5,5,5); } \ No newline at end of file --- 3,9 ---- Rocket::Rocket () : Projectile () { ! /*pModel = Engine::pMeshManager->LoadInstance("rocket"); pPhysic = new PhysicNode(pModel); pModel->GetBBox()->vMin.Set(-5,-5,-5); ! pModel->GetBBox()->vMax.Set(5,5,5);*/ } \ No newline at end of file Index: rocketlauncher.cc =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.cc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rocketlauncher.cc 17 Nov 2004 22:56:27 -0000 1.1 --- rocketlauncher.cc 17 Nov 2004 23:12:56 -0000 1.2 *************** *** 20,23 **** --- 20,27 ---- fCoolDown = fFireRate; + Rocket* pRocket = new Rocket (); + pRocket->Add(Game::pSelf->GetSceneManager()); + pRocket->Add(Game::pSelf->GetPhysicEngine()); + Vector3 target = vPosition - vTarget*10000; Index: rocketlauncher.h =================================================================== RCS file: /cvsroot/epfl/tggame/rocketlauncher.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rocketlauncher.h 17 Nov 2004 22:56:27 -0000 1.1 --- rocketlauncher.h 17 Nov 2004 23:12:56 -0000 1.2 *************** *** 3,6 **** --- 3,7 ---- #include "weapon.h" + #include "rocket.h" class RocketLauncher : public Weapon Index: projectile.h =================================================================== RCS file: /cvsroot/epfl/tggame/projectile.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** projectile.h 17 Nov 2004 22:56:27 -0000 1.1 --- projectile.h 17 Nov 2004 23:12:56 -0000 1.2 *************** *** 2,6 **** #define _TGPROJECTILE_H ! #include "game.h" #include "actor.h" #include <md5instance.h> --- 2,6 ---- #define _TGPROJECTILE_H ! #include "pawn.h" #include "actor.h" #include <md5instance.h> *************** *** 9,13 **** using namespace tg; ! class Projectile : public Actor { public: --- 9,13 ---- using namespace tg; ! class Projectile : public Pawn { public: *************** *** 16,21 **** protected: - MD5Instance* pModel; - PhysicNode* pPhysic; }; --- 16,19 ---- |
Update of /cvsroot/epfl/tgengine-0.1 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21278 Modified Files: AUTHORS Changelog Doxyfile LICENSE Makefile Makefile.Linux Makefile.OSX README TODO base.cc base.h boundingbox.cc boundingbox.h camera.cc camera.h command.cc command.h console.cc console.h cvarmanager.cc cvarmanager.h decal.h decalmanager.cc decalmanager.h defs.h diskshape.cc diskshape.h dlinkednode.h edge.h emittershape.h engine.cc engine.h errbuffer.cc errbuffer.h event.h face.h font.h frustum.cc frustum.h function.cc function.h gldefs.cc gldefs.h glrenderer.cc glrenderer.h glrenderernv15.cc glrenderernv15.h guibutton.cc guibutton.h guicontainer.cc guicontainer.h guielement.h guimanager.cc guimanager.h guitext.h image2d.h logbuffer.cc logbuffer.h material.h matrice3.h md5instance.cc md5instance.h md5mesh10.cc md5mesh10.h mesh.cc mesh.h meshmanager.cc meshmanager.h particle.h particleemitter.cc particleemitter.h physiccallback.h physicengine.cc physicengine.h physicnode.cc physicnode.h plane.cc plane.h pointlight.h q3bsp.cc q3bsp.h quad.h quaternion.cc quaternion.h registry.cc registry.h renderer.cc renderer.h scenemanager.cc scenemanager.h scenenode.cc scenenode.h soundmanager.cc soundmanager.h texture.cc texture.h texturemanager.cc texturemanager.h tgendian.h tgglext.cc tgglext.h timer.cc timer.h util.cc util.h vbo.cc vbo.h vector3.cc vector3.h vertice.h video.cc video.h vshader.cc vshader.h Log Message: force commit :) |
|
From: julien r. <jul...@us...> - 2004-11-17 22:56:41
|
Update of /cvsroot/epfl/tggame In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17590 Modified Files: aicontroller.cc aicontroller.h config.cfg controller.cc controller.h game.cc game.h pawn.cc pawn.h playercontroller.cc playercontroller.h weapon.cc weapon.h Added Files: projectile.cc projectile.h rocket.cc rocket.h rocketlauncher.cc rocketlauncher.h Log Message: cf changelog tgengine Index: config.cfg =================================================================== RCS file: /cvsroot/epfl/tggame/config.cfg,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** config.cfg 12 Nov 2004 12:13:17 -0000 1.9 --- config.cfg 17 Nov 2004 22:56:27 -0000 1.10 *************** *** 5,7 **** -set lightpos.y 0 -set bump 0 ! -set gravity 1000 --- 5,7 ---- -set lightpos.y 0 -set bump 0 ! -set gravity 700 --- NEW FILE: projectile.cc --- #include "projectile.h" Projectile::Projectile() : Actor () { } Projectile::~ Projectile() { } Index: game.cc =================================================================== RCS file: /cvsroot/epfl/tggame/game.cc,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** game.cc 15 Nov 2004 21:41:52 -0000 1.32 --- game.cc 17 Nov 2004 22:56:27 -0000 1.33 *************** *** 89,92 **** --- 89,98 ---- } + void Game::RemovePawn (Pawn* p) + { + p->Remove(pSceneManager); + p->Remove(pPhysicEngine); + } + void Game::_CreatePlayers () { *************** *** 159,163 **** CollisionResult Game::Trace(const Vector3& vBegin, const Vector3& vEnd, Pawn* edict) { ! return pPhysicEngine->Trace(vBegin, vEnd, edict->GetPhysic()); } --- 165,169 ---- CollisionResult Game::Trace(const Vector3& vBegin, const Vector3& vEnd, Pawn* edict) { ! return pPhysicEngine->Trace(vBegin, vEnd, Vector3(0,0,0), Vector3(0,0,0), edict->GetPhysic()); } --- NEW FILE: rocketlauncher.cc --- #include "rocketlauncher.h" #include "game.h" RocketLauncher::RocketLauncher() : Weapon () { fFireRate = 0.1f; fCoolDown = fFireRate; } RocketLauncher::~RocketLauncher () { } void RocketLauncher::Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p) { if (fCoolDown > 0.0f) return; fCoolDown = fFireRate; Vector3 target = vPosition - vTarget*10000; CollisionResult cR = Game::pSelf->Trace(vPosition, target, p); if (cR.pNode == NULL) //on a touche la map Game::pSelf->GetSceneManager()->GetDecalManager()->AddDecal(cR.EndPoint, cR.Normal, 1.0f, 1.0f, Engine::pTextureManager->LoadTexture("data/textures/decals/mgun.bmp", TG_TEXTURE_2D), 10.0f); if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) //on a touche un objet cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal); SoundManager::pSoundManager->PlaySound("gun"); } --- NEW FILE: rocket.h --- #ifndef _TGROCKET_H #define _TGROCKET_H #include "projectile.h" class Rocket : public Projectile { public: Rocket (); protected: }; #endif Index: game.h =================================================================== RCS file: /cvsroot/epfl/tggame/game.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** game.h 13 Nov 2004 23:38:08 -0000 1.11 --- game.h 17 Nov 2004 22:56:27 -0000 1.12 *************** *** 32,35 **** --- 32,37 ---- void AddPawn (Pawn*, bool, bool); + void RemovePawn (Pawn*); + /** * StaticEventHandler : appelera le 'vrai' event handler, utilisé pour ne pas s'embeter avec des pointeurs d'instance Index: controller.h =================================================================== RCS file: /cvsroot/epfl/tggame/controller.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** controller.h 12 Nov 2004 12:13:17 -0000 1.9 --- controller.h 17 Nov 2004 22:56:27 -0000 1.10 *************** *** 23,27 **** virtual void MovePawn(); ! virtual void Collide(SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) = 0; inline Pawn* GetPawn () { return pPawn; } --- 23,27 ---- virtual void MovePawn(); ! virtual void Collide(PhysicNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) = 0; inline Pawn* GetPawn () { return pPawn; } *************** *** 32,35 **** --- 32,38 ---- bool bDir[4]; + int iLife; + bool bAlive; + Vector3 vViewOffset; Vector3 vLastVel; --- NEW FILE: projectile.h --- #ifndef _TGPROJECTILE_H #define _TGPROJECTILE_H #include "game.h" #include "actor.h" #include <md5instance.h> #include <physicnode.h> using namespace tg; class Projectile : public Actor { public: Projectile (); virtual ~Projectile (); protected: MD5Instance* pModel; PhysicNode* pPhysic; }; #endif Index: controller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/controller.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** controller.cc 12 Nov 2004 12:13:17 -0000 1.10 --- controller.cc 17 Nov 2004 22:56:27 -0000 1.11 *************** *** 5,8 **** --- 5,10 ---- { pPawn = p; + iLife = 100; + bAlive = true; p->GetPhysic()->SetPhysicCallBack(this); vViewOffset.Null(); --- NEW FILE: rocket.cc --- #include "rocket.h" Rocket::Rocket () : Projectile () { pModel = Engine::pMeshManager->LoadInstance("rocket"); pPhysic = new PhysicNode(pModel); pModel->GetBBox()->vMin.Set(-5,-5,-5); pModel->GetBBox()->vMax.Set(5,5,5); } --- NEW FILE: rocketlauncher.h --- #ifndef _TGROCKETLAUNCHER_H #define _TGROCKETLAUNCHER_H #include "weapon.h" class RocketLauncher : public Weapon { public: RocketLauncher (); ~RocketLauncher (); void Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p); protected: }; #endif Index: pawn.cc =================================================================== RCS file: /cvsroot/epfl/tggame/pawn.cc,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pawn.cc 12 Nov 2004 12:13:17 -0000 1.11 --- pawn.cc 17 Nov 2004 22:56:27 -0000 1.12 *************** *** 8,14 **** pModel->SetAnimation("stand"); pPhysic = new PhysicNode(pModel); ! pModel->GetBBox()->vMin.Set(-10,0,-10); ! pModel->GetBBox()->vMax.Set(10,80,10); //pPhysic->SetClip(false); fMoveSpeed = 0.0f; } --- 8,21 ---- pModel->SetAnimation("stand"); pPhysic = new PhysicNode(pModel); ! pModel->GetBBox()->vMin.Set(-15,0,-15); ! pModel->GetBBox()->vMax.Set(15,80,15); //pPhysic->SetClip(false); fMoveSpeed = 0.0f; } + + Pawn::~Pawn () + { + delete pModel; + delete pPhysic; + } + Index: pawn.h =================================================================== RCS file: /cvsroot/epfl/tggame/pawn.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pawn.h 12 Nov 2004 12:13:17 -0000 1.11 --- pawn.h 17 Nov 2004 22:56:27 -0000 1.12 *************** *** 24,27 **** --- 24,28 ---- */ Pawn (); + virtual ~Pawn (); /** * Think : méthode appelée à toute les frames (avant le rendu) *************** *** 53,56 **** --- 54,60 ---- void Add(SceneManager* s) {s->AddWorldObject(pModel); } + void Remove(PhysicEngine* p) {p->RemoveNode(pPhysic); } + void Remove(SceneManager* s) {s->RemoveWorldObject(pModel); } + inline void SetClip(bool b) { pPhysic->SetClip(b); } inline bool GetClip () { return pPhysic->Clip(); } *************** *** 59,62 **** --- 63,68 ---- inline PhysicNode* GetPhysic() { return pPhysic; } + + inline void SetBB (Vector3 vMin, Vector3 vMax) { pModel->GetBBox()->vMin = vMin; pModel->GetBBox()->vMax = vMax; } //Model* GetModel () { return pModel; } Index: playercontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** playercontroller.h 15 Nov 2004 21:41:52 -0000 1.9 --- playercontroller.h 17 Nov 2004 22:56:27 -0000 1.10 *************** *** 5,9 **** #include "controller.h" ! #include "weapon.h" using namespace tg; --- 5,9 ---- #include "controller.h" ! #include "rocketlauncher.h" using namespace tg; *************** *** 20,23 **** --- 20,24 ---- static int STRAFERIGHT; + RocketLauncher* pRocketLauncher; Weapon* pWeapon; bool bFire; *************** *** 27,31 **** void Think (float); void EventHandler (tgEvent& e); ! void Collide(SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal); void Exec (const std::string& s, int arg) { --- 28,32 ---- void Think (float); void EventHandler (tgEvent& e); ! void Collide(PhysicNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal); void Exec (const std::string& s, int arg) { Index: playercontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/playercontroller.cc,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** playercontroller.cc 15 Nov 2004 21:41:52 -0000 1.18 --- playercontroller.cc 17 Nov 2004 22:56:27 -0000 1.19 *************** *** 15,19 **** pSphere = new DebugSphere (); Game::pSelf->GetSceneManager()->AddDebugSphere(pSphere); ! pWeapon = new Weapon (); bFire = false; } --- 15,20 ---- pSphere = new DebugSphere (); Game::pSelf->GetSceneManager()->AddDebugSphere(pSphere); ! pRocketLauncher = new RocketLauncher(); ! pWeapon = pRocketLauncher; bFire = false; } *************** *** 23,33 **** pWeapon->Think(eTime); //Test des tirs if (bFire) { ! Vector3 vTarget = pPawn->GetRotation().GetZAxis(); ! Vector3 vPosition = pPawn->GetPosition()+vViewOffset; pWeapon->Fire (vPosition, vTarget, pPawn); ! ! vTarget = vPosition - vTarget*1000000; CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn); --- 24,37 ---- pWeapon->Think(eTime); //Test des tirs + Vector3 vTarget; + Vector3 vPosition; if (bFire) { ! vTarget = pPawn->GetRotation().GetZAxis(); ! vPosition = pPawn->GetPosition()+vViewOffset; pWeapon->Fire (vPosition, vTarget, pPawn); ! } ! vPosition = pPawn->GetPosition()+vViewOffset; ! vTarget = vPosition - pPawn->GetRotation().GetZAxis()*1000000; CollisionResult cR = Game::pSelf->Trace(vPosition, vTarget, pPawn); *************** *** 39,44 **** if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal);*/ ! } ! //Mouvement de la souris { --- 43,47 ---- if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal);*/ ! //Mouvement de la souris { *************** *** 77,81 **** } ! void PlayerController::Collide (SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) { //std::cerr << "playercontroller" << std::endl; --- 80,84 ---- } ! void PlayerController::Collide (PhysicNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) { //std::cerr << "playercontroller" << std::endl; Index: aicontroller.h =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** aicontroller.h 12 Nov 2004 12:13:17 -0000 1.6 --- aicontroller.h 17 Nov 2004 22:56:27 -0000 1.7 *************** *** 18,22 **** void Think (float); ! void Collide (SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal); void Initialize (); }; --- 18,22 ---- void Think (float); ! void Collide (PhysicNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal); void Initialize (); }; Index: weapon.cc =================================================================== RCS file: /cvsroot/epfl/tggame/weapon.cc,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** weapon.cc 14 Nov 2004 13:34:44 -0000 1.3 --- weapon.cc 17 Nov 2004 22:56:27 -0000 1.4 *************** *** 11,17 **** pModel->SetPosition(Vector3(5,0,-5)); Game::pSelf->GetSceneManager()->AddWorldObject(pModel); - - fFireRate = 0.1f; - fCoolDown = fFireRate; } --- 11,14 ---- *************** *** 30,50 **** } - void Weapon::Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p) - { - if (fCoolDown > 0.0f) - return; - - fCoolDown = fFireRate; - - Vector3 target = vPosition - vTarget*10000; - - CollisionResult cR = Game::pSelf->Trace(vPosition, target, p); - if (cR.pNode == NULL) //on a touche la map - Game::pSelf->GetSceneManager()->GetDecalManager()->AddDecal(cR.EndPoint, cR.Normal, 1.0f, 1.0f, Engine::pTextureManager->LoadTexture("data/textures/decals/mgun.bmp", TG_TEXTURE_2D), 10.0f); - if (cR.pNode != NULL && cR.pNode->GetPhysicCallBack() != NULL) //on a touche un objet - cR.pNode->GetPhysicCallBack()->Collide(NULL, cR.EndPoint, cR.Normal); - - SoundManager::pSoundManager->PlaySound("gun"); - } void Weapon::Animation(string name) --- 27,30 ---- Index: weapon.h =================================================================== RCS file: /cvsroot/epfl/tggame/weapon.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** weapon.h 14 Nov 2004 13:34:44 -0000 1.2 --- weapon.h 17 Nov 2004 22:56:27 -0000 1.3 *************** *** 12,20 **** { public: ! Weapon (); ! ~Weapon (); ! void Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p); ! void Think (float eTime); void Animation(std::string name); --- 12,20 ---- { public: ! Weapon (); ! virtual ~Weapon (); ! virtual void Fire (const Vector3& vPosition, const Vector3& vTarget, Pawn* p) = 0; ! void Think (float eTime); void Animation(std::string name); Index: aicontroller.cc =================================================================== RCS file: /cvsroot/epfl/tggame/aicontroller.cc,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** aicontroller.cc 12 Nov 2004 12:13:17 -0000 1.10 --- aicontroller.cc 17 Nov 2004 22:56:27 -0000 1.11 *************** *** 64,70 **** } ! void AIController::Collide (SceneNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) { ! pPawn->SetAnimation("death"); } --- 64,80 ---- } ! void AIController::Collide (PhysicNode* other, const Vector3& vPoint, const Vector3& vCollisionNormal) { ! iLife -= 5; ! if (!bAlive) ! { ! Game::pSelf->RemovePawn(pPawn); ! } ! if (iLife <= 0 && bAlive) ! { ! pPawn->SetAnimation("death"); ! pPawn->SetBB (Vector3(-15,0,-10), Vector3(60, 30, 15)); ! bAlive = false; ! } } |