mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Expose wind (#1465)
* Expose wind * Update EffectsFunctions.cpp --------- Co-authored-by: Sezz <sezzary@outlook.com>
This commit is contained in:
parent
2d0d13c620
commit
db68eeaca3
4 changed files with 41 additions and 0 deletions
|
@ -47,6 +47,8 @@ TombEngine releases are located in this repository (alongside with Tomb Editor):
|
|||
* Fixed incorrect behaviour of Logic.EnableEvent() and Logic.DisableEvent() functions.
|
||||
* Fixed collision callbacks not properly clearing after leveljump.
|
||||
|
||||
* Added Effects.GetWind() function.
|
||||
|
||||
## [Version 1.5](https://github.com/TombEngine/TombEditorReleases/releases/tag/v1.7.2) - 2024-11-03
|
||||
|
||||
### Bug fixes
|
||||
|
|
|
@ -143,6 +143,10 @@
|
|||
<td class="name" ><a href="#MakeEarthquake">MakeEarthquake(strength)</a></td>
|
||||
<td class="summary">Make an earthquake</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="name" ><a href="#GetWind">GetWind()</a></td>
|
||||
<td class="summary">Get the current wind for the current frame.</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<br/>
|
||||
|
@ -498,6 +502,28 @@
|
|||
|
||||
|
||||
|
||||
</dd>
|
||||
<dt>
|
||||
<a name = "GetWind"></a>
|
||||
<strong>GetWind()</strong>
|
||||
</dt>
|
||||
<dd>
|
||||
Get the current wind for the current frame.
|
||||
This represents the 3D displacement applied by the engine on things like particles affected by wind.
|
||||
|
||||
|
||||
|
||||
|
||||
<h3>Returns:</h3>
|
||||
<ol>
|
||||
|
||||
<span class="types"><a class="type" href="../3 primitive classes/Vec3.html#">Vec3</a></span>
|
||||
The wind.
|
||||
</ol>
|
||||
|
||||
|
||||
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
|
|
@ -301,6 +301,7 @@ static constexpr char ScriptReserved_EmitBlood[] = "EmitBlood";
|
|||
static constexpr char ScriptReserved_EmitFire[] = "EmitFire";
|
||||
static constexpr char ScriptReserved_MakeExplosion[] = "MakeExplosion";
|
||||
static constexpr char ScriptReserved_MakeEarthquake[] = "MakeEarthquake";
|
||||
static constexpr char ScriptReserved_GetWind[] = "GetWind";
|
||||
static constexpr char ScriptReserved_Vibrate[] = "Vibrate";
|
||||
static constexpr char ScriptReserved_FlashScreen[] = "FlashScreen";
|
||||
static constexpr char ScriptReserved_FadeIn[] = "FadeIn";
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
#include "Game/effects/explosion.h"
|
||||
#include "Game/effects/spark.h"
|
||||
#include "Game/effects/tomb4fx.h"
|
||||
#include "Game/effects/weather.h"
|
||||
#include "Game/Setup.h"
|
||||
#include "Objects/Utils/object_helper.h"
|
||||
#include "Scripting/Internal/LuaHandler.h"
|
||||
|
@ -31,6 +32,7 @@ Functions to generate effects.
|
|||
|
||||
using namespace TEN::Effects::DisplaySprite;
|
||||
using namespace TEN::Effects::Electricity;
|
||||
using namespace TEN::Effects::Environment;
|
||||
using namespace TEN::Effects::Explosion;
|
||||
using namespace TEN::Effects::Spark;
|
||||
|
||||
|
@ -308,6 +310,15 @@ namespace TEN::Scripting::Effects
|
|||
Camera.bounce = -str;
|
||||
}
|
||||
|
||||
/// Get the wind vector for the current game frame.
|
||||
// This represents the 3D displacement applied by the engine on things like particles affected by wind.
|
||||
// @function GetWind()
|
||||
// @treturn Vec3 Wind vector.
|
||||
static Vec3 GetWind()
|
||||
{
|
||||
return Vec3(Weather.Wind());
|
||||
}
|
||||
|
||||
void Register(sol::state* state, sol::table& parent)
|
||||
{
|
||||
auto tableEffects = sol::table(state->lua_state(), sol::create);
|
||||
|
@ -321,6 +332,7 @@ namespace TEN::Scripting::Effects
|
|||
tableEffects.set_function(ScriptReserved_MakeExplosion, &MakeExplosion);
|
||||
tableEffects.set_function(ScriptReserved_EmitFire, &EmitFire);
|
||||
tableEffects.set_function(ScriptReserved_MakeEarthquake, &Earthquake);
|
||||
tableEffects.set_function(ScriptReserved_GetWind, &GetWind);
|
||||
|
||||
auto handler = LuaHandler{ state };
|
||||
handler.MakeReadOnlyTable(tableEffects, ScriptReserved_BlendID, BLEND_IDS);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue