38MovingWalkway::MovingWalkway(
Object *parent,
const std::string &name,
int run,
Real speed,
const std::string &sound_file,
const std::string &texture,
const std::string &direction,
Real CenterX,
Real CenterZ,
Real width,
Real treadsize,
int num_steps,
Real voffset,
Real tw,
Real th) :
Object(parent)
58 start = Vector3::ZERO;
69 Move(CenterX, voffset, CenterZ);
72 for (
int i = 0; i < num_steps; i++)
75 Steps.emplace_back(mesh);
92 for (
size_t i = 0; i <
Steps.size(); i++)
127 for (
size_t i = 0; i <
Steps.size(); i++)
140 for (
size_t i = 0; i <
Steps.size(); i++)
142 Steps[i]->vector = Vector3::ZERO;
199 int num_steps = (int)
Steps.size();
207 for (
int i = 1; i <= num_steps; i++)
213 Wall *wall =
Steps[i - 1]->CreateWallObject(base);
217 sbs->
DrawWalls(
false,
true,
false,
false,
false,
false);
222 sbs->
AddFloorMain(wall, base, texture, 0, 0, -(width / 2),
treadsize, width / 2, 0, 0,
false,
false, tw, th,
true);
228 sbs->
AddFloorMain(wall, base, texture, 0, -
treadsize, -(width / 2), 0, width / 2, 0, 0,
false,
false, tw, th,
true);
234 sbs->
AddFloorMain(wall, base, texture, 0, -(width / 2), 0, width / 2,
treadsize, 0, 0,
false,
false, tw, th,
true);
240 sbs->
AddFloorMain(wall, base, texture, 0, -(width / 2), -
treadsize, width / 2, 0, 0, 0,
false,
false, tw, th,
true);
243 Steps[i - 1]->vector = Vector3::ZERO;
244 Steps[1 - 1]->speed = 0;
250 Steps[i - 1]->start =
Steps[i - 1]->GetPosition();
262 for (
size_t i = 0; i <
Steps.size(); i++)
350 for (
size_t i = 0; i <
Steps.size(); i++)
352 Steps[i]->vector = Vector3::ZERO;
368 for (
size_t i = 0; i <
Steps.size(); i++)
Vector3 GetPosition(bool relative=false)
void OnClick(Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
std::vector< Step * > Steps
void CreateSteps(const std::string &texture, const std::string &direction, Real width, Real treadsize, Real tw, Real th)
void Report(const std::string &message)
bool ReportError(const std::string &message)
MovingWalkway(Object *parent, const std::string &name, int run, Real speed, const std::string &sound_file, const std::string &texture, const std::string &direction, Real CenterX, Real CenterZ, Real width, Real treadsize, int num_steps, Real voffset, Real tw, Real th)
const std::string & GetName()
virtual bool ReportError(const std::string &message)
virtual void Report(const std::string &message)
void SetName(const std::string &name)
virtual void Move(const Vector3 &vector, Real speed=1.0)
virtual Vector3 GetPosition(bool relative=false)
void SetValues(const std::string &type, const std::string &name, bool is_permanent, bool is_movable=true)
void EnableLoop(bool value)
const std::string & GetType()
void RegisterMovingWalkway(MovingWalkway *walkway)
void ResetWalls(bool ToDefaults=false)
TextureManager * GetTextureManager()
bool SetWallOrientation(std::string direction)
void DrawWalls(bool MainN, bool MainP, bool SideN, bool SideP, bool Top, bool Bottom)
void UnregisterMovingWalkway(MovingWalkway *walkway)
bool AddFloorMain(Wall *wallobject, const std::string &name, const std::string &texture, Real thickness, Real x1, Real z1, Real x2, Real z2, Real altitude1, Real altitude2, bool reverse_axis, bool texture_direction, Real tw, Real th, bool autosize, bool legacy_behavior=false)
bool Load(const std::string &filename, bool force=false)
bool Play(bool reset=true)
void SetLoopState(bool value)
void ResetTextureMapping(bool todefaults=false)
void SetCase(std::string &string, bool uppercase)
std::string ToString(int number)
void TrimString(std::string &string)
#define SBS_PROFILE(name)