diff options
author | Programerus <alcadeias95@gmail.com> | 2012-04-01 23:26:42 +0300 |
---|---|---|
committer | Programerus <alcadeias95@gmail.com> | 2012-04-01 23:26:42 +0300 |
commit | 6d9bff8ef949032989a6257eff1de23a6cccfcec (patch) | |
tree | 652b3af3faa1b4a7678b08b9d6adfdf09777f4be /src | |
parent | cdb0b4728b211dfdd77669050d9becdfce51bc19 (diff) | |
download | colobot-6d9bff8ef949032989a6257eff1de23a6cccfcec.tar.gz colobot-6d9bff8ef949032989a6257eff1de23a6cccfcec.tar.bz2 colobot-6d9bff8ef949032989a6257eff1de23a6cccfcec.zip |
Comments translated from French to English.
Diffstat (limited to 'src')
-rw-r--r-- | src/motionmother.cpp | 114 |
1 files changed, 58 insertions, 56 deletions
diff --git a/src/motionmother.cpp b/src/motionmother.cpp index 0173fa2..e32edcf 100644 --- a/src/motionmother.cpp +++ b/src/motionmother.cpp @@ -12,7 +12,9 @@ // * 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/.// motionmother.cpp
+// * along with this program. If not, see http://www.gnu.org/licenses/.
+
+// motionmother.cpp
#define STRICT
#define D3D_OVERLOADS
@@ -41,12 +43,12 @@ -#define ADJUST_ANGLE FALSE // TRUE -> ajuste les angles des membres
-#define START_TIME 1000.0f // début du temps relatif
+#define ADJUST_ANGLE FALSE // TRUE -> adjusts the angles of the members
+#define START_TIME 1000.0f // beginning of the relative time
-// Constructeur de l'objet.
+// Object's constructor.
CMotionMother::CMotionMother(CInstanceManager* iMan, CObject* object)
: CMotion(iMan, object)
@@ -65,21 +67,21 @@ CMotionMother::CMotionMother(CInstanceManager* iMan, CObject* object) m_bArmStop = FALSE;
}
-// Destructeur de l'objet.
+// Object's destructor.
CMotionMother::~CMotionMother()
{
}
-// Supprime un objet.
+// Removes an object.
void CMotionMother::DeleteObject(BOOL bAll)
{
}
-// Crée un véhicule roulant quelconque posé sur le sol.
+// Creates a vehicle traveling any lands on the ground.
BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type,
float power)
@@ -93,9 +95,9 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetType(type);
- // Crée la base principale.
+ // Creates main base.
rank = m_engine->CreateObject();
- m_engine->SetObjectType(rank, TYPEVEHICULE); // c'est un objet mobile
+ m_engine->SetObjectType(rank, TYPEVEHICULE); // this is a moving object
m_object->SetObjectRank(0, rank);
pModFile->ReadModel("objects\\mother1.mod");
@@ -104,12 +106,12 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetPosition(0, pos);
m_object->SetAngleY(0, angle);
- // Un véhicule doit avoir obligatoirement une sphère de
- // collision avec un centre (0;y;0) (voir GetCrashSphere).
+ // A vehicle must have a obligatory collision
+ //with a sphere of center (0, y, 0) (see GetCrashSphere).
m_object->CreateCrashSphere(D3DVECTOR(0.0f, 0.0f, 0.0f), 20.0f, SOUND_BOUM, 0.20f);
m_object->SetGlobalSphere(D3DVECTOR(-2.0f, 10.0f, 0.0f), 25.0f);
- // Crée la tête.
+ // Creates the head.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(1, rank);
@@ -118,7 +120,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(1, D3DVECTOR(16.0f, 3.0f, 0.0f));
- // Crée la jambe 1 arrière-droite.
+ // Creates a right-back leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(2, rank);
@@ -127,7 +129,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(2, D3DVECTOR(-5.0f, -1.0f, -12.0f));
- // Crée le pied 1 arrière-droite.
+ // Creates a right-back foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(3, rank);
@@ -136,7 +138,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(3, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée la jambe 2 milieu-droite.
+ // Creates a middle-right leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(4, rank);
@@ -145,7 +147,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(4, D3DVECTOR(3.5f, -1.0f, -12.0f));
- // Crée le pied 2 milieu-droite.
+ // Creates a middle-right foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(5, rank);
@@ -154,7 +156,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(5, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée la jambe 3 avant-droite.
+ // Creates a right-front leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(6, rank);
@@ -163,7 +165,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(6, D3DVECTOR(10.0f, -1.0f, -10.0f));
- // Crée le pied 3 avant-droite.
+ // Creates a right-front foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(7, rank);
@@ -172,7 +174,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(7, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée la jambe 1 arrière-gauche.
+ // Creates a left-back leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(8, rank);
@@ -182,7 +184,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetPosition(8, D3DVECTOR(-5.0f, -1.0f, 12.0f));
m_object->SetAngleY(8, PI);
- // Crée le pied 1 arrière-gauche.
+ // Creates a left-back foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(9, rank);
@@ -191,7 +193,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(9, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée la jambe 2 milieu-gauche.
+ // Creates a middle-left leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(10, rank);
@@ -201,7 +203,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetPosition(10, D3DVECTOR(3.5f, -1.0f, 12.0f));
m_object->SetAngleY(10, PI);
- // Crée le pied 2 milieu-gauche.
+ // Creates a middle-left foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(11, rank);
@@ -210,7 +212,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(11, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée la jambe 3 avant-gauche.
+ // Creates a left-front leg.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(12, rank);
@@ -220,7 +222,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetPosition(12, D3DVECTOR(10.0f, -1.0f, 10.0f));
m_object->SetAngleY(12, PI);
- // Crée le pied 3 avant-gauche.
+ // Creates a left-front foot.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(13, rank);
@@ -229,7 +231,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(13, D3DVECTOR(0.0f, 0.0f, -8.5f));
- // Crée l'antenne droite.
+ // Creates the right antenna.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(14, rank);
@@ -246,7 +248,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(15, D3DVECTOR(8.0f, 0.0f, 0.0f));
- // Crée l'antenne gauche.
+ // Creates the left antenna.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(16, rank);
@@ -263,7 +265,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, pModFile->CreateEngineObject(rank);
m_object->SetPosition(17, D3DVECTOR(8.0f, 0.0f, 0.0f));
- // Crée la pince droite.
+ // Creates the right claw.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(18, rank);
@@ -273,7 +275,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetPosition(18, D3DVECTOR(-4.0f, -3.5f, -8.0f));
m_object->SetZoomX(18, 1.2f);
- // Crée la pince gauche.
+ // Creates the left claw.
rank = m_engine->CreateObject();
m_engine->SetObjectType(rank, TYPEDESCENDANT);
m_object->SetObjectRank(19, rank);
@@ -290,7 +292,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, m_object->SetFloorHeight(0.0f);
pos = m_object->RetPosition(0);
- m_object->SetPosition(0, pos); // pour afficher les ombres tout de suite
+ m_object->SetPosition(0, pos); // to display the shadows immediately
m_engine->LoadAllTexture();
@@ -298,7 +300,7 @@ BOOL CMotionMother::Create(D3DVECTOR pos, float angle, ObjectType type, return TRUE;
}
-// Crée la physique de l'objet.
+// Creates the physics of the object.
void CMotionMother::CreatePhysics()
{
@@ -307,18 +309,18 @@ void CMotionMother::CreatePhysics() int member[] =
{
- // x1,y1,z1, x2,y2,z2, x3,y3,z3, // en l'air :
- 30,30,10, 35,-15,10, 35,-35,10, // t0: jambes 1..3
- -80,-45,-35, -115,-40,-35, -90,10,-55, // t0: pieds 1..3
- 0,0,0, 0,0,0, 0,0,0, // t0: inutilisé
- // au sol devant :
- 15,-5,10, 10,-30,10, 5,-50,10, // t1: jambes 1..3
- -90,-15,-15, -110,-55,-35, -75,-75,-30, // t1: pieds 1..3
- 0,0,0, 0,0,0, 0,0,0, // t1: inutilisé
- // au sol derrière :
- 0,40,10, 5,5,10, 0,-15,10, // t2: jambes 1..3
- -45,0,-55, -65,10,-50, -125,-85,-45, // t2: pieds 1..3
- 0,0,0, 0,0,0, 0,0,0, // t2: inutilisé
+ // x1,y1,z1, x2,y2,z2, x3,y3,z3, // in the air:
+ 30,30,10, 35,-15,10, 35,-35,10, // t0: legs 1..3
+ -80,-45,-35, -115,-40,-35, -90,10,-55, // t0: feet 1..3
+ 0,0,0, 0,0,0, 0,0,0, // t0: unused
+ // on the ground:
+ 15,-5,10, 10,-30,10, 5,-50,10, // t1: legs 1..3
+ -90,-15,-15, -110,-55,-35, -75,-75,-30, // t1: feet 1..3
+ 0,0,0, 0,0,0, 0,0,0, // t1: unused
+ // on the ground back:
+ 0,40,10, 5,5,10, 0,-15,10, // t2: legs 1..3
+ -45,0,-55, -65,10,-50, -125,-85,-45, // t2: feet 1..3
+ 0,0,0, 0,0,0, 0,0,0, // t2: unused
};
m_physics->SetType(TYPE_ROLLING);
@@ -354,7 +356,7 @@ void CMotionMother::CreatePhysics() }
-// Gestion d'un événement.
+// Management of an event.
BOOL CMotionMother::EventProcess(const Event &event)
{
@@ -398,7 +400,7 @@ BOOL CMotionMother::EventProcess(const Event &event) return TRUE;
}
-// Gestion d'un événement.
+// Management of an event.
BOOL CMotionMother::EventFrame(const Event &event)
{
@@ -419,17 +421,17 @@ BOOL CMotionMother::EventFrame(const Event &event) m_armTimeMarch += (s)*event.rTime*0.05f;
m_armMember += (s+a)*event.rTime*0.05f;
- bStop = ( a == 0.0f && s == 0.0f ); // a l'arrêt ?
+ bStop = ( a == 0.0f && s == 0.0f ); // stop?
if ( bStop )
{
prog = Mod(m_armTimeAbs, 2.0f)/10.0f;
a = Mod(m_armMember, 1.0f);
- a = (prog-a)*event.rTime*1.0f; // vient gentiment à position stop
+ a = (prog-a)*event.rTime*1.0f; // stop position just pleasantly
m_armMember += a;
}
- for ( i=0 ; i<6 ; i++ ) // les 6 pattes
+ for ( i=0 ; i<6 ; i++ ) // the six legs
{
if ( i < 3 ) prog = Mod(m_armMember+(2.0f-(i%3))*0.33f+0.0f, 1.0f);
else prog = Mod(m_armMember+(2.0f-(i%3))*0.33f+0.3f, 1.0f);
@@ -457,7 +459,7 @@ BOOL CMotionMother::EventFrame(const Event &event) }
st = st*27+(i%3)*3;
nd = nd*27+(i%3)*3;
- if ( i < 3 ) // patte droite (1..3) ?
+ if ( i < 3 ) // right leg (1..3) ?
{
m_object->SetAngleX(2+2*i+0, Prop(m_armAngles[st+ 0], m_armAngles[nd+ 0], prog));
m_object->SetAngleY(2+2*i+0, Prop(m_armAngles[st+ 1], m_armAngles[nd+ 1], prog));
@@ -466,7 +468,7 @@ BOOL CMotionMother::EventFrame(const Event &event) m_object->SetAngleY(2+2*i+1, Prop(m_armAngles[st+10], m_armAngles[nd+10], prog));
m_object->SetAngleZ(2+2*i+1, Prop(m_armAngles[st+11], m_armAngles[nd+11], prog));
}
- else // patte gauche (4..6) ?
+ else // left leg (4..6) ?
{
m_object->SetAngleX(2+2*i+0, Prop( m_armAngles[st+ 0], m_armAngles[nd+ 0], prog));
m_object->SetAngleY(2+2*i+0, Prop(180-m_armAngles[st+ 1], 180-m_armAngles[nd+ 1], prog));
@@ -519,20 +521,20 @@ BOOL CMotionMother::EventFrame(const Event &event) m_object->SetLinVibration(dir);
}
- m_object->SetAngleZ(1, sinf(m_armTimeAbs*0.5f)*0.20f); // tête
- m_object->SetAngleX(1, sinf(m_armTimeAbs*0.6f)*0.10f); // tête
- m_object->SetAngleY(1, sinf(m_armTimeAbs*0.7f)*0.20f); // tête
+ m_object->SetAngleZ(1, sinf(m_armTimeAbs*0.5f)*0.20f); // head
+ m_object->SetAngleX(1, sinf(m_armTimeAbs*0.6f)*0.10f); // head
+ m_object->SetAngleY(1, sinf(m_armTimeAbs*0.7f)*0.20f); // head
m_object->SetAngleZ(14, 0.50f);
m_object->SetAngleZ(16, 0.50f);
- m_object->SetAngleY(14, 0.80f+sinf(m_armTimeAbs*1.1f)*0.53f); // antenne droite
+ m_object->SetAngleY(14, 0.80f+sinf(m_armTimeAbs*1.1f)*0.53f); // right antenna
m_object->SetAngleY(15, 0.70f-sinf(m_armTimeAbs*1.7f)*0.43f);
- m_object->SetAngleY(16, -0.80f+sinf(m_armTimeAbs*0.9f)*0.53f); // antenne gauche
+ m_object->SetAngleY(16, -0.80f+sinf(m_armTimeAbs*0.9f)*0.53f); // left antenna
m_object->SetAngleY(17, -0.70f-sinf(m_armTimeAbs*1.3f)*0.43f);
- m_object->SetAngleY(18, sinf(m_armTimeAbs*1.1f)*0.20f); // pince droite
+ m_object->SetAngleY(18, sinf(m_armTimeAbs*1.1f)*0.20f); // right claw
m_object->SetAngleZ(18, -0.20f);
- m_object->SetAngleY(19, sinf(m_armTimeAbs*0.9f)*0.20f); // pince gauche
+ m_object->SetAngleY(19, sinf(m_armTimeAbs*0.9f)*0.20f); // left claw
m_object->SetAngleZ(19, -0.20f);
return TRUE;
|