Added FollowPathRelativeYaw and NormalAngles

This commit is contained in:
smallmodel 2023-11-27 20:30:36 +01:00
parent 615726cc75
commit a7902a8837
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
2 changed files with 20 additions and 2 deletions

View file

@ -593,6 +593,16 @@ Event EV_ScriptSlave_ModifyFlyPath
EV_NORMAL
);
Event EV_ScriptSlave_NormalAngles
(
"normalangles",
EV_DEFAULT,
"b",
"bUseNormalAngles",
"Sets the object to use normal angles when travelling on a spline path",
EV_NORMAL
);
CLASS_DECLARATION(Mover, ScriptSlave, "script_object") {
{&EV_Bind, &ScriptSlave::BindEvent },
{&EV_Unbind, &ScriptSlave::EventUnbind },
@ -658,7 +668,7 @@ CLASS_DECLARATION(Mover, ScriptSlave, "script_object") {
{&EV_ScriptSlave_PhysicsVelocity, &ScriptSlave::PhysicsVelocity },
{&EV_ScriptSlave_FlyPath, &ScriptSlave::EventFlyPath },
{&EV_ScriptSlave_ModifyFlyPath, &ScriptSlave::EventModifyFlyPath },
{&EV_ScriptSlave_NormalAngles, &ScriptSlave::EventNormalAngles },
{NULL, NULL }
};
@ -1739,6 +1749,12 @@ void ScriptSlave::EventModifyFlyPath(Event *ev)
}
}
void ScriptSlave::EventNormalAngles(Event *ev)
{
splineangles = !ev->GetBoolean(1);
ignoreangles = false;
}
void ScriptSlave::SetupPath(cSpline<4, 512> *pPath, SimpleEntity *se)
{
str name;

View file

@ -139,7 +139,7 @@ protected:
void SetDamage(Event *ev);
void SetMeansOfDeath(Event *ev);
void FollowPath(Event *ev);
void FollowPathRelativeYaw(Event *ev);
void FollowPathRelativeYaw(Event *ev); // Added in 2.0
void EndPath(Event *ev);
void FollowingPath(Event *ev);
void CreatePath(SplinePath *path, splinetype_t type);
@ -153,6 +153,7 @@ protected:
void DamageFunc(Event *ev);
void EventFlyPath(Event *ev);
void EventModifyFlyPath(Event *ev);
void EventNormalAngles(Event *ev); // Added in 2.0
void SetupPath(cSpline<4, 512> *pPath, SimpleEntity *se);
void Archive(Archiver& arc) override;
@ -231,6 +232,7 @@ inline void ScriptSlave::Archive(Archiver& arc)
arc.ArchiveFloat(&m_fIdealAccel);
arc.ArchiveFloat(&m_fIdealDistance);
arc.ArchiveFloat(&m_fLookAhead);
arc.ArchiveFloat(&m_fFollowRelativeYaw);
}
class ScriptModel : public ScriptSlave