mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-28 15:57:59 +03:00
Add GetCameraPosition and GetCameraTarget lua functions
This commit is contained in:
parent
bbee2abc67
commit
c921c0dd62
4 changed files with 25 additions and 1 deletions
|
@ -31,7 +31,7 @@ Version 1.3
|
|||
Lua API changes:
|
||||
* Add Lara:GetInteractedMoveable() which returns currently interacted moveable by Lara.
|
||||
* Add Moveable:SetStatus() to set the current status of the moveable.
|
||||
* Add View:GetCameraRoom() to get a room where camera is currently placed.
|
||||
* Add View:GetCameraPosition(), View:GetCameraTarget() and View:GetCameraRoom() functions.
|
||||
|
||||
Version 1.2
|
||||
===========
|
||||
|
|
|
@ -296,6 +296,8 @@ static constexpr char ScriptReserved_SetFOV[] = "SetFOV";
|
|||
static constexpr char ScriptReserved_GetFOV[] = "GetFOV";
|
||||
static constexpr char ScriptReserved_GetCameraType[] = "GetCameraType";
|
||||
static constexpr char ScriptReserved_GetCameraRoom[] = "GetCameraRoom";
|
||||
static constexpr char ScriptReserved_GetCameraPosition[] = "GetCameraPosition";
|
||||
static constexpr char ScriptReserved_GetCameraTarget[] = "GetCameraTarget";
|
||||
|
||||
static constexpr char ScriptReserved_KeyIsHeld[] = "KeyIsHeld";
|
||||
static constexpr char ScriptReserved_KeyIsHit[] = "KeyIsHit";
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include "Scripting/Internal/TEN/Color/Color.h"
|
||||
#include "Scripting/Internal/TEN/DisplaySprite/ScriptDisplaySprite.h"
|
||||
#include "Scripting/Internal/TEN/Objects/Room/RoomObject.h"
|
||||
#include "Scripting/Internal/TEN/Vec3/Vec3.h"
|
||||
#include "Scripting/Internal/TEN/View/AlignModes.h"
|
||||
#include "Scripting/Internal/TEN/View/CameraTypes.h"
|
||||
#include "Scripting/Internal/TEN/View/ScaleModes.h"
|
||||
|
@ -69,6 +70,16 @@ namespace TEN::Scripting::View
|
|||
return Camera.oldType;
|
||||
}
|
||||
|
||||
static Vec3 GetCameraPosition()
|
||||
{
|
||||
return Vec3(Camera.pos.ToVector3());
|
||||
}
|
||||
|
||||
static Vec3 GetCameraTarget()
|
||||
{
|
||||
return Vec3(Camera.target.ToVector3());
|
||||
}
|
||||
|
||||
static std::unique_ptr<Room> GetCameraRoom()
|
||||
{
|
||||
return std::make_unique<Room>(g_Level.Rooms[Camera.pos.RoomNumber]);
|
||||
|
@ -150,6 +161,16 @@ namespace TEN::Scripting::View
|
|||
//@function GetCameraRoom
|
||||
//@treturn Objects.Room current room of the camera
|
||||
tableView.set_function(ScriptReserved_GetCameraRoom, &GetCameraRoom);
|
||||
|
||||
///Gets current camera position.
|
||||
//@function GetCameraPosition
|
||||
//@treturn Vec3 current camera position
|
||||
tableView.set_function(ScriptReserved_GetCameraPosition, &GetCameraPosition);
|
||||
|
||||
///Gets current camera target.
|
||||
//@function GetCameraTarget
|
||||
//@treturn Vec3 current camera target
|
||||
tableView.set_function(ScriptReserved_GetCameraTarget, &GetCameraTarget);
|
||||
|
||||
///Enable FlyBy with specific ID
|
||||
//@function PlayFlyBy
|
||||
|
|
|
@ -751,6 +751,7 @@ xcopy /Y "$(SolutionDir)Libs\zlib\x64\*.dll" "$(TargetDir)"</Command>
|
|||
<ClInclude Include="Scripting\Internal\TEN\Objects\Lara\AmmoTypes.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\Lara\LaraObject.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\Moveable\MoveableObject.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\Moveable\MoveableStatuses.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\NamedBase.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\ObjectIDs.h" />
|
||||
<ClInclude Include="Scripting\Internal\TEN\Objects\ObjectsHandler.h" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue