From f7d892cf4ef6bfce3747c4b6a810d4828b79833d Mon Sep 17 00:00:00 2001 From: Krzysztof H Date: Mon, 19 Mar 2012 12:44:39 +0100 Subject: Last coding fix ;) --- src/physics.cpp | 272 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 136 insertions(+), 136 deletions(-) (limited to 'src/physics.cpp') diff --git a/src/physics.cpp b/src/physics.cpp index 031c20f..d4f8a98 100644 --- a/src/physics.cpp +++ b/src/physics.cpp @@ -1,4 +1,4 @@ -// * This file is part of the COLOBOT source code +// * This file is part of the COLOBOT source code // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch // * // * This program is free software: you can redistribute it and/or modify @@ -12,7 +12,7 @@ // * GNU General Public License for more details. // * // * You should have received a copy of the GNU General Public License -// * along with this program. If not, see http://www.gnu.org/licenses/. +// * along with this program. If not, see http://www.gnu.org/licenses/.// physics.cpp #define STRICT #define D3D_OVERLOADS @@ -73,7 +73,7 @@ CPhysics::CPhysics(CInstanceManager* iMan, CObject* object) m_motion = 0; m_type = TYPE_ROLLING; - m_gravity = 9.81f; // gravit� terrestre par d�faut + m_gravity = 9.81f; // gravité terrestre par défaut m_time = 0.0f; m_timeUnderWater = 0.0f; m_motorSpeed = D3DVECTOR(0.0f, 0.0f, 0.0f); @@ -125,7 +125,7 @@ CPhysics::~CPhysics() } -// D�truit l'objet. +// Détruit l'objet. void CPhysics::DeleteObject(BOOL bAll) { @@ -169,7 +169,7 @@ PhysicsType CPhysics::RetType() -// Sauve tous les param�tres de l'objet. +// Sauve tous les paramètres de l'objet. BOOL CPhysics::Write(char *line) { @@ -190,7 +190,7 @@ BOOL CPhysics::Write(char *line) return TRUE; } -// Restitue tous les param�tres de l'objet. +// Restitue tous les paramètres de l'objet. BOOL CPhysics::Read(char *line) { @@ -207,7 +207,7 @@ BOOL CPhysics::Read(char *line) -// Gestion de la force de gravit�. +// Gestion de la force de gravité. void CPhysics::SetGravity(float value) { @@ -228,7 +228,7 @@ float CPhysics::RetFloorHeight() } -// Gestion de l'�tat du moteur. +// Gestion de l'état du moteur. void CPhysics::SetMotor(BOOL bState) { @@ -250,12 +250,12 @@ BOOL CPhysics::RetMotor() } -// Gestion de l'�tat en vol/au sol. +// Gestion de l'état en vol/au sol. void CPhysics::SetLand(BOOL bState) { m_bLand = bState; - SetMotor(!bState); // allume le r�acteur si on part en vol + SetMotor(!bState); // allume le réacteur si on part en vol } BOOL CPhysics::RetLand() @@ -264,7 +264,7 @@ BOOL CPhysics::RetLand() } -// Gestion de l'�tat dans l'air/l'eau. +// Gestion de l'état dans l'air/l'eau. void CPhysics::SetSwim(BOOL bState) { @@ -294,7 +294,7 @@ BOOL CPhysics::RetCollision() } -// Indique si l'influence du sol est activ�e ou non. +// Indique si l'influence du sol est activée ou non. void CPhysics::SetFreeze(BOOL bFreeze) { @@ -307,7 +307,7 @@ BOOL CPhysics::RetFreeze() } -// Retourne le niveau d'automie du r�acteur. +// Retourne le niveau d'automie du réacteur. void CPhysics::SetReactorRange(float range) { @@ -320,7 +320,7 @@ float CPhysics::RetReactorRange() } -// Sp�cifie la vitesse du moteur. +// Spécifie la vitesse du moteur. // x = avancer/reculer // y = monter/descendre // z = tourner @@ -330,7 +330,7 @@ void CPhysics::SetMotorSpeed(D3DVECTOR speed) m_motorSpeed = speed; } -// Sp�cifie la vitesse du moteur pour avancer/reculer. +// Spécifie la vitesse du moteur pour avancer/reculer. // +1 = avancer // -1 = reculer @@ -339,7 +339,7 @@ void CPhysics::SetMotorSpeedX(float speed) m_motorSpeed.x = speed; } -// Sp�cifie la vitesse du moteur pour monter/descendre. +// Spécifie la vitesse du moteur pour monter/descendre. // +1 = monter // -1 = descendre @@ -348,9 +348,9 @@ void CPhysics::SetMotorSpeedY(float speed) m_motorSpeed.y = speed; } -// Sp�cifie la vitesse du moteur pour tourner. -// +1 = tourner � droite (CW) -// -1 = tourner � gauche (CCW) +// Spécifie la vitesse du moteur pour tourner. +// +1 = tourner à droite (CW) +// -1 = tourner à gauche (CCW) void CPhysics::SetMotorSpeedZ(float speed) { @@ -378,8 +378,8 @@ float CPhysics::RetMotorSpeedZ() } -// Gestion des vitesses lin�aires et angulaires. -// Sp�cifie la vitesse parall�le au sens de marche. +// Gestion des vitesses linéaires et angulaires. +// Spécifie la vitesse parallèle au sens de marche. void CPhysics::SetLinMotion(PhysicsMode mode, D3DVECTOR value) { @@ -447,7 +447,7 @@ float CPhysics::RetLinMotionX(PhysicsMode mode) return 0.0f; } -// Sp�cifie la vitesse d'�l�vation. +// Spécifie la vitesse d'élévation. void CPhysics::SetLinMotionY(PhysicsMode mode, float value) { @@ -482,7 +482,7 @@ float CPhysics::RetLinMotionY(PhysicsMode mode) return 0.0f; } -// Sp�cifie la vitesse perpendiculaire au sens de marche. +// Spécifie la vitesse perpendiculaire au sens de marche. void CPhysics::SetLinMotionZ(PhysicsMode mode, float value) { @@ -517,7 +517,7 @@ float CPhysics::RetLinMotionZ(PhysicsMode mode) return 0.0f; } -// Sp�cifie la rotation autour de l'axe de marche. +// Spécifie la rotation autour de l'axe de marche. void CPhysics::SetCirMotion(PhysicsMode mode, D3DVECTOR value) { @@ -585,7 +585,7 @@ float CPhysics::RetCirMotionX(PhysicsMode mode) return 0.0f; } -// Sp�cifie la rotation de direction. +// Spécifie la rotation de direction. void CPhysics::SetCirMotionY(PhysicsMode mode, float value) { @@ -620,7 +620,7 @@ float CPhysics::RetCirMotionY(PhysicsMode mode) return 0.0f; } -// Sp�cifie la rotation de mont�e/descente. +// Spécifie la rotation de montée/descente. void CPhysics::SetCirMotionZ(PhysicsMode mode, float value) { @@ -656,7 +656,7 @@ float CPhysics::RetCirMotionZ(PhysicsMode mode) } -// Retourne la distance lin�aire de freinage. +// Retourne la distance linéaire de freinage. // // v*v // d = ----- @@ -686,7 +686,7 @@ float CPhysics::RetCirStopLength() m_cirMotion.stopAccel.y / 2.0f; } -// Retourne la longueur avanc�e en une seconde, au sol, � vitesse maximale. +// Retourne la longueur avancée en une seconde, au sol, à vitesse maximale. float CPhysics::RetLinMaxLength(float dir) { @@ -703,7 +703,7 @@ float CPhysics::RetLinMaxLength(float dir) return dist; } -// Retourne le temps n�cessaire pour parcourir une certaine distance. +// Retourne le temps nécessaire pour parcourir une certaine distance. float CPhysics::RetLinTimeLength(float dist, float dir) { @@ -725,8 +725,8 @@ float CPhysics::RetLinTimeLength(float dist, float dir) return (dist+accel+decel)/dps; } -// Retourne la longueur � avancer pour parcourir une certaine -// distance, en tenant compte des acc�l�rations/d�c�l�rations. +// Retourne la longueur à avancer pour parcourir une certaine +// distance, en tenant compte des accélérations/décélérations. float CPhysics::RetLinLength(float dist) { @@ -762,8 +762,8 @@ float CPhysics::RetLinLength(float dist) } -// Gestion d'un �v�nement. -// Retourne FALSE si l'objet est d�truit. +// Gestion d'un événement. +// Retourne FALSE si l'objet est détruit. BOOL CPhysics::EventProcess(const Event &event) { @@ -782,7 +782,7 @@ BOOL CPhysics::EventProcess(const Event &event) } -// Met � jour les consignes de vitesse du moteur. +// Met à jour les consignes de vitesse du moteur. void CPhysics::MotorUpdate(float aTime, float rTime) { @@ -841,7 +841,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) } else { - power = m_object->RetPower(); // cherche l'objet pile utilis� + power = m_object->RetPower(); // cherche l'objet pile utilisé if ( power == 0 || power->RetEnergy() == 0.0f ) // pas de pile ou plate ? { motorSpeed.x = 0.0f; @@ -862,7 +862,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) { motorSpeed.x = 0.0f; motorSpeed.z = 0.0f; - if ( m_motion->RetAction() == MHS_DEADw ) // mort noy� ? + if ( m_motion->RetAction() == MHS_DEADw ) // mort noyé ? { motorSpeed.y = 0.0f; // c'est MHS_DEADw qui remonte } @@ -883,12 +883,12 @@ void CPhysics::MotorUpdate(float aTime, float rTime) factor = 1.0f-(pos.y-(h-40.0f))/40.0f; if ( factor < -1.0f ) factor = -1.0f; if ( factor > 1.0f ) factor = 1.0f; - motorSpeed.y *= factor; // limite la vitesse de mont�e + motorSpeed.y *= factor; // limite la vitesse de montée } } if ( type != OBJECT_BEE && - m_object->RetRange() > 0.0f ) // autonomie de vol limit�e ? + m_object->RetRange() > 0.0f ) // autonomie de vol limitée ? { if ( m_bLand || m_bSwim || m_bObstacle ) // au sol ou dans l'eau ? { @@ -914,7 +914,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) if ( m_reactorRange < 0.5f ) m_bLowLevel = TRUE; } - if ( m_reactorRange == 0.0f ) // r�acteur tilt� ? + if ( m_reactorRange == 0.0f ) // réacteur tilté ? { motorSpeed.y = -1.0f; // tombe ... } @@ -956,7 +956,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) m_linMotion.motorSpeed.y = 0.0f; } - // Tourner � gauche/droite. + // Tourner à gauche/droite. speed = motorSpeed.z; //? if ( motorSpeed.x < 0.0f ) speed = -speed; // inverse tourne si recule @@ -995,7 +995,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) h += m_object->RetCharacter()->height; if ( motorSpeed.y > 0.0f && m_reactorRange > 0.1f && pos.y < h ) { - m_bLand = FALSE; // d�colle + m_bLand = FALSE; // décolle SetMotor(TRUE); pos.y += 0.05f; // petite hauteur initiale (startup) m_object->SetPosition(0, pos); @@ -1015,7 +1015,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) } } - if ( power != 0 ) // pile transport�e ? + if ( power != 0 ) // pile transportée ? { factor = 1.0f; if ( type == OBJECT_MOBILEia || @@ -1039,7 +1039,7 @@ void CPhysics::MotorUpdate(float aTime, float rTime) } -// Met � jour les effets de vibration et d'inclinaison. +// Met à jour les effets de vibration et d'inclinaison. void CPhysics::EffectUpdate(float aTime, float rTime) { @@ -1341,29 +1341,29 @@ void CPhysics::EffectUpdate(float aTime, float rTime) } -// Met � jour une structure Motion. +// Met à jour une structure Motion. void CPhysics::UpdateMotionStruct(float rTime, Motion &motion) { float speed, motor; - // Gestion de la coordonn�e x. + // Gestion de la coordonnée x. speed = motion.currentSpeed.x; motor = motion.motorSpeed.x * m_inclinaisonFactor; if ( speed < motor ) { - speed += rTime*motion.motorAccel.x; // acc�l�re + speed += rTime*motion.motorAccel.x; // accélère if ( speed > motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } if ( speed > motor ) { - speed -= rTime*motion.motorAccel.x; // d�cc�l�re + speed -= rTime*motion.motorAccel.x; // déccélère if ( speed < motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } motion.currentSpeed.x = speed; @@ -1382,23 +1382,23 @@ void CPhysics::UpdateMotionStruct(float rTime, Motion &motion) motion.realSpeed.x += speed; } - // Gestion de la coordonn�e y. + // Gestion de la coordonnée y. speed = motion.currentSpeed.y; - motor = motion.motorSpeed.y; // vitesse non limit�e ! + motor = motion.motorSpeed.y; // vitesse non limitée ! if ( speed < motor ) { - speed += rTime*motion.motorAccel.y; // acc�l�re + speed += rTime*motion.motorAccel.y; // accélère if ( speed > motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } if ( speed > motor ) { - speed -= rTime*motion.motorAccel.y; // d�cc�l�re + speed -= rTime*motion.motorAccel.y; // déccélère if ( speed < motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } motion.currentSpeed.y = speed; @@ -1417,23 +1417,23 @@ void CPhysics::UpdateMotionStruct(float rTime, Motion &motion) motion.realSpeed.y += speed; } - // Gestion de la coordonn�e z. + // Gestion de la coordonnée z. speed = motion.currentSpeed.z; motor = motion.motorSpeed.z * m_inclinaisonFactor; if ( speed < motor ) { - speed += rTime*motion.motorAccel.z; // acc�l�re + speed += rTime*motion.motorAccel.z; // accélère if ( speed > motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } if ( speed > motor ) { - speed -= rTime*motion.motorAccel.z; // d�cc�l�re + speed -= rTime*motion.motorAccel.z; // déccélère if ( speed < motor ) { - speed = motor; // ne d�passe pas la vitesse + speed = motor; // ne dépasse pas la vitesse } } motion.currentSpeed.z = speed; @@ -1454,14 +1454,14 @@ void CPhysics::UpdateMotionStruct(float rTime, Motion &motion) } -// Fait �voluer la physique selon le temps �coul�. -// Retourne FALSE si l'objet est d�truit. +// Fait évoluer la physique selon le temps écoulé. +// Retourne FALSE si l'objet est détruit. // -// a: acc�l�ration +// a: accélération // v1: vitesse au temps t1 // v2: vitesse au temps t2 -// dt: temps �coul� depuis t1, donc: dt=t2-t1 -// dd: diff�rence de distance (avance) +// dt: temps écoulé depuis t1, donc: dt=t2-t1 +// dd: différence de distance (avance) // // v2 = v1 + a*dt // dd = v2*dt @@ -1490,7 +1490,7 @@ BOOL CPhysics::EventFrame(const Event &event) iPos = pos = m_object->RetPosition(0); iAngle = angle = m_object->RetAngle(0); - // Acc�l�re � la descente, freine � la mont�e. + // Accélère à la descente, freine à la montée. if ( m_bFreeze || m_object->RetDead() ) { m_linMotion.terrainSpeed.x = 0.0f; @@ -1524,7 +1524,7 @@ BOOL CPhysics::EventFrame(const Event &event) m_linMotion.terrainSpeed.z = tanf(tAngle.x)*0.9f*m_linMotion.terrainForce.z*h; m_linMotion.terrainSpeed.y = 0.0f; - // Si le terrain est tr�s pentu, n'exag�re pas ! + // Si le terrain est très pentu, n'exagère pas ! if ( m_linMotion.terrainSpeed.x > 50.0f ) m_linMotion.terrainSpeed.x = 20.0f; if ( m_linMotion.terrainSpeed.x < -50.0f ) m_linMotion.terrainSpeed.x = -20.0f; if ( m_linMotion.terrainSpeed.z > 50.0f ) m_linMotion.terrainSpeed.z = 20.0f; @@ -1541,7 +1541,7 @@ BOOL CPhysics::EventFrame(const Event &event) m_linMotion.terrainSpeed.y = -h*2.5f; // ne va pas plus haut } - // (*) Assez haut pour passer par-dessus la tour de d�fence + // (*) Assez haut pour passer par-dessus la tour de défence // (OBJECT_TOWER), mais pas trop pour passer sous la coiffe // du vaisseau (OBJECT_BASE) ! @@ -1580,7 +1580,7 @@ BOOL CPhysics::EventFrame(const Event &event) newpos.z != pos.z ) { i = ObjectAdapt(newpos, newangle); - if ( i == 2 ) // objet d�truit ? + if ( i == 2 ) // objet détruit ? { return FALSE; } @@ -1612,7 +1612,7 @@ BOOL CPhysics::EventFrame(const Event &event) return TRUE; } -// D�marre ou stoppe les bruits de moteur. +// Démarre ou stoppe les bruits de moteur. void CPhysics::SoundMotor(float rTime) { @@ -1714,13 +1714,13 @@ void CPhysics::SoundMotor(float rTime) } } } - else // v�hicule ? + else // véhicule ? { if ( m_type == TYPE_ROLLING ) { if ( m_bMotor && m_object->RetActif() ) { - SoundMotorFull(rTime, type); // plein r�gime + SoundMotorFull(rTime, type); // plein régime } else { @@ -1738,7 +1738,7 @@ void CPhysics::SoundMotor(float rTime) } else { - SoundMotorStop(rTime, type); // � l'arr�t + SoundMotorStop(rTime, type); // à l'arrêt } } } @@ -1748,11 +1748,11 @@ void CPhysics::SoundMotor(float rTime) if ( m_bMotor && !m_bSwim && m_object->RetActif() && !m_object->RetDead() ) { - SoundReactorFull(rTime, type); // plein r�gime + SoundReactorFull(rTime, type); // plein régime } else { - SoundReactorStop(rTime, type); // � l'arr�t + SoundReactorStop(rTime, type); // à l'arrêt } } } @@ -1769,7 +1769,7 @@ void CPhysics::WaterFrame(float aTime, float rTime) level = m_water->RetLevel(); if ( level == 0.0f ) return; // pas d'eau ? - if ( m_object->RetTruck() != 0 ) return; // objet transport� ? + if ( m_object->RetTruck() != 0 ) return; // objet transporté ? // Gestion des flammes dans la lave. pos = m_object->RetPosition(0); @@ -1841,13 +1841,13 @@ void CPhysics::WaterFrame(float aTime, float rTime) type == OBJECT_MOBILEwt || type == OBJECT_MOBILEit || type == OBJECT_MOBILEdr || - type == OBJECT_APOLLO2 ) // v�hicule non sous-marin ? + type == OBJECT_APOLLO2 ) // véhicule non sous-marin ? { - m_object->ExploObject(EXPLO_WATER, 1.0f); // d�marre explosion + m_object->ExploObject(EXPLO_WATER, 1.0f); // démarre explosion } } -// Fait entendre le moteur � plein r�gime. +// Fait entendre le moteur à plein régime. void CPhysics::SoundMotorFull(float rTime, ObjectType type) { @@ -2036,7 +2036,7 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type) { m_sound->Position(m_soundChannel, m_object->RetPosition(0)); - if ( !m_bSoundSlow ) // plein r�gime ? + if ( !m_bSoundSlow ) // plein régime ? { m_sound->FlushEnvelope(m_soundChannel); m_sound->AddEnvelope(m_soundChannel, amplitude, 0.5f, 0.3f, SOPER_CONTINUE); @@ -2086,7 +2086,7 @@ void CPhysics::SoundMotorSlow(float rTime, ObjectType type) } } -// Fait entendre le moteur � l'arr�t. +// Fait entendre le moteur à l'arrêt. void CPhysics::SoundMotorStop(float rTime, ObjectType type) { @@ -2114,7 +2114,7 @@ void CPhysics::SoundMotorStop(float rTime, ObjectType type) m_soundTimePshhh -= rTime*2.0f; } -// Fait entendre le r�acteur � plein r�gime. +// Fait entendre le réacteur à plein régime. void CPhysics::SoundReactorFull(float rTime, ObjectType type) { @@ -2225,7 +2225,7 @@ void CPhysics::SoundReactorFull(float rTime, ObjectType type) } -// Fait entendre le r�acteur � l'arr�t. +// Fait entendre le réacteur à l'arrêt. void CPhysics::SoundReactorStop(float rTime, ObjectType type) { @@ -2259,7 +2259,7 @@ void CPhysics::SoundReactorStop(float rTime, ObjectType type) else { if ( energy != 0.0f && - (m_motorSpeed.x != 0.0f || // glisse avec petits r�acteurs dans patins ? + (m_motorSpeed.x != 0.0f || // glisse avec petits réacteurs dans patins ? m_cirMotion.realSpeed.y != 0.0f) ) { if ( m_soundChannelSlide == -1 ) @@ -2313,7 +2313,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime, if ( m_type == TYPE_ROLLING ) { - pos.y -= h; // plaque imm�diatement au sol + pos.y -= h; // plaque immédiatement au sol pos.y += character->height; m_floorHeight = 0.0f; } @@ -2326,9 +2326,9 @@ void CPhysics::FloorAdapt(float aTime, float rTime, { m_terrain->GetNormal(norm, pos); a1 = Abs(RotateAngle(Length(norm.x, norm.z), norm.y)); - if ( a1 < (90.0f-55.0f)*PI/180.0f ) // pente d�passe 55 degr�s ? + if ( a1 < (90.0f-55.0f)*PI/180.0f ) // pente dépasse 55 degrés ? { - bSlopingTerrain = TRUE; // terrain tr�s pentu + bSlopingTerrain = TRUE; // terrain très pentu if ( h < 4.0f ) // choc avec le terrain ? { @@ -2364,7 +2364,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime, m_bLand = TRUE; // au sol SetMotor(FALSE); - pos.y -= h; // plaque imm�diatement au sol + pos.y -= h; // plaque immédiatement au sol m_floorHeight = 0.0f; if ( h < 0.0f ) @@ -2381,7 +2381,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime, type == OBJECT_TECH ) return; // toujours droit } - if ( h > 4.0f || bSlopingTerrain ) // tr�s au-dessus du sol ? + if ( h > 4.0f || bSlopingTerrain ) // très au-dessus du sol ? { if ( m_bSwim ) { @@ -2395,7 +2395,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime, } m_inclinaisonFactor = 1.0f; - // Remet gentiment � l'horizontale. + // Remet gentiment à l'horizontale. if ( angle.x > 0.0f ) { angle.x -= rTime*0.5f; @@ -2420,7 +2420,7 @@ void CPhysics::FloorAdapt(float aTime, float rTime, } } - if ( m_floorHeight == 0.0f ) // plaqu� au sol ? + if ( m_floorHeight == 0.0f ) // plaqué au sol ? { if ( m_object->RetTraceDown() ) { @@ -2493,8 +2493,8 @@ void CPhysics::FloorAngle(const D3DVECTOR &pos, D3DVECTOR &angle) // Adapte la physique de l'objet en fonction des autres objets. // Retourne 0 -> objet mobile -// Retourne 1 -> objet immobile (� cause collision) -// Retourne 2 -> objet d�truit +// Retourne 1 -> objet immobile (à cause collision) +// Retourne 2 -> objet détruit int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) { @@ -2508,11 +2508,11 @@ int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) int i, j, colType; ObjectType iType, oType; - if ( m_object->RetRuin() ) return 0; // br�le ou explose ? + if ( m_object->RetRuin() ) return 0; // brûle ou explose ? if ( !m_object->RetClip() ) return 0; - // iiPos = centre sph�re � l'ancienne position. - // iPos = centre sph�re � la nouvelle position. + // iiPos = centre sphère à l'ancienne position. + // iPos = centre sphère à la nouvelle position. m_object->GetCrashSphere(0, iiPos, iRad); iPos = iiPos + (pos - m_object->RetPosition(0)); iType = m_object->RetType(); @@ -2522,10 +2522,10 @@ int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) pObj = (CObject*)m_iMan->SearchInstance(CLASS_OBJECT, i); if ( pObj == 0 ) break; - if ( pObj == m_object ) continue; // soi-m�me ? - if ( pObj->RetTruck() != 0 ) continue; // objet transport� ? + if ( pObj == m_object ) continue; // soi-même ? + if ( pObj->RetTruck() != 0 ) continue; // objet transporté ? if ( !pObj->RetEnable() ) continue; // inactif ? - if ( pObj->RetRuin() ) continue; // br�le ou explose ? + if ( pObj->RetRuin() ) continue; // brûle ou explose ? if ( pObj->RetDead() ) continue; // homme mort ? oType = pObj->RetType(); @@ -2572,12 +2572,12 @@ int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) #if _TEEN if ( oType == OBJECT_WAYPOINT && pObj->RetEnable() && - !m_object->RetResetBusy() ) // v�hicule d'entra�nement ? + !m_object->RetResetBusy() ) // véhicule d'entraînement ? #else if ( oType == OBJECT_WAYPOINT && pObj->RetEnable() && !m_object->RetResetBusy() && - m_object->RetTrainer() ) // v�hicule d'entra�nement ? + m_object->RetTrainer() ) // véhicule d'entraînement ? #endif { oPos = pObj->RetPosition(0); @@ -2627,7 +2627,7 @@ int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) force *= pObj->RetCrashSphereHardness(j-1)*2.0f; if ( ExploOther(iType, pObj, oType, force) ) continue; colType = ExploHimself(iType, oType, force); - if ( colType == 2 ) return 2; // d�truit ? + if ( colType == 2 ) return 2; // détruit ? if ( colType == 0 ) continue; // passe outre ? } @@ -2689,11 +2689,11 @@ int CPhysics::ObjectAdapt(const D3DVECTOR &pos, const D3DVECTOR &angle) return 0; } -// (*) En cas de collision � la position initiale (iiPos) et � la -// nouvelle position (iPos), l'obstacle est ignor�. On peut -// donc passer � travers. Ceci est n�cessaire lorsqu'un obstacle -// se retrouve "dans" un v�hicule, pour ne pas le bloquer -// d�finitivement ! +// (*) En cas de collision à la position initiale (iiPos) et à la +// nouvelle position (iPos), l'obstacle est ignoré. On peut +// donc passer à travers. Ceci est nécessaire lorsqu'un obstacle +// se retrouve "dans" un véhicule, pour ne pas le bloquer +// définitivement ! // Bouscule un objet. @@ -2726,7 +2726,7 @@ BOOL CPhysics::JostleObject(CObject* pObj, D3DVECTOR iPos, float iRad, return pObj->JostleObject(force); } -// Bouscule forc�ment un objet. +// Bouscule forcément un objet. BOOL CPhysics::JostleObject(CObject* pObj, float force) { @@ -2745,7 +2745,7 @@ BOOL CPhysics::JostleObject(CObject* pObj, float force) return pObj->JostleObject(force); } -// Action de l'explosion sur l'objet tamponn�. +// Action de l'explosion sur l'objet tamponné. // Retourne TRUE s'il faut ignorer cet obstacle. BOOL CPhysics::ExploOther(ObjectType iType, @@ -2797,7 +2797,7 @@ BOOL CPhysics::ExploOther(ObjectType iType, oType == OBJECT_NUCLEAR || oType == OBJECT_PARA || oType == OBJECT_SAFE || - oType == OBJECT_HUSTON ) ) // b�timent ? + oType == OBJECT_HUSTON ) ) // bâtiment ? { pObj->ExploObject(EXPLO_BOUM, force/400.0f); } @@ -2829,7 +2829,7 @@ BOOL CPhysics::ExploOther(ObjectType iType, oType == OBJECT_MOBILEft || oType == OBJECT_MOBILEit || oType == OBJECT_MOBILEdr || - oType == OBJECT_APOLLO2 ) ) // v�hicule ? + oType == OBJECT_APOLLO2 ) ) // véhicule ? { pObj->ExploObject(EXPLO_BOUM, force/200.0f); } @@ -2852,10 +2852,10 @@ BOOL CPhysics::ExploOther(ObjectType iType, return FALSE; } -// Action de l'explosion sur l'objet lui-m�me. +// Action de l'explosion sur l'objet lui-même. // Retourne 0 -> objet mobile // Retourne 1 -> objet immobile -// Retourne 2 -> objet d�truit +// Retourne 2 -> objet détruit int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force) { @@ -2923,7 +2923,7 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force) iType == OBJECT_MOBILEft || iType == OBJECT_MOBILEit || iType == OBJECT_MOBILEdr || - iType == OBJECT_APOLLO2 ) ) // v�hicule ? + iType == OBJECT_APOLLO2 ) ) // véhicule ? { if ( oType == OBJECT_DERRICK || oType == OBJECT_FACTORY || @@ -2940,7 +2940,7 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force) oType == OBJECT_NUCLEAR || oType == OBJECT_PARA || oType == OBJECT_SAFE || - oType == OBJECT_HUSTON ) // b�timent ? + oType == OBJECT_HUSTON ) // bâtiment ? { force /= 200.0f; } @@ -2980,7 +2980,7 @@ int CPhysics::ExploHimself(ObjectType iType, ObjectType oType, float force) -// Fait �voluer les particules. +// Fait évoluer les particules. void CPhysics::FrameParticule(float aTime, float rTime) { @@ -3003,7 +3003,7 @@ void CPhysics::FrameParticule(float aTime, float rTime) energy = power->RetEnergy(); } - if ( energy != m_lastEnergy ) // changement du niveau d'�nergie ? + if ( energy != m_lastEnergy ) // changement du niveau d'énergie ? { if ( energy > m_lastEnergy ) // recharge ? { @@ -3042,7 +3042,7 @@ void CPhysics::FrameParticule(float aTime, float rTime) } } -// G�n�re qq particules suite � une recharge. +// Génère qq particules suite à une recharge. void CPhysics::PowerParticule(float factor, BOOL bBreak) { @@ -3084,7 +3084,7 @@ void CPhysics::PowerParticule(float factor, BOOL bBreak) if ( bCarryPower ) // porte une batterie ? { - pos = D3DVECTOR(3.0f, 5.6f, 0.0f); // position batterie port�e + pos = D3DVECTOR(3.0f, 5.6f, 0.0f); // position batterie portée pos = Transform(*mat, pos); speed.x = (Rand()-0.5f)*12.0f; @@ -3102,7 +3102,7 @@ void CPhysics::PowerParticule(float factor, BOOL bBreak) } } -// G�n�re qq particules suite � une chute. +// Génère qq particules suite à une chute. // crash: 0=super soft, 1=big crash void CPhysics::CrashParticule(float crash) @@ -3136,7 +3136,7 @@ void CPhysics::CrashParticule(float crash) } } -// G�n�re qq particules de gaz d'�chappement. +// Génère qq particules de gaz d'échappement. void CPhysics::MotorParticule(float aTime, float rTime) { @@ -3199,7 +3199,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) } else // hors de l'eau ? { - m_absorbWater -= rTime*(1.0f/3.0f); // se s�che + m_absorbWater -= rTime*(1.0f/3.0f); // se sèche if ( m_absorbWater < 0.0f ) m_absorbWater = 0.0f; } @@ -3238,7 +3238,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) h = Max(Abs(m_linMotion.terrainSpeed.x), Abs(m_linMotion.terrainSpeed.z)); if ( h > m_linMotion.terrainSlide.x+0.5f && - m_linMotion.motorSpeed.x == 0.0f ) // glisse � l'arr�t ? + m_linMotion.motorSpeed.x == 0.0f ) // glisse à l'arrêt ? { m_lastSlideParticule = aTime; @@ -3317,7 +3317,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) { if ( m_reactorTemperature > 0.0f ) { - m_reactorTemperature -= rTime*(1.0f/10.0f); // �a refroidi + m_reactorTemperature -= rTime*(1.0f/10.0f); // ça refroidi if ( m_reactorTemperature < 0.0f ) { m_reactorTemperature = 0.0f; @@ -3347,7 +3347,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) if ( m_reactorTemperature < 1.0f ) // pas trop chaud ? { - m_reactorTemperature += rTime*(1.0f/4.0f); // �a chauffe + m_reactorTemperature += rTime*(1.0f/4.0f); // ça chauffe if ( m_reactorTemperature > 1.0f ) { m_reactorTemperature = 1.0f; // mais pas trop @@ -3415,7 +3415,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) if ( (type == OBJECT_HUMAN || type == OBJECT_TECH) && m_bSwim ) { - m_reactorTemperature = 0.0f; // r�acteur froid + m_reactorTemperature = 0.0f; // réacteur froid } if ( m_type == TYPE_FLYING && @@ -3425,7 +3425,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) { if ( m_bLand ) // au sol ? { - if ( m_motorSpeed.x == 0.0f && // glisse � cause pente terrain ? + if ( m_motorSpeed.x == 0.0f && // glisse à cause pente terrain ? m_cirMotion.realSpeed.y == 0.0f ) { h = Max(Abs(m_linMotion.realSpeed.x), @@ -3450,7 +3450,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) dim.y = dim.x; m_particule->CreateParticule(pos, speed, dim, PARTICRASH, 2.0f); } - else // glisse avec petits r�acteurs dans patins ? + else // glisse avec petits réacteurs dans patins ? { if ( m_linMotion.realSpeed.x == 0.0f && m_cirMotion.realSpeed.y == 0.0f ) return; @@ -3593,7 +3593,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) if ( m_type == TYPE_ROLLING ) { - if ( type == OBJECT_APOLLO2 ) return; // moteurs �lectriques ! + if ( type == OBJECT_APOLLO2 ) return; // moteurs électriques ! if ( type == OBJECT_MOBILErt || type == OBJECT_MOBILErc || @@ -3657,7 +3657,7 @@ void CPhysics::MotorParticule(float aTime, float rTime) } } -// G�n�re qq particules suite � une chute dans l'eau. +// Génère qq particules suite à une chute dans l'eau. void CPhysics::WaterParticule(float aTime, D3DVECTOR pos, ObjectType type, float floor, float advance, float turn) @@ -3705,7 +3705,7 @@ void CPhysics::WaterParticule(float aTime, D3DVECTOR pos, ObjectType type, pos = m_object->RetPosition(0); pos.y = m_water->RetLevel()-1.0f; dim.x = 2.0f*force; // hauteur - dim.y = diam; // diam�tre + dim.y = diam; // diamètre m_particule->CreateParticule(pos, D3DVECTOR(0.0f, 0.0f, 0.0f), dim, PARTIPLOUF0, 1.4f, 0.0f, 0.0f); force = (0.5f+force*0.5f); @@ -3773,7 +3773,7 @@ void CPhysics::WaterParticule(float aTime, D3DVECTOR pos, ObjectType type, m_particule->CreateParticule(pos, speed, dim, PARTIFLIC, 3.0f, 0.0f, 0.0f); } -// Cr�e la trace sous le robot. +// Crée la trace sous le robot. void CPhysics::WheelParticule(int color, float width) { @@ -3791,7 +3791,7 @@ void CPhysics::WheelParticule(int color, float width) { parti = (ParticuleType)(PARTITRACE0+color); step = 2.0f; - if ( color >= 16 ) step = 4.0f; // fl�che ? + if ( color >= 16 ) step = 4.0f; // flèche ? step /= m_engine->RetTracePrecision(); goal1.x = step/2.0f; @@ -3838,7 +3838,7 @@ void CPhysics::WheelParticule(int color, float width) } -// Cr�e l'interface. +// Crée l'interface. void CPhysics::CreateInterface(BOOL bSelect) { @@ -3849,7 +3849,7 @@ void CPhysics::CreateInterface(BOOL bSelect) } -// Retourne une erreur li�e � l'�tat g�n�ral. +// Retourne une erreur liée à l'état général. Error CPhysics::RetError() { @@ -3872,7 +3872,7 @@ Error CPhysics::RetError() return ERR_VEH_VIRUS; } - power = m_object->RetPower(); // cherche l'objet pile utilis� + power = m_object->RetPower(); // cherche l'objet pile utilisé if ( power == 0 ) { return ERR_VEH_POWER; -- cgit v1.2.3-1-g7c22