Implement Stop()

This commit is contained in:
smallmodel 2025-02-15 14:38:51 +01:00
parent 3af35fa610
commit 68181acec7
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 24 additions and 2 deletions

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -250,3 +250,24 @@ void Mover::LinearInterpolate(Vector tdest, Vector angdest, float time, Event& e
PostEvent(EV_MoveDone, time);
}
/*
=============
Stop
===============
*/
void Mover::Stop()
{
if (endevent) {
delete endevent;
endevent = NULL;
}
CancelEventsOfType(EV_MoveDone);
moveflags = 0;
avelocity = vec_zero;
velocity = vec_zero;
accel = vec_zero;
aaccel = vec_zero;
}

View file

@ -1,6 +1,6 @@
/*
===========================================================================
Copyright (C) 2024 the OpenMoHAA team
Copyright (C) 2025 the OpenMoHAA team
This file is part of OpenMoHAA source code.
@ -48,6 +48,7 @@ public:
void MoveDone(Event *ev);
void MoveTo(Vector tdest, Vector angdest, float tspeed, Event& event);
void LinearInterpolate(Vector tdest, Vector angdest, float time, Event& event);
void Stop();
void Archive(Archiver& arc) override;
};