Update conventions, formatting, docs

This commit is contained in:
Sezz 2025-02-23 21:59:44 +11:00
parent 1d884a4d62
commit 1715fdb7b0
14 changed files with 205 additions and 101 deletions

View file

@ -437,7 +437,7 @@
</li> </li>
<li><span class="parameter">dir</span> <li><span class="parameter">dir</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span> <span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
direction, or a point to which spotlight should be directed to normal which indicates light direction
</li> </li>
<li><span class="parameter">color</span> <li><span class="parameter">color</span>
<span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span> <span class="types"><a class="type" href="../3 primitive classes/Color.html#">Color</a></span>

View file

@ -166,8 +166,16 @@
<td class="summary">Sets the post-process tint.</td> <td class="summary">Sets the post-process tint.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#PlayFlyBy">PlayFlyBy(flyby)</a></td> <td class="name" ><a href="#PlayFlyby">PlayFlyby(seqID)</a></td>
<td class="summary">Enable FlyBy with specific ID</td> <td class="summary">Play a flyby sequence.</td>
</tr>
<tr>
<td class="name" ><a href="#GetFlybyPosition">GetFlybyPosition(seqID, progress)</a></td>
<td class="summary">Get a flyby sequence's position at a specified progress point in percent.</td>
</tr>
<tr>
<td class="name" ><a href="#GetFlybyRotation">GetFlybyRotation(seqID, progress)</a></td>
<td class="summary">Get a flyby sequence's rotation at a specified progress point in percent.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#ResetObjCamera">ResetObjCamera()</a></td> <td class="name" ><a href="#ResetObjCamera">ResetObjCamera()</a></td>
@ -462,19 +470,19 @@
</dd> </dd>
<dt> <dt>
<a name = "PlayFlyBy"></a> <a name = "PlayFlyby"></a>
<strong>PlayFlyBy(flyby)</strong> <strong>PlayFlyby(seqID)</strong>
</dt> </dt>
<dd> <dd>
Enable FlyBy with specific ID Play a flyby sequence.
<h3>Parameters:</h3> <h3>Parameters:</h3>
<ul> <ul>
<li><span class="parameter">flyby</span> <li><span class="parameter">seqID</span>
<span class="types"><span class="type">short</span></span> <span class="types"><span class="type">int</span></span>
(ID of flyby) Flyby sequence ID.
</li> </li>
</ul> </ul>
@ -482,6 +490,70 @@
</dd>
<dt>
<a name = "GetFlybyPosition"></a>
<strong>GetFlybyPosition(seqID, progress)</strong>
</dt>
<dd>
Get a flyby sequence's position at a specified progress point in percent.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">seqID</span>
<span class="types"><span class="type">int</span></span>
Flyby sequence ID.
</li>
<li><span class="parameter">progress</span>
<span class="types"><span class="type">float</span></span>
Progress point in percent. Clamped to [0, 100].
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Position at the given progress point.
</ol>
</dd>
<dt>
<a name = "GetFlybyRotation"></a>
<strong>GetFlybyRotation(seqID, progress)</strong>
</dt>
<dd>
Get a flyby sequence's rotation at a specified progress point in percent.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">seqID</span>
<span class="types"><span class="type">int</span></span>
Flyby sequence ID.
</li>
<li><span class="parameter">progress</span>
<span class="types"><span class="type">float</span></span>
Progress point in percent. Clamped to [0, 100].
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
Rotation at the given progress point.
</ol>
</dd> </dd>
<dt> <dt>
<a name = "ResetObjCamera"></a> <a name = "ResetObjCamera"></a>

View file

@ -305,7 +305,7 @@
<td class="summary">How should the application respond to script errors?</td> <td class="summary">How should the application respond to script errors?</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#multiThreaded">multiThreaded</a></td> <td class="name" ><a href="#multithreaded">multithreaded</a></td>
<td class="summary">Use multithreading in certain calculations.</td> <td class="summary">Use multithreading in certain calculations.</td>
</tr> </tr>
<tr> <tr>
@ -1259,8 +1259,8 @@
</dd> </dd>
<dt> <dt>
<a name = "multiThreaded"></a> <a name = "multithreaded"></a>
<strong>multiThreaded</strong> <strong>multithreaded</strong>
</dt> </dt>
<dd> <dd>
Use multithreading in certain calculations. <br> Use multithreading in certain calculations. <br>
@ -1270,7 +1270,7 @@
<ul> <ul>
<li><span class="parameter">multiThreaded</span> <li><span class="parameter">multithreaded</span>
<span class="types"><span class="type">bool</span></span> <span class="types"><span class="type">bool</span></span>
determines whether to use multithreading or not. */ determines whether to use multithreading or not. */
</li> </li>

View file

@ -109,7 +109,7 @@
<div id="content"> <div id="content">
<h1>Primitive Class <code>Rotation</code></h1> <h1>Primitive Class <code>Rotation</code></h1>
<p>Represents a degree-based 3D rotation.</p> <p>Represents a 3D rotation.</p>
<p> All angle components are in degrees clamped to the range [0.0, 360.0].</p> <p> All angle components are in degrees clamped to the range [0.0, 360.0].</p>
@ -135,6 +135,10 @@
<td class="summary">Create a Rotation object.</td> <td class="summary">Create a Rotation object.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="#Lerp">Lerp(rot, alpha)</a></td>
<td class="summary">Get the linearly interpolated Rotation between this Rotation and the input Rotation according to the input alpha.</td>
</tr>
<tr>
<td class="name" ><a href="#Direction">Direction()</a></td> <td class="name" ><a href="#Direction">Direction()</a></td>
<td class="summary">Get the normalized direction vector of this Rotation.</td> <td class="summary">Get the normalized direction vector of this Rotation.</td>
</tr> </tr>
@ -237,6 +241,38 @@
</dd>
<dt>
<a name = "Lerp"></a>
<strong>Lerp(rot, alpha)</strong>
</dt>
<dd>
Get the linearly interpolated Rotation between this Rotation and the input Rotation according to the input alpha.
<h3>Parameters:</h3>
<ul>
<li><span class="parameter">rot</span>
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
Interpolation target.
</li>
<li><span class="parameter">alpha</span>
<span class="types"><span class="type">float</span></span>
Interpolation alpha in the range [0, 1].
</li>
</ul>
<h3>Returns:</h3>
<ol>
<span class="types"><a class="type" href="../3 primitive classes/Rotation.html#">Rotation</a></span>
Linearly interpolated rotation.
</ol>
</dd> </dd>
<dt> <dt>
<a name = "Direction"></a> <a name = "Direction"></a>

View file

@ -469,7 +469,7 @@
<ul> <ul>
<li><span class="parameter">vector</span> <li><span class="parameter">vector</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span> <span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
Target interpolation vector. Interpolation target.
</li> </li>
<li><span class="parameter">alpha</span> <li><span class="parameter">alpha</span>
<span class="types"><span class="type">float</span></span> <span class="types"><span class="type">float</span></span>
@ -481,7 +481,7 @@
<ol> <ol>
<span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span> <span class="types"><a class="type" href="../3 primitive classes/Vec2.html#">Vec2</a></span>
Linearly interpolated vector Linearly interpolated vector.
</ol> </ol>

View file

@ -464,7 +464,7 @@
<ul> <ul>
<li><span class="parameter">vector</span> <li><span class="parameter">vector</span>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span> <span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Target interpolation vector. Interpolation target.
</li> </li>
<li><span class="parameter">alpha</span> <li><span class="parameter">alpha</span>
<span class="types"><span class="type">float</span></span> <span class="types"><span class="type">float</span></span>
@ -476,7 +476,7 @@
<ol> <ol>
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span> <span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
Linearly interpolated vector Linearly interpolated vector.
</ol> </ol>

View file

@ -98,6 +98,7 @@
</ul> </ul>
<h2>5 Lua utility modules</h2> <h2>5 Lua utility modules</h2>
<ul class="nowrap"> <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/EventSequence.html">EventSequence</a></li>
<li> <a href="../5 lua utility modules/Timer.html">Timer</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> <li> <a href="../5 lua utility modules/Type.html">Type</a></li>

View file

@ -82,6 +82,7 @@
<li> <a href="../4 enums/Flow.GameStatus.html">Flow.GameStatus</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/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.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.WeaponType.html">Objects.WeaponType</a></li>
<li> <a href="../4 enums/Objects.MoveableStatus.html">Objects.MoveableStatus</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.ObjID.html">Objects.ObjID</a></li>

View file

@ -227,7 +227,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a number, false if it isn't a number <em>true</em> if the variable is a number, <em>false</em> otherwise
</ol> </ol>
@ -263,7 +263,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a string, false if it isn't a string <em>true</em> if the variable is a string, <em>false</em> otherwise
</ol> </ol>
@ -299,7 +299,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a boolean, false if it isn't a boolean <em>true</em> if the variable is a boolean, <em>false</em> otherwise
</ol> </ol>
@ -338,7 +338,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a table, false if it isn't a table <em>true</em> if the variable is a table, <em>false</em> otherwise
</ol> </ol>
@ -377,7 +377,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a null, false if it isn't a null <em>true</em> if the variable is a null, <em>false</em> otherwise
</ol> </ol>
@ -416,7 +416,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a function, false if it isn't a function <em>true</em> if the variable is a function, <em>false</em> otherwise
</ol> </ol>
@ -453,7 +453,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a color, false if it isn't a color <em>true</em> if the variable is a Color, <em>false</em> otherwise
</ol> </ol>
@ -490,7 +490,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a rotation, false if it isn't a rotation <em>true</em> if the variable is a Rotation, <em>false</em> otherwise
</ol> </ol>
@ -527,7 +527,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a vec2, false if it isn't a vec2 <em>true</em> if the variable is a Vec2, <em>false</em> otherwise
</ol> </ol>
@ -564,7 +564,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a vec3, false if it isn't a vec3 <em>true</em> if the variable is a Vec3, <em>false</em> otherwise
</ol> </ol>
@ -601,7 +601,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a Time object, false if it isn't a Time object <em>true</em> if the variable is a Time object, <em>false</em> otherwise
</ol> </ol>
@ -638,7 +638,7 @@ LevelFuncs.AddProp = <span class="keyword">function</span> (prop)
<ol> <ol>
<span class="types"><span class="type">boolean</span></span> <span class="types"><span class="type">boolean</span></span>
true if the variable is a LevelFunc, false if it isn't a IsLevelFunc <em>true</em> if the variable is a LevelFunc, <em>false</em> otherwise
</ol> </ol>

View file

@ -261,7 +261,7 @@ local door = GetMoveableByName("door_type4_14")
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="3 primitive classes/Rotation.html">Rotation</a></td> <td class="name" ><a href="3 primitive classes/Rotation.html">Rotation</a></td>
<td class="summary">Represents a degree-based 3D rotation.</td> <td class="summary">Represents a 3D rotation.</td>
</tr> </tr>
<tr> <tr>
<td class="name" ><a href="3 primitive classes/Time.html">Time</a></td> <td class="name" ><a href="3 primitive classes/Time.html">Time</a></td>

View file

@ -823,6 +823,7 @@ void CalculateSpotCameras()
} }
// Core's version. Proper decompilation by ChocolateFan // Core's version. Proper decompilation by ChocolateFan
// TODO: Replace with float-based version.
int Spline(int x, int* knots, int nk) int Spline(int x, int* knots, int nk)
{ {
int span = x * (nk - 3) >> 16; int span = x * (nk - 3) >> 16;
@ -838,58 +839,51 @@ int Spline(int x, int* knots, int nk)
return ((__int64)x * (((__int64)x * (((__int64)x * c1 >> 16) + c2) >> 16) + (k[2] >> 1) + ((-k[0] - 1) >> 1)) >> 16) + k[1]; return ((__int64)x * (((__int64)x * (((__int64)x * c1 >> 16) + c2) >> 16) + (k[2] >> 1) + ((-k[0] - 1) >> 1)) >> 16) + k[1];
} }
Pose GetCameraTransform(int sequence, float progress) Pose GetCameraTransform(int sequence, float alpha)
{ {
progress = std::clamp(progress, 0.0f, 1.0f); alpha = std::clamp(alpha, 0.0f, 1.0f);
// Retrieve total number of cameras in the sequence. // Retrieve camera count in sequence.
int totalCameras = CameraCnt[SpotCamRemap[sequence]]; int cameraCount = CameraCnt[SpotCamRemap[sequence]];
if (totalCameras < 2) if (cameraCount < 2)
return Pose::Zero; // Not enough cameras to interpolate. return Pose::Zero; // Not enough cameras to interpolate.
// Find the starting index for the sequence. // Find first ID for sequence.
int firstIndex = 0; int firstSeqID = 0;
for (int i = 0; i < SpotCamRemap[sequence]; i++) for (int i = 0; i < SpotCamRemap[sequence]; i++)
firstIndex += CameraCnt[i]; firstSeqID += CameraCnt[i];
// Determine number of spline points and spline position. // Determine number of spline points and spline position.
int splinePoints = totalCameras + 2; int splinePoints = cameraCount + 2;
int splinePosition = (int)(progress * (float)USHRT_MAX); int splineAlpha = int(alpha * (float)USHRT_MAX);
std::vector<int> posX, posY, posZ, tarX, tarY, tarZ, roll;
// Extract camera properties into separate vectors for interpolation. // Extract camera properties into separate vectors for interpolation.
for (int i = -1; i < totalCameras + 1; i++) std::vector<int> xOrigins, yOrigins, zOrigins, xTargets, yTargets, zTargets, rolls;
for (int i = -1; i < (cameraCount + 1); i++)
{ {
int idx = std::clamp(firstIndex + i, firstIndex, firstIndex + totalCameras - 1); int seqID = std::clamp(firstSeqID + i, firstSeqID, (firstSeqID + cameraCount) - 1);
posX.push_back(SpotCam[idx].x); xOrigins.push_back(SpotCam[seqID].x);
posY.push_back(SpotCam[idx].y); yOrigins.push_back(SpotCam[seqID].y);
posZ.push_back(SpotCam[idx].z); zOrigins.push_back(SpotCam[seqID].z);
tarX.push_back(SpotCam[idx].tx); xTargets.push_back(SpotCam[seqID].tx);
tarY.push_back(SpotCam[idx].ty); yTargets.push_back(SpotCam[seqID].ty);
tarZ.push_back(SpotCam[idx].tz); zTargets.push_back(SpotCam[seqID].tz);
roll.push_back(SpotCam[idx].roll); rolls.push_back(SpotCam[seqID].roll);
} }
// Compute spline interpolation of main flyby camera parameters. // Compute spline interpolation of main flyby camera parameters.
auto origin = Vector3(Spline(splineAlpha, xOrigins.data(), splinePoints),
Spline(splineAlpha, yOrigins.data(), splinePoints),
Spline(splineAlpha, zOrigins.data(), splinePoints));
auto position = Vector3(Spline(splinePosition, posX.data(), splinePoints), auto target = Vector3(Spline(splineAlpha, xTargets.data(), splinePoints),
Spline(splinePosition, posY.data(), splinePoints), Spline(splineAlpha, yTargets.data(), splinePoints),
Spline(splinePosition, posZ.data(), splinePoints)); Spline(splineAlpha, zTargets.data(), splinePoints));
auto target = Vector3(Spline(splinePosition, tarX.data(), splinePoints), short orientZ = Spline(splineAlpha, rolls.data(), splinePoints);
Spline(splinePosition, tarY.data(), splinePoints),
Spline(splinePosition, tarZ.data(), splinePoints));
short orientZ = Spline(splinePosition, roll.data(), splinePoints); auto pose = Pose(origin, EulerAngles(target - origin));
pose.Orientation.z = orientZ;
Pose result; return pose;
result.Position = position;
result.Orientation = EulerAngles(target - position);
result.Orientation.z = orientZ;
return result;
} }

View file

@ -63,4 +63,5 @@ void InitializeSpotCamSequences(bool startFirstSequence);
void InitializeSpotCam(short sequence); void InitializeSpotCam(short sequence);
void CalculateSpotCameras(); void CalculateSpotCameras();
int Spline(int x, int* knots, int nk); int Spline(int x, int* knots, int nk);
Pose GetCameraTransform(int sequence, float progress);
Pose GetCameraTransform(int sequence, float alpha);

View file

@ -347,9 +347,9 @@ static constexpr char ScriptReserved_KeyClearAll[] = "KeyClearAll";
static constexpr char ScriptReserved_FlipMap[] = "FlipMap"; static constexpr char ScriptReserved_FlipMap[] = "FlipMap";
static constexpr char ScriptReserved_GetFlipMapStatus[] = "GetFlipMapStatus"; static constexpr char ScriptReserved_GetFlipMapStatus[] = "GetFlipMapStatus";
static constexpr char ScriptReserved_PlayFlyBy[] = "PlayFlyBy"; static constexpr char ScriptReserved_PlayFlyby[] = "PlayFlyby";
static constexpr char ScriptReserved_GetFlyByPosition[] = "GetFlyByPosition"; static constexpr char ScriptReserved_GetFlybyPosition[] = "GetFlybyPosition";
static constexpr char ScriptReserved_GetFlyByRotation[] = "GetFlyByRotation"; static constexpr char ScriptReserved_GetFlybyRotation[] = "GetFlybyRotation";
static constexpr char ScriptReserved_PlayCamera[] = "PlayCamera"; static constexpr char ScriptReserved_PlayCamera[] = "PlayCamera";
static constexpr char ScriptReserved_ResetObjCamera[] = "ResetObjCamera"; static constexpr char ScriptReserved_ResetObjCamera[] = "ResetObjCamera";

View file

@ -105,28 +105,24 @@ namespace TEN::Scripting::View
ObjCamera(LaraItem, 0, LaraItem, 0, false); ObjCamera(LaraItem, 0, LaraItem, 0, false);
} }
static void PlayFlyBy(short flyby) static void PlayFlyby(int seqID)
{ {
UseSpotCam = true; UseSpotCam = true;
InitializeSpotCam(flyby); InitializeSpotCam(seqID);
} }
static Vec3 GetFlyByPosition(short flyby, float progress) static Vec3 GetFlybyPosition(int seqID, float progress)
{ {
auto& result = GetCameraTransform(flyby, progress / 100.0f); constexpr auto PROGRESS_MAX = 100.0f;
return Vec3(result.Position);
return Vec3(GetCameraTransform(seqID, progress / PROGRESS_MAX).Position);
} }
static Rotation GetFlyByRotation(short flyby, float progress) static Rotation GetFlybyRotation(int seqID, float progress)
{ {
auto& result = GetCameraTransform(flyby, progress / 100.0f); constexpr auto PROGRESS_MAX = 100.0f;
return return Rotation(GetCameraTransform(seqID, progress / PROGRESS_MAX).Orientation);
{
TO_DEGREES(result.Orientation.x),
TO_DEGREES(result.Orientation.y),
TO_DEGREES(result.Orientation.z)
};
} }
static void FlashScreen(TypeOrNil<ScriptColor> col, TypeOrNil<float> speed) static void FlashScreen(TypeOrNil<ScriptColor> col, TypeOrNil<float> speed)
@ -239,24 +235,24 @@ namespace TEN::Scripting::View
//@tparam Color tint value to use. //@tparam Color tint value to use.
tableView.set_function(ScriptReserved_SetPostProcessTint, &SetPostProcessTint); tableView.set_function(ScriptReserved_SetPostProcessTint, &SetPostProcessTint);
///Play flyby sequence with specific ID /// Play a flyby sequence.
//@function PlayFlyBy // @function PlayFlyby
//@tparam short flyby (ID of flyby) // @tparam int seqID Flyby sequence ID.
tableView.set_function(ScriptReserved_PlayFlyBy, &PlayFlyBy); tableView.set_function(ScriptReserved_PlayFlyby, &PlayFlyby);
///Get flyby sequence's position at a specified point in time /// Get a flyby sequence's position at a specified progress point in percent.
//@function GetFlyByPosition // @function GetFlybyPosition
//@tparam short flyby (ID of flyby) // @tparam int seqID Flyby sequence ID.
//@tparam float time point in time of a flyby in percent. Clamped to [0, 100]. // @tparam float progress Progress point in percent. Clamped to [0, 100].
//@treturn Vec3 flyby position at a specified point in time // @treturn Vec3 Position at the given progress point.
tableView.set_function(ScriptReserved_GetFlyByPosition, &GetFlyByPosition); tableView.set_function(ScriptReserved_GetFlybyPosition, &GetFlybyPosition);
///Get flyby sequence's rotation at a specified point in time /// Get a flyby sequence's rotation at a specified progress point in percent.
//@function GetFlyByRotation // @function GetFlybyRotation
//@tparam short flyby (ID of flyby) // @tparam int seqID Flyby sequence ID.
//@tparam float time point in time of a flyby in percent. Clamped to [0, 100]. // @tparam float progress Progress point in percent. Clamped to [0, 100].
//@treturn Rotation flyby rotation at a specified point in time // @treturn Rotation Rotation at the given progress point.
tableView.set_function(ScriptReserved_GetFlyByRotation, &GetFlyByRotation); tableView.set_function(ScriptReserved_GetFlybyRotation, &GetFlybyRotation);
/// Reset object camera back to Lara and deactivate object camera. /// Reset object camera back to Lara and deactivate object camera.
//@function ResetObjCamera //@function ResetObjCamera
@ -273,6 +269,9 @@ namespace TEN::Scripting::View
// @treturn float Display resolution's aspect ratio. // @treturn float Display resolution's aspect ratio.
tableView.set_function(ScriptReserved_GetAspectRatio, &GetAspectRatio); tableView.set_function(ScriptReserved_GetAspectRatio, &GetAspectRatio);
// COMPATIBILITY
tableView.set_function("PlayFlyBy", &PlayFlyby);
// Register types. // Register types.
ScriptDisplaySprite::Register(*state, parent); ScriptDisplaySprite::Register(*state, parent);