Skip to content

Commit

Permalink
docs(VEarthquake): add documentation for zCEarthquake
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Dec 29, 2023
1 parent 299f383 commit b0a558e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 7 deletions.
48 changes: 48 additions & 0 deletions docs/engine/objects/zCEarthquake.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# zCEarthquake

!!! abstract inline end "Quick Infos"
**Type:** Virtual Object<br/>
**Format Name:** ZenGin Archive<br/>
**File Extension:** `.ZEN`<br/>
**Class Name:** `zCEarthquake`<br/>
**Version Identifiers:**<br />
— Gothic I: *Unused*<br/>
— Gothic II: `52224`<br/>
**ZenKit Class:** `VEarthquake`

A VObject used to create an earthquake effect. An earthquake is represented by a shaking camera.

<ul class="sp-list">
<li class="sp-type"><a href="../zCVob/">zCVob</a></li>
<li class="sp-type">
<span>zCEarthquake</span>
<ul class="sp-list">
<li class="sp-folder">
<span>Earthquake</span>
<ul class="sp-list">
<li class="sp-float"><a href="#radius">radius</a> = 200</li>
<li class="sp-float"><a href="#timeSec">timeSec</a> = 5</li>
<li class="sp-vec"><a href="#amplitudeCM">amplitudeCM</a> = 0 0 0</li>
</ul>
</li>
</ul>
</li>
</ul>

## Properties

<a name="radius" class="t-float"></a> `radius`

: The radius of the earthquake effect

<a name="timeSec" class="t-float"></a> `timeSec`

: The duration of the earthquake effect in seconds.

<a name="amplitudeCM" class="t-float"></a> `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).
28 changes: 21 additions & 7 deletions include/zenkit/vobs/Misc.hh
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit b0a558e

Please sign in to comment.