From b0a558e8056acea1558dd0ce39a724fb66e6df15 Mon Sep 17 00:00:00 2001 From: Luis Michaelis Date: Fri, 29 Dec 2023 12:17:11 +0100 Subject: [PATCH] docs(VEarthquake): add documentation for `zCEarthquake` --- docs/engine/objects/zCEarthquake.md | 48 +++++++++++++++++++++++++++++ include/zenkit/vobs/Misc.hh | 28 ++++++++++++----- mkdocs.yml | 1 + 3 files changed, 70 insertions(+), 7 deletions(-) create mode 100644 docs/engine/objects/zCEarthquake.md diff --git a/docs/engine/objects/zCEarthquake.md b/docs/engine/objects/zCEarthquake.md new file mode 100644 index 00000000..934fd929 --- /dev/null +++ b/docs/engine/objects/zCEarthquake.md @@ -0,0 +1,48 @@ +# zCEarthquake + +!!! abstract inline end "Quick Infos" + **Type:** Virtual Object
+ **Format Name:** ZenGin Archive
+ **File Extension:** `.ZEN`
+ **Class Name:** `zCEarthquake`
+ **Version Identifiers:**
+ — Gothic I: *Unused*
+ — Gothic II: `52224`
+ **ZenKit Class:** `VEarthquake` + +A VObject used to create an earthquake effect. An earthquake is represented by a shaking camera. + + + +## Properties + + `radius` + +: The radius of the earthquake effect + + `timeSec` + +: The duration of the earthquake effect in seconds. + + `amplitudeCM` + +: The amplitude of the earthquake effect. + +## Sources + +The Russian-language knowledge accumulator [gothic-library.ru](http://www.gothic-library.ru/publ/zcearthquake/1-1-0-516). diff --git a/include/zenkit/vobs/Misc.hh b/include/zenkit/vobs/Misc.hh index 9b043266..2394b2cf 100644 --- a/include/zenkit/vobs/Misc.hh +++ b/include/zenkit/vobs/Misc.hh @@ -413,25 +413,39 @@ namespace zenkit { [[nodiscard]] ZKAPI uint16_t get_version_identifier(GameVersion game) const override; }; - /// \brief A VOb which represents an earthquake-like effect. + /// \brief A VObject used to create an earthquake effect. + /// + /// An earthquake is represented by a shaking camera. + /// + /// \see https://zk.gothickit.dev/engine/objects/zCEarthquake/ struct VEarthquake : VirtualObject { ZK_OBJECT(ObjectType::zCEarthquake); public: + /// \brief The radius of the earthquake effect + /// \see https://zk.gothickit.dev/engine/objects/zCEarthquake/#radius float radius; + + /// \brief The duration of the earthquake effect in seconds. + /// \see https://zk.gothickit.dev/engine/objects/zCEarthquake/#timeSec float duration; + + /// \brief The amplitude of the earthquake effect. + /// \see https://zk.gothickit.dev/engine/objects/zCEarthquake/#amplitudeCM glm::vec3 amplitude; - /// \brief Parses an earthquake VOb the given *ZenGin* archive. - /// \param[out] obj The object to read. - /// \param[in,out] ctx The archive reader to read from. - /// \note After this function returns the position of \p ctx will be at the end of the parsed object. - /// \throws ParserError if parsing fails. - /// \see vob::parse ZKREM("use ::load()") ZKAPI static void parse(VEarthquake& obj, ReadArchive& ctx, GameVersion version); + /// \brief Load this object from the given archive. + /// \param r The archive to read from; + /// \param version The version of the game the object was made for. ZKAPI void load(ReadArchive& r, GameVersion version) override; + + /// \brief Save this object to the given archive. + /// \param w The archive to save to. + /// \param version The version of the game to save for. ZKAPI void save(WriteArchive& w, GameVersion version) const override; + [[nodiscard]] ZKAPI uint16_t get_version_identifier(GameVersion game) const override; }; diff --git a/mkdocs.yml b/mkdocs.yml index 5ed61a84..f38c66aa 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -46,6 +46,7 @@ nav: - 'zCVobStair': 'engine/objects/zCVobStair.md' - 'zCVobStartpoint': 'engine/objects/zCVobStartpoint.md' - 'zCCodeMaster': 'engine/objects/zCCodeMaster.md' + - 'zCEarthquake': 'engine/objects/zCEarthquake.md' - 'zCMessageFilter': 'engine/objects/zCMessageFilter.md' - 'zCMoverControler': 'engine/objects/zCMoverController.md' - 'zCPFXControler': 'engine/objects/zCPFXControler.md'