OSDN Git Service

Properly position escalator and walkway sounds
authorryan <>
Wed, 18 Jan 2017 05:49:38 +0000 (05:49 +0000)
committerryan <>
Wed, 18 Jan 2017 05:49:38 +0000 (05:49 +0000)
src/sbs/escalator.cpp
src/sbs/movingwalkway.cpp

index b6a6c49..6557c7c 100644 (file)
@@ -63,6 +63,10 @@ Escalator::Escalator(Object *parent, const std::string &name, int run, float spe
        end = 0;
        buffer_zone_steps = 2;
 
+       //create sound object
+       sound = new Sound(this, name, true);
+       sound->Load(sound_file);
+
        //move object
        Move(CenterX, voffset, CenterZ);
 
@@ -73,11 +77,6 @@ Escalator::Escalator(Object *parent, const std::string &name, int run, float spe
                Steps.push_back(mesh);
        }
 
-       //create sound object
-       sound = new Sound(this, name, true);
-       sound->Load(sound_file);
-       sound->SetPosition(CenterX, voffset, CenterZ);
-
        //create steps
        CreateSteps(texture, direction, width, risersize, treadsize, tw, th);
 }
index dc4826c..40df6db 100644 (file)
@@ -62,6 +62,10 @@ MovingWalkway::MovingWalkway(Object *parent, const std::string &name, int run, f
 
        StepContainer = new DynamicMesh(this, GetSceneNode(), name + " Step Container", 0, true);
 
+       //create sound object
+       sound = new Sound(this, name, true);
+       sound->Load(sound_file);
+
        //move object
        Move(CenterX, voffset, CenterZ);
 
@@ -72,11 +76,6 @@ MovingWalkway::MovingWalkway(Object *parent, const std::string &name, int run, f
                Steps.push_back(mesh);
        }
 
-       //create sound object
-       sound = new Sound(this, name, true);
-       sound->Load(sound_file);
-       sound->SetPosition(CenterX, voffset, CenterZ);
-
        //create steps
        CreateSteps(texture, direction, width, treadsize, tw, th);
 }