52 std::string direction_check = Direction;
53 SetCase(direction_check,
false);
58 if (direction_check ==
"down")
60 if (direction_check ==
"left" || direction_check ==
"forward" || direction_check ==
"front")
62 if (direction_check ==
"right" || direction_check ==
"back")
110 Real tempposition, temporigin;
119 bool DoorChanged =
false;
120 bool DoorDirection =
false;
121 bool NudgeStatus =
false;
122 bool PreviousOpen =
false;
142 if (
finished ==
true && DoorChanged ==
false)
147 if (DoorDirection ==
false)
160 Real difference = std::abs(tempposition - temporigin);
165 if ((tempposition - temporigin > 0 &&
old_difference < 0) || (tempposition - temporigin < 0 && old_difference > 0))
213 if (DoorDirection ==
false)
256 if (DoorDirection ==
false)
294 else if (PreviousOpen != open && DoorChanged ==
true &&
reversed ==
false)
328 if ((difference <=
marker1 && open ==
true) || (difference >=
marker2 && open ==
false))
331 if (DoorChanged ==
false)
344 if (difference <=
marker1 && open ==
true)
346 else if (difference >=
marker2 && open ==
false)
364 if ((difference <
marker2 && open ==
true) || (difference >
marker1 && open ==
false))
451 bool DoorDirection =
false;
472 if (DoorDirection ==
false)
505 bool DoorDirection =
false;
523 if (DoorDirection ==
false)
600 floor = shaftdoor_floor;
636 for (
size_t i = 0; i <
doors.size(); i++)
656 doors.emplace_back(door);
667 for (
size_t i = 0; i <
doors.size(); i++)
679 for (
size_t i = 0; i <
doors.size(); i++)
684 doors[i]->MoveDoors(open, manual);
686 doors[i]->RotateDoors(open);
695 for (
size_t i = 0; i <
doors.size(); i++)
714 for (
size_t i = 0; i <
doors.size(); i++)
719 if (
doors[i]->finished ==
false)
730 for (
size_t i = 0; i <
doors.size(); i++)
733 doors[i]->finished =
false;
741 for (
size_t i = 0; i <
doors.size(); i++)
745 doors[i]->active_speed = 0;
746 doors[i]->door_section = 0;
757 for (
size_t i = 0; i <
doors.size(); i++)
760 doors[i]->Reset(
false);
772 if (shift ==
true && right ==
false)
void OnClick(Vector3 &position, bool shift, bool ctrl, bool alt, bool right)
void StopDoors(int number=0)
bool OpenDoorsEmergency(int number=0, int whichdoors=1, int floor=0, bool hold=false)
void CloseDoorsEmergency(int number=0, int whichdoors=1, int floor=0, bool hold=false)
bool OpenDoors(int number=0, int whichdoors=1, int floor=0, bool manual=false, bool hold=false)
bool AreDoorsOpen(int number=0)
int AreDoorsMoving(int number=0, bool car_doors=true, bool shaft_doors=true)
bool AreShaftDoorsOpen(int number, int floor)
void RemoveShaftDoor(DoorWrapper *door)
Real GetBase(bool relative=false)
const std::string & GetName()
virtual void SetRotation(const Vector3 &rotation)
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)
virtual void SetPosition(const Vector3 &position)
Floor * GetFloor(int number)
void SetCase(std::string &string, bool uppercase)
std::string ToString(int number)
void TrimString(std::string &string)
#define SBS_PROFILE(name)
void RotateDoors(bool open)
void MoveDoors(bool open, bool manual)
DoorComponent(const std::string &doorname, DoorWrapper *Wrapper, const std::string &direction, bool OpenClockwise, Real OpenSpeed, Real CloseSpeed, DynamicMesh *dynmesh)
ElevatorDoor * parent_elevdoor
void MoveDoors(bool open, bool manual=false)
DoorWrapper(Object *parent_obj, ElevatorDoor *door_object, bool shaftdoor, int shaftdoor_floor=0)
std::vector< DoorComponent * > doors
DoorComponent * CreateDoor(const std::string &doorname, const std::string &Direction, bool OpenClockwise, Real OpenSpeed, Real CloseSpeed, DynamicMesh *dynmesh)
void OnClick(Vector3 &position, bool shift, bool ctrl, bool alt, bool right)