Streamer emitter (#1589)

* WIP

* Committ

* LUA DOCS

* Expose Moveable Scale (#1587)

* Done

* Update CHANGELOG.md

* Cleanup

* Minor fixes

* Update CHANGELOG.md

---------

Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>

* Cleanup

* Improve streamer effect implementation

* Shorten names

* Update Streamer.h

* Point to Moveable

* Change to Const

* Doc revisions

* Doc revisions

* Update CHANGELOG.md

* Use precise names

* Do things over seconds

* Make tag optional again

* Integrate start and end colour

* Update doc comment

* Regenerate docs; update strings

* Update doc comment

* Update ReservedScriptNames.h

* Update EffectsFunctions.cpp

* Minor fixes

* Update EffectsFunctions.cpp

* Update EffectsFunctions.cpp

* Update EffectsFunctions.cpp

* Rename Item

* Renames

* Add compiled docs

---------

Co-authored-by: Lwmte <3331699+Lwmte@users.noreply.github.com>
Co-authored-by: Sezz <sezzary@outlook.com>
This commit is contained in:
TrainWrack 2025-03-08 23:19:08 -05:00 committed by GitHub
parent e54fba1e4a
commit e047da7257
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 366 additions and 88 deletions

View file

@ -35,6 +35,7 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
* Added diary module.
* Added View.GetFlyByPosition() and View.GetFlyByRotation() functions to get flyby sequence parameters at a specified time point.
* Added Effects.EmitAirBubble() function to spawn air bubbles.
* Added Effects.EmitStreamer() function to emit streamers.
* Added Moveable:GetScale() and Movebale:SetScale() methods to set visible scale of moveables.
* Added Rotation:Lerp() function to allow linear interpolation between rotations.
* Added various Translate() methods to Vec2 and Vec3 script objects.

View file

@ -79,6 +79,7 @@
<li> <a href="../4 enums/Collision.MaterialType.html">Collision.MaterialType</a></li>
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <a href="../4 enums/Effects.FeatherMode.html">Effects.FeatherMode</a></li>
<li> <a href="../4 enums/Flow.ErrorMode.html">Flow.ErrorMode</a></li>
<li> <a href="../4 enums/Flow.FreezeMode.html">Flow.FreezeMode</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>
@ -114,8 +115,6 @@
<p>Represents a collision probe in the game world.</p>
<p> Provides collision information from a reference world position.</p>
<p> pragma nostrip</p>
<h2><a href="#Functions">Functions</a></h2>
<table class="function_list">
@ -124,22 +123,30 @@
<td class="summary">Create a Probe at a specified world position in a room.</td>
</tr>
<tr>
<td class="name" ><a href="#Probe">Probe(pos, originRoomNumber, dir, dist)</a></td>
<td class="name" ><a href="#Probe">Probe(pos, roomNumber, dir, dist)</a></td>
<td class="summary">Create a Probe that casts from an origin world position in a room in a given direction for a specified distance.</td>
</tr>
<tr>
<td class="name" ><a href="#Probe">Probe(Origin, originRoomNumber, rot, dist)</a></td>
<td class="summary">Create a Probe that casts from an origin world position in a room in the direction of a given Rotation for a specified distance.</td>
<td class="name" ><a href="#Probe">Probe(pos, roomNumber, rot, dist)</a></td>
<td class="summary">Create a Probe that casts from an origin world position in a room in the direction of a given rotation for a specified distance.</td>
</tr>
<tr>
<td class="name" ><a href="#Probe">Probe(Origin, originRoomNumber, rot, relOffset)</a></td>
<td class="summary">Create a Probe that casts from an origin world position, where a given relative offset is rotated according to a given Rotation.</td>
<td class="name" ><a href="#Probe">Probe(pos, roomNumber, rot, relOffset)</a></td>
<td class="summary">Create a Probe that casts from an origin world position, where a given relative offset is rotated according to a given rotation.</td>
</tr>
<tr>
<td class="name" ><a href="#GetPosition">GetPosition()</a></td>
<td class="summary">Get the world position of this Probe.</td>
</tr>
<tr>
<td class="name" ><a href="#GetRoom">GetRoom()</a></td>
<td class="summary">Get the Room object of this Probe.</td>
</tr>
<tr>
<td class="name" ><a href="#GetRoomName">GetRoomName()</a></td>
<td class="summary">Get the room name of this Probe.</td>
</tr>
<tr>
<td class="name" ><a href="#GetFloorHeight">GetFloorHeight()</a></td>
<td class="summary">Get the floor height at this Probe.</td>
</tr>
@ -177,11 +184,11 @@
</tr>
<tr>
<td class="name" ><a href="#IsWall">IsWall()</a></td>
<td class="summary">Check if there is a wall at this Probe.</td>
<td class="summary">Check if the Probe is inside a wall.</td>
</tr>
<tr>
<td class="name" ><a href="#IsInsideSolidGeometry">IsInsideSolidGeometry()</a></td>
<td class="summary">Check if this Probe is inside solid geometry, i.e.</td>
<td class="summary">Check if this Probe is inside solid geometry (below a floor, above a ceiling, inside a bridge, or inside a wall).</td>
</tr>
<tr>
<td class="name" ><a href="#IsClimbableWall">IsClimbableWall(headingAngle)</a></td>
@ -189,11 +196,15 @@
</tr>
<tr>
<td class="name" ><a href="#IsMonkeySwing">IsMonkeySwing()</a></td>
<td class="summary">Check if there is a monkey swing at this Probe.</td>
<td class="summary">Check if there is a monkey swing sector at this Probe.</td>
</tr>
<tr>
<td class="name" ><a href="#IsDeath">IsDeath()</a></td>
<td class="summary">Check if there is a death tile at this Probe.</td>
<td class="summary">Check if there is a death sector at this Probe.</td>
</tr>
<tr>
<td class="name" ><a href="#Preview">Preview()</a></td>
<td class="summary">Preview this Probe in the Collision Stats debug page.</td>
</tr>
</table>
@ -221,7 +232,7 @@
</li>
<li><span class="parameter">roomNumber</span>
<span class="types"><span class="type">int</span></span>
Room number.
[opt] Room number. Must be used if probing a position in an overlapping room.
</li>
</ul>
@ -229,7 +240,7 @@
<ol>
<span class="types"><a class="type" href="../2 classes/Collision.Probe.html#Probe">Probe</a></span>
a new Probe.
A new Probe.
</ol>
@ -238,7 +249,7 @@
</dd>
<dt>
<a name = "Probe"></a>
<strong>Probe(pos, originRoomNumber, dir, dist)</strong>
<strong>Probe(pos, roomNumber, dir, dist)</strong>
</dt>
<dd>
Create a Probe that casts from an origin world position in a room in a given direction for a specified distance.
@ -252,9 +263,9 @@
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Origin world position to cast from.
</li>
<li><span class="parameter">originRoomNumber</span>
<li><span class="parameter">roomNumber</span>
<span class="types"><span class="type">int</span></span>
Origin's room number.
Origin room number.
</li>
<li><span class="parameter">dir</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
@ -270,7 +281,7 @@
<ol>
<span class="types"><a class="type" href="../2 classes/Collision.Probe.html#Probe">Probe</a></span>
a new Probe.
A new Probe.
</ol>
@ -279,23 +290,23 @@
</dd>
<dt>
<a name = "Probe"></a>
<strong>Probe(Origin, originRoomNumber, rot, dist)</strong>
<strong>Probe(pos, roomNumber, rot, dist)</strong>
</dt>
<dd>
Create a Probe that casts from an origin world position in a room in the direction of a given Rotation for a specified distance.
Create a Probe that casts from an origin world position in a room in the direction of a given rotation for a specified distance.
Required to correctly traverse between rooms.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Origin</span>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
world position to cast from.
Origin world position to cast from.
</li>
<li><span class="parameter">originRoomNumber</span>
<li><span class="parameter">roomNumber</span>
<span class="types"><span class="type">int</span></span>
Origin's room number.
Origin room number.
</li>
<li><span class="parameter">rot</span>
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
@ -311,7 +322,7 @@
<ol>
<span class="types"><a class="type" href="../2 classes/Collision.Probe.html#Probe">Probe</a></span>
a new Probe.
A new Probe.
</ol>
@ -320,23 +331,23 @@
</dd>
<dt>
<a name = "Probe"></a>
<strong>Probe(Origin, originRoomNumber, rot, relOffset)</strong>
<strong>Probe(pos, roomNumber, rot, relOffset)</strong>
</dt>
<dd>
Create a Probe that casts from an origin world position, where a given relative offset is rotated according to a given Rotation.
Create a Probe that casts from an origin world position, where a given relative offset is rotated according to a given rotation.
Required to correctly traverse between rooms.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">Origin</span>
<li><span class="parameter">pos</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
world position to cast from.
Origin world position to cast from.
</li>
<li><span class="parameter">originRoomNumber</span>
<li><span class="parameter">roomNumber</span>
<span class="types"><span class="type">int</span></span>
Origin's room number.
Origin room number.
</li>
<li><span class="parameter">rot</span>
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
@ -352,7 +363,7 @@
<ol>
<span class="types"><a class="type" href="../2 classes/Collision.Probe.html#Probe">Probe</a></span>
a new Probe.
A new Probe.
</ol>
@ -379,6 +390,48 @@
</dd>
<dt>
<a name = "GetRoom"></a>
<strong>GetRoom()</strong>
</dt>
<dd>
Get the Room object of this Probe.
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">Room</span></span>
Room object.
</ol>
</dd>
<dt>
<a name = "GetRoomName"></a>
<strong>GetRoomName()</strong>
</dt>
<dd>
Get the room name of this Probe.
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="https://www.lua.org/manual/5.4/manual.html#6.4">string</a></span>
Room name.
</ol>
</dd>
<dt>
<a name = "GetFloorHeight"></a>
@ -393,8 +446,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int[opt]</span></span>
Floor height. <strong>nil: no floor exists.</strong>
<span class="types"><span class="type">int</span></span>
Floor height. <strong>nil: no floor exists</strong>
</ol>
@ -414,8 +467,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int[opt]</span></span>
Ceiling height. <strong>nil: no ceiling exists.</strong>
<span class="types"><span class="type">int</span></span>
Ceiling height. <strong>nil: no ceiling exists</strong>
</ol>
@ -435,8 +488,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">int[opt]</span></span>
Water surface height. <strong>nil: no water surface exists.</strong>
<span class="types"><span class="type">int</span></span>
Water surface height. <strong>nil: no water surface exists</strong>
</ol>
@ -456,8 +509,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3[opt]</a></span>
Floor normal. <strong>nil: no floor exists.</strong>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Floor normal. <strong>nil: no floor exists</strong>
</ol>
@ -477,8 +530,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3[opt]</a></span>
Ceiling normal. <strong>nil: no ceiling exists.</strong>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Ceiling normal. <strong>nil: no ceiling exists</strong>
</ol>
@ -498,8 +551,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../4 enums/Collision.MaterialType.html#">Collision.MaterialType[opt]</a></span>
Floor material type. <strong>nil: no floor exists.</strong>
<span class="types"><a class="type" href="../4 enums/Collision.MaterialType.html#">MaterialType</a></span>
Floor material type. <strong>nil: no floor exists</strong>
</ol>
@ -519,8 +572,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../4 enums/Collision.MaterialType.html#">Collision.MaterialType[opt]</a></span>
Ceiling material type. <strong>nil: no ceiling exists.</strong>
<span class="types"><a class="type" href="../4 enums/Collision.MaterialType.html#">MaterialType</a></span>
Ceiling material type. <strong>nil: no ceiling exists</strong>
</ol>
@ -540,8 +593,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[opt]</span></span>
Steep floor status. <strong>true: is a steep floor, false: isn't a steep floor, nil: no floor exists.</strong>
<span class="types"><span class="type">bool</span></span>
Steep floor status. <strong>true: is a steep floor, false: isn't a steep floor, nil: no floor exists</strong>
</ol>
@ -561,8 +614,8 @@
<h3>Returns:</h3>
<ol>
<span class="types"><span class="type">bool[opt]</span></span>
Steep ceiling status. <strong>true: is a steep ceiling, false: isn't a steep ceiling, nil: no ceiling exists.</strong>
<span class="types"><span class="type">bool</span></span>
Steep ceiling status. <strong>true: is a steep ceiling, false: isn't a steep ceiling, nil: no ceiling exists</strong>
</ol>
@ -574,7 +627,7 @@
<strong>IsWall()</strong>
</dt>
<dd>
Check if there is a wall at this Probe. Can be used to determine if a wall and ceiling exist.
Check if the Probe is inside a wall. Can be used to determine if a wall and ceiling exist.
@ -595,7 +648,7 @@
<strong>IsInsideSolidGeometry()</strong>
</dt>
<dd>
Check if this Probe is inside solid geometry, i.e. below a floor, above a ceiling, or inside a wall.
Check if this Probe is inside solid geometry (below a floor, above a ceiling, inside a bridge, or inside a wall).
@ -632,7 +685,7 @@
<ol>
<span class="types"><span class="type">bool</span></span>
Climbable wall status. <strong>true: is climbable, false: isn't climbable</strong>
Climbable wall status. <strong>true: is climbable wall, false: isn't climbable</strong>
</ol>
@ -644,7 +697,7 @@
<strong>IsMonkeySwing()</strong>
</dt>
<dd>
Check if there is a monkey swing at this Probe.
Check if there is a monkey swing sector at this Probe.
@ -653,7 +706,7 @@
<ol>
<span class="types"><span class="type">bool</span></span>
Monkey swing status. <strong>true: is a monkey swing, false: isn't a monkey swing</strong>
Monkey swing sector status. <strong>true: is a monkey swing, false: isn't a monkey swing</strong>
</ol>
@ -665,7 +718,7 @@
<strong>IsDeath()</strong>
</dt>
<dd>
Check if there is a death tile at this Probe.
Check if there is a death sector at this Probe.
@ -674,12 +727,27 @@
<ol>
<span class="types"><span class="type">bool</span></span>
Death tile status. <strong>true: is a death tile, false: isn't a death tile</strong>
Death sector status. <strong>true: is a death sector, false: isn't a death sector</strong>
</ol>
</dd>
<dt>
<a name = "Preview"></a>
<strong>Preview()</strong>
</dt>
<dd>
Preview this Probe in the Collision Stats debug page.
</dd>
</dl>

View file

@ -79,6 +79,7 @@
<li> <here>Collision.MaterialType</here></li>
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <a href="../4 enums/Effects.FeatherMode.html">Effects.FeatherMode</a></li>
<li> <a href="../4 enums/Flow.ErrorMode.html">Flow.ErrorMode</a></li>
<li> <a href="../4 enums/Flow.FreezeMode.html">Flow.FreezeMode</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>

View file

@ -0,0 +1,172 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
<title>TombEngine 1.7.2 (Developer) Lua API</title>
<link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div> <!-- id="product" -->
<div id="main">
<!-- Menu -->
<div id="navigation">
<br/>
<h1>&nbsp;TombEngine</h1>
<ul>
<li><a href="../index.html">Index</a></li>
</ul>
<h2>1 Modules</h2>
<ul class="nowrap">
<li> <a href="../1 modules/Effects.html">Effects</a></li>
<li> <a href="../1 modules/Flow.html">Flow</a></li>
<li> <a href="../1 modules/Input.html">Input</a></li>
<li> <a href="../1 modules/Inventory.html">Inventory</a></li>
<li> <a href="../1 modules/Logic.html">Logic</a></li>
<li> <a href="../1 modules/Objects.html">Objects</a></li>
<li> <a href="../1 modules/Sound.html">Sound</a></li>
<li> <a href="../1 modules/Strings.html">Strings</a></li>
<li> <a href="../1 modules/Util.html">Util</a></li>
<li> <a href="../1 modules/View.html">View</a></li>
</ul>
<h2>2 Classes</h2>
<ul class="nowrap">
<li> <a href="../2 classes/Collision.Probe.html">Collision.Probe</a></li>
<li> <a href="../2 classes/Flow.Level.html">Flow.Level</a></li>
<li> <a href="../2 classes/Flow.Settings.html">Flow.Settings</a></li>
<li> <a href="../2 classes/Flow.Statistics.html">Flow.Statistics</a></li>
<li> <a href="../2 classes/Objects.AIObject.html">Objects.AIObject</a></li>
<li> <a href="../2 classes/Objects.Camera.html">Objects.Camera</a></li>
<li> <a href="../2 classes/Objects.LaraObject.html">Objects.LaraObject</a></li>
<li> <a href="../2 classes/Objects.Moveable.html">Objects.Moveable</a></li>
<li> <a href="../2 classes/Objects.Room.html">Objects.Room</a></li>
<li> <a href="../2 classes/Objects.Sink.html">Objects.Sink</a></li>
<li> <a href="../2 classes/Objects.SoundSource.html">Objects.SoundSource</a></li>
<li> <a href="../2 classes/Objects.Static.html">Objects.Static</a></li>
<li> <a href="../2 classes/Objects.Volume.html">Objects.Volume</a></li>
<li> <a href="../2 classes/Strings.DisplayString.html">Strings.DisplayString</a></li>
<li> <a href="../2 classes/View.DisplaySprite.html">View.DisplaySprite</a></li>
</ul>
<h2>3 Primitive Classes</h2>
<ul class="nowrap">
<li> <a href="../3 primitive classes/Flow.Fog.html">Flow.Fog</a></li>
<li> <a href="../3 primitive classes/Flow.InventoryItem.html">Flow.InventoryItem</a></li>
<li> <a href="../3 primitive classes/Flow.LensFlare.html">Flow.LensFlare</a></li>
<li> <a href="../3 primitive classes/Flow.SkyLayer.html">Flow.SkyLayer</a></li>
<li> <a href="../3 primitive classes/Flow.Starfield.html">Flow.Starfield</a></li>
<li> <a href="../3 primitive classes/Color.html">Color</a></li>
<li> <a href="../3 primitive classes/Rotation.html">Rotation</a></li>
<li> <a href="../3 primitive classes/Time.html">Time</a></li>
<li> <a href="../3 primitive classes/Vec2.html">Vec2</a></li>
<li> <a href="../3 primitive classes/Vec3.html">Vec3</a></li>
</ul>
<h2>4 Enums</h2>
<ul class="nowrap">
<li> <a href="../4 enums/Collision.MaterialType.html">Collision.MaterialType</a></li>
<li> <a href="../4 enums/Effects.BlendID.html">Effects.BlendID</a></li>
<li> <a href="../4 enums/Effects.EffectID.html">Effects.EffectID</a></li>
<li> <here>Effects.FeatherMode</here></li>
<li> <a href="../4 enums/Flow.ErrorMode.html">Flow.ErrorMode</a></li>
<li> <a href="../4 enums/Flow.FreezeMode.html">Flow.FreezeMode</a></li>
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</a></li>
<li> <a href="../4 enums/Input.ActionID.html">Input.ActionID</a></li>
<li> <a href="../4 enums/Objects.AmmoType.html">Objects.AmmoType</a></li>
<li> <a href="../4 enums/Objects.HandStatus.html">Objects.HandStatus</a></li>
<li> <a href="../4 enums/Objects.WeaponType.html">Objects.WeaponType</a></li>
<li> <a href="../4 enums/Objects.MoveableStatus.html">Objects.MoveableStatus</a></li>
<li> <a href="../4 enums/Objects.ObjID.html">Objects.ObjID</a></li>
<li> <a href="../4 enums/Objects.RoomFlagID.html">Objects.RoomFlagID</a></li>
<li> <a href="../4 enums/Objects.RoomReverb.html">Objects.RoomReverb</a></li>
<li> <a href="../4 enums/Sound.SoundTrackType.html">Sound.SoundTrackType</a></li>
<li> <a href="../4 enums/Strings.DisplayStringOption.html">Strings.DisplayStringOption</a></li>
<li> <a href="../4 enums/Util.LogLevel.html">Util.LogLevel</a></li>
<li> <a href="../4 enums/View.AlignMode.html">View.AlignMode</a></li>
<li> <a href="../4 enums/View.CameraType.html">View.CameraType</a></li>
<li> <a href="../4 enums/View.PostProcessMode.html">View.PostProcessMode</a></li>
<li> <a href="../4 enums/View.ScaleMode.html">View.ScaleMode</a></li>
</ul>
<h2>5 Lua utility modules</h2>
<ul class="nowrap">
<li> <a href="../5 lua utility modules/Diary.html">Diary</a></li>
<li> <a href="../5 lua utility modules/EventSequence.html">EventSequence</a></li>
<li> <a href="../5 lua utility modules/Timer.html">Timer</a></li>
<li> <a href="../5 lua utility modules/Type.html">Type</a></li>
</ul>
</div>
<div id="content">
<h1>Enum <code>Effects.FeatherMode</code></h1>
<p>Constants for feather modes.</p>
<p>
</p>
<h2><a href="#Tables">Tables</a></h2>
<table class="function_list">
<tr>
<td class="name" ><a href="#Effects.FeatherMode">Effects.FeatherMode</a></td>
<td class="summary">Table of Effects.FeatherMode constants.</td>
</tr>
</table>
<br/>
<br/>
<h2 class="section-header "><a name="Tables"></a>Tables</h2>
<dl class="function">
<dt>
<a name = "Effects.FeatherMode"></a>
<strong>Effects.FeatherMode</strong>
</dt>
<dd>
<p>Table of Effects.FeatherMode constants.
To be used with <a href="../1 modules/Effects.html#EmitStreamer">Effects.EmitStreamer</a> function.</p>
<ul>
<li><code>NONE</code></li>
<li><code>CENTER</code></li>
<li><code>LEFT</code></li>
<li><code>RIGHT</code></li>
</ul>
</dd>
</dl>
</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="https://github.com/hispidence/TEN-LDoc">TEN-LDoc</a> (a fork of <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a>)</i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>

View file

@ -32,7 +32,9 @@ span.types:after { content:")"; }
body, td, th { font-size: .95em; line-height: 1.2em;}
p { line-height: 1.2em;}
p, ul { margin: 10px 0 0 0px;}
ul { margin: 10px 0 0 0px;}
p { margin: 3px 0px 0px 0px; }
strong { font-weight: bold;}
@ -63,6 +65,10 @@ blockquote { margin-left: 3em; }
ul { list-style-type: disc; }
ul li:not(:last-child) {
margin-bottom: 0.3em;
}
p.name {
font-family: "Andale Mono", monospace;
padding-top: 1em;
@ -103,11 +109,11 @@ table.index td { text-align: left; vertical-align: top; }
#main {
background-color: #f0f0f0;
border-left: 2px solid #cccccc;
display: flex
}
#navigation {
float: left;
width: 16em;
width: 18em;
vertical-align: top;
background-color: #f0f0f0;
overflow: visible;
@ -141,7 +147,6 @@ table.index td { text-align: left; vertical-align: top; }
}
#content {
margin-left: 18em;
padding: 2em;
width: 900px;
border-left: 2px solid #cccccc;

View file

@ -73,10 +73,10 @@ namespace TEN::Effects::Streamer
}
}
Streamer::Streamer(StreamerFeatherType featherType, BlendMode blendMode)
Streamer::Streamer(StreamerFeatherMode featherMode, BlendMode blendMode)
{
_segmentSpawnTimeOffset = GlobalCounter % SEGMENT_SPAWN_INTERVAL_TIME;
_featherType = featherType;
_featherMode = featherMode;
_blendMode = blendMode;
}
@ -85,9 +85,9 @@ namespace TEN::Effects::Streamer
return _segments;
}
StreamerFeatherType Streamer::GetFeatherType() const
StreamerFeatherMode Streamer::GetFeatherMode() const
{
return _featherType;
return _featherMode;
}
BlendMode Streamer::GetBlendMode() const
@ -110,7 +110,7 @@ namespace TEN::Effects::Streamer
// Avoid creating "clipped" streamers by clamping max life according to max segment count.
int lifeMax = (int)std::min(round(life * FPS), (float)SEGMENT_COUNT_MAX);
float alpha = (float(segmentCount + SEGMENT_SPAWN_INTERVAL_TIME) / (float)lifeMax) * FADE_IN_COEFF;
float alpha = (float(segmentCount * SEGMENT_SPAWN_INTERVAL_TIME) / (float)lifeMax) * FADE_IN_COEFF;
float opacityMax = EaseInOutSine(colorEnd.w, colorStart.w, alpha);
segment.Orientation = AxisAngle(dir, orient);
@ -165,7 +165,7 @@ namespace TEN::Effects::Streamer
void StreamerGroup::AddStreamer(int tag, const Vector3& pos, const Vector3& dir, short orient, const Color& colorStart, const Color& colorEnd,
float width, float life, float vel, float expRate, short rot,
StreamerFeatherType featherType, BlendMode blendMode)
StreamerFeatherMode featherMode, BlendMode blendMode)
{
TENAssert(_pools.size() <= POOL_COUNT_MAX, "Streamer pool count overflow.");
@ -174,7 +174,7 @@ namespace TEN::Effects::Streamer
return;
// Get and extend streamer iteration.
auto& streamer = GetStreamerIteration(tag, featherType, blendMode);
auto& streamer = GetStreamerIteration(tag, featherMode, blendMode);
streamer.Extend(pos, dir, orient, colorStart, colorEnd, width, life, vel, expRate, rot, (unsigned int)streamer.GetSegments().size());
}
@ -202,7 +202,7 @@ namespace TEN::Effects::Streamer
return pool;
}
Streamer& StreamerGroup::GetStreamerIteration(int tag, StreamerFeatherType featherType, BlendMode blendMode)
Streamer& StreamerGroup::GetStreamerIteration(int tag, StreamerFeatherMode featherMode, BlendMode blendMode)
{
auto& pool = GetPool(tag);
TENAssert(pool.size() <= STREAMER_COUNT_MAX, "Streamer pool size overflow.");
@ -220,7 +220,7 @@ namespace TEN::Effects::Streamer
pool.erase(pool.begin());
// Add and return new streamer iteration.
return pool.emplace_back(Streamer(featherType, blendMode));
return pool.emplace_back(Streamer(featherMode, blendMode));
}
void StreamerGroup::ClearInactivePools()
@ -259,7 +259,7 @@ namespace TEN::Effects::Streamer
void StreamerEffectController::Spawn(int itemNumber, int tag, const Vector3& pos, const Vector3& dir, short orient, const Color& colorStart, const Color& colorEnd,
float width, float life, float vel, float expRate, short rot,
StreamerFeatherType featherType, BlendMode blendMode)
StreamerFeatherMode featherMode, BlendMode blendMode)
{
TENAssert(_groups.size() <= GROUP_COUNT_MAX, "Streamer group count overflow.");
@ -269,7 +269,7 @@ namespace TEN::Effects::Streamer
// Add new or extend existing streamer.
auto& group = GetGroup(itemNumber);
group.AddStreamer(tag, pos, dir, orient, colorStart, colorEnd, width, life, vel, expRate, rot, featherType, blendMode);
group.AddStreamer(tag, pos, dir, orient, colorStart, colorEnd, width, life, vel, expRate, rot, featherMode, blendMode);
}
void StreamerEffectController::Update()

View file

@ -9,7 +9,7 @@ struct ItemInfo;
namespace TEN::Effects::Streamer
{
enum class StreamerFeatherType
enum class StreamerFeatherMode
{
None,
Center,
@ -62,7 +62,7 @@ namespace TEN::Effects::Streamer
std::vector<StreamerSegment> _segments = {};
int _segmentSpawnTimeOffset = 0; // Time in game frames.
StreamerFeatherType _featherType = StreamerFeatherType::None;
StreamerFeatherMode _featherMode = StreamerFeatherMode::None;
BlendMode _blendMode = BlendMode::AlphaBlend;
bool _isBroken = false;
@ -70,12 +70,12 @@ namespace TEN::Effects::Streamer
public:
// Constructors
Streamer(StreamerFeatherType featherType, BlendMode blendMode);
Streamer(StreamerFeatherMode featherMode, BlendMode blendMode);
// Getters
const std::vector<StreamerSegment>& GetSegments() const;
StreamerFeatherType GetFeatherType() const;
StreamerFeatherMode GetFeatherMode() const;
BlendMode GetBlendMode() const;
// Inquirers
@ -116,14 +116,14 @@ namespace TEN::Effects::Streamer
void AddStreamer(int tag, const Vector3& pos, const Vector3& dir, short orient, const Color& colorStart, const Color& colorEnd,
float width, float life, float vel, float expRate, short rot,
StreamerFeatherType featherType, BlendMode blendMode);
StreamerFeatherMode featherMode, BlendMode blendMode);
void Update();
private:
// Helpers
std::vector<Streamer>& GetPool(int tag);
Streamer& GetStreamerIteration(int tag, StreamerFeatherType featherType, BlendMode blendMode);
Streamer& GetStreamerIteration(int tag, StreamerFeatherMode featherMode, BlendMode blendMode);
void ClearInactivePools();
void ClearInactiveStreamers(int tag);
};
@ -149,7 +149,7 @@ namespace TEN::Effects::Streamer
// TODO: Use seconds.
void Spawn(int itemNumber, int tag, const Vector3& pos, const Vector3& dir, short orient, const Color& colorStart, const Color& colorEnd,
float width, float life, float vel, float expRate, short rot,
StreamerFeatherType featherType = StreamerFeatherType::None, BlendMode blendMode = BlendMode::AlphaBlend);
StreamerFeatherMode featherMode = StreamerFeatherMode::None, BlendMode blendMode = BlendMode::AlphaBlend);
void Update();
void Clear();

View file

@ -84,21 +84,21 @@ namespace TEN::Entities::TR4
item.Index, (int)TailTag::First,
pos, dir0, orient2D, colorStart, COLOR_END,
WIDTH, LIFE_MAX, VEL, EXP_RATE, 0,
StreamerFeatherType::Center, BlendMode::Additive);
StreamerFeatherMode::Center, BlendMode::Additive);
// Spawn second tail.
StreamerEffect.Spawn(
item.Index, (int)TailTag::Second,
pos, dir1, orient2D, colorStart, COLOR_END,
WIDTH, LIFE_MAX, VEL, EXP_RATE, 0,
StreamerFeatherType::Center, BlendMode::Additive);
StreamerFeatherMode::Center, BlendMode::Additive);
// Spawn third tail.
StreamerEffect.Spawn(
item.Index, (int)TailTag::Third,
pos, dir2, orient2D, colorStart, COLOR_END,
WIDTH, LIFE_MAX, VEL, EXP_RATE, 0,
StreamerFeatherType::Center, BlendMode::Additive);
StreamerFeatherMode::Center, BlendMode::Additive);
}
static void WraithWallEffect(Vector3i pos, short yRot, int objectNumber)

View file

@ -385,14 +385,14 @@ namespace TEN::Entities::Vehicles
vehicleItem.Index, (int)tagLeft,
positions.first, dir, orient2D, COLOR_START, COLOR_END,
0.0f, life, vel, expRate, 0,
StreamerFeatherType::Right, BlendMode::Additive);
StreamerFeatherMode::Right, BlendMode::Additive);
// Spawn right wake.
StreamerEffect.Spawn(
vehicleItem.Index, (int)tagRight,
positions.second, dir, orient2D, COLOR_START, COLOR_END,
0.0f, life, vel, expRate, 0,
StreamerFeatherType::Left, BlendMode::Additive);
StreamerFeatherMode::Left, BlendMode::Additive);
}
void HandleVehicleSpeedometer(float vel, float velMax)

View file

@ -134,10 +134,10 @@ namespace TEN::Renderer
auto color = Vector4::Lerp(segment.PrevColor, segment.Color, GetInterpolationFactor());
auto prevColor = Vector4::Lerp(prevSegment.PrevColor, prevSegment.Color, GetInterpolationFactor());
switch (streamer.GetFeatherType())
switch (streamer.GetFeatherMode())
{
default:
case StreamerFeatherType::None:
case StreamerFeatherMode::None:
AddColoredQuad(
vertex0, vertex1,
prevVertex1,
@ -149,7 +149,7 @@ namespace TEN::Renderer
streamer.GetBlendMode(), view);
break;
case StreamerFeatherType::Center:
case StreamerFeatherMode::Center:
{
auto center = (vertex0 + vertex1) / 2;
auto prevCenter = (prevVertex0 + prevVertex1) / 2;
@ -165,14 +165,14 @@ namespace TEN::Renderer
}
break;
case StreamerFeatherType::Left:
case StreamerFeatherMode::Left:
AddColoredQuad(
vertex0, vertex1, prevVertex1, prevVertex0,
color, Vector4::Zero, Vector4::Zero, prevColor,
streamer.GetBlendMode(), view);
break;
case StreamerFeatherType::Right:
case StreamerFeatherMode::Right:
AddColoredQuad(
vertex0, vertex1, prevVertex1, prevVertex0,
Vector4::Zero, color, prevColor, Vector4::Zero,

View file

@ -0,0 +1,30 @@
#pragma once
#include "Game/effects/Streamer.h"
/// Constants for feather modes.
// @enum Effects.FeatherMode
// @pragma nostrip
/// Table of Effects.FeatherMode constants.
// To be used with @{Effects.EmitStreamer} function.
//
// - `NONE`
// - `CENTER`
// - `LEFT`
// - `RIGHT`
//
// @table Effects.FeatherMode
using namespace TEN::Effects::Streamer;
namespace TEN::Scripting::Effects
{
static const auto FEATHER_MODES = std::unordered_map<std::string, StreamerFeatherMode>
{
{ "NONE", StreamerFeatherMode::None },
{ "CENTER", StreamerFeatherMode::Center },
{ "LEFT", StreamerFeatherMode::Left },
{ "RIGHT",StreamerFeatherMode::Right}
};
}

View file

@ -883,6 +883,7 @@ if not exist "%ScriptsDir%\Strings.lua" xcopy /Y "$(SolutionDir)Scripts\Strings.
<ClInclude Include="Scripting\Internal\ReservedScriptNames.h" />
<ClInclude Include="Scripting\Internal\ScriptAssert.h" />
<ClInclude Include="Scripting\Internal\ScriptUtil.h" />
<ClInclude Include="Scripting\Internal\TEN\Effects\FeatherModes.h" />
<ClInclude Include="Scripting\Internal\TEN\Effects\ParticleAnimTypes.h" />
<ClInclude Include="Scripting\Internal\TEN\Collision\MaterialTypes.h" />
<ClInclude Include="Scripting\Internal\TEN\Collision\Probe.h" />