Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Luau #1474

Closed
wants to merge 10 commits into from
Closed

Luau #1474

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: build
on: [push]
jobs:
windows:
runs-on: windows-2019
runs-on: windows-2022
steps:
- uses: actions/checkout@v1
with:
Expand All @@ -14,23 +14,23 @@ jobs:
pushd ..\plugins
git.exe clone https://github.com/nem0/lumixengine_dx11.git dx11
popd
./genie.exe vs2019
./genie.exe vs2022
- name: build dx11 engine
working-directory: projects
shell: cmd
run: |
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2022/LumixEngine.sln /p:Configuration=RelWithDebInfo
- name: make dx12 project
working-directory: projects
run: |
pushd ..\plugins
popd
./genie.exe --dx12 vs2019
./genie.exe --dx12 vs2022
- name: build dx12 engine
working-directory: projects
shell: cmd
run: |
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2022/LumixEngine.sln /p:Configuration=RelWithDebInfo
- name: fetch maps plugin
working-directory: plugins
run: |
Expand All @@ -43,10 +43,6 @@ jobs:
working-directory: plugins
run: |
git.exe clone https://github.com/nem0/lumixengine_shader_editor.git shader_editor
- name: fetch rml plugin
working-directory: plugins
run: |
git.exe clone https://github.com/nem0/lumixengine_rml.git rml
- name: fetch network plugin
working-directory: plugins
run: |
Expand Down Expand Up @@ -74,12 +70,12 @@ jobs:
- name: make gl project with plugins
working-directory: projects
run: |
./genie.exe --nodx --with-app vs2019
./genie.exe --nodx --with-app vs2022
- name: build gl engine with plugins
working-directory: projects
shell: cmd
run: |
"C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2019/LumixEngine.sln /p:Configuration=RelWithDebInfo
"C:/Program Files/Microsoft Visual Studio/2022/Enterprise/MSBuild/Current/Bin/MSBuild.exe" tmp/vs2022/LumixEngine.sln /p:Configuration=RelWithDebInfo
linux:
runs-on: ubuntu-20.04
steps:
Expand All @@ -100,12 +96,16 @@ jobs:
run: |
cd projects
mkdir -p ../external/freetype/lib/linux64_gmake/release
mkdir -p ../external/luajit/lib/linux64_gmake/release
mkdir -p ../external/luau/lib/linux64_gmake
mkdir -p ../external/physx/lib/linux64_gmake/release
mkdir -p ../external/recast/lib/linux64_gmake/release
git clone --depth=1 https://github.com/nem0/lumixengine_linux_3rdparty_bin.git
git clone --depth=1 https://github.com/nem0/luau.git
pushd luau/
make config=release luau
popd
cp lumixengine_linux_3rdparty_bin/freetype/* ../external/freetype/lib/linux64_gmake/release
cp lumixengine_linux_3rdparty_bin/luajit/* ../external/luajit/lib/linux64_gmake/release
cp luau/build/release/*.a ../external/luau/lib/linux64_gmake
cp lumixengine_linux_3rdparty_bin/physx/* ../external/physx/lib/linux64_gmake/release
cp lumixengine_linux_3rdparty_bin/recast/* ../external/recast/lib/linux64_gmake/release
- name: build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Who is using it?

3rd party libraries

* [LuaJIT](https://github.com/LuaJIT/LuaJIT/)
* [Luau](https://github.com/Roblox/luau)
* [rgbcx](https://github.com/richgel999/bc7enc/blob/master/rgbcx.h)
* [PhysX](https://developer.nvidia.com/physx-sdk)
* [dear imgui](https://github.com/ocornut/imgui)
Expand Down
180 changes: 0 additions & 180 deletions data/scripts/editor_main.lua

This file was deleted.

16 changes: 16 additions & 0 deletions data/scripts/main_button.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local loaded = false
function onInputEvent(event)
if not loaded and event.type == LumixAPI.INPUT_EVENT_BUTTON then
if event.device.type == LumixAPI.INPUT_DEVICE_KEYBOARD then
local old_partition = this.world:getActivePartition()
local demo = this.world:createPartition("demo")
this.world:setActivePartition(demo)
this.world:load("demo", function()
--this.world:destroyPartition(old_partition)
end)

loaded = true
this.gui_rect.enabled = false
end
end
end
20 changes: 11 additions & 9 deletions data/scripts/math.lua
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
function mulquat(a, b)
return {
mulquat = function(a, b)
return {
a[4] * b[1] + b[4] * a[1] + a[2] * b[3] - b[2] * a[3],
a[4] * b[2] + b[4] * a[2] + a[3] * b[1] - b[3] * a[1],
a[4] * b[3] + b[4] * a[3] + a[1] * b[2] - b[1] * a[2],
a[4] * b[4] - a[1] * b[1] - a[2] * b[2] - a[3] * b[3]
}
end
end,

function makeQuatFromYaw(yaw)
makeQuatFromYaw = function(yaw)
local syaw = math.sin(yaw * 0.5)
local cyaw = math.cos(yaw * 0.5)
return {0, syaw, 0, cyaw }
end
end,

function makeQuatFromPitch(pitch)
makeQuatFromPitch = function(pitch)
local spitch = math.sin(pitch * 0.5)
local cpitch = math.cos(pitch * 0.5)
return {-spitch, 0, 0, cpitch}
end
end,

function yawToDir(yaw)
yawToDir = function(yaw)
return {math.sin(yaw), 0, math.cos(yaw)}
end
end,

function mulVec3Num(v, f)
mulVec3Num = function(v, f)
return {v[1] * f, v[2] * f, v[3] * f}
end
}
10 changes: 5 additions & 5 deletions data/scripts/player.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "scripts/math"
local math = require "scripts/math"

local forward = 0
local backward = 0
Expand Down Expand Up @@ -77,7 +77,7 @@ end

function onControllerHit(obj)
local a = obj.rigid_actor
local force = mulVec3Num(yawToDir(yaw), 50)
local force = math.mulVec3Num(math.yawToDir(yaw), 50)
a:applyForce(force)
end

Expand Down Expand Up @@ -127,8 +127,8 @@ function update(td)
this.animator:setBoolInput(crouched_input_idx, crouched)
this.animator:setBoolInput(falling_input_idx, gravity_speed < -4)
this.animator:setBoolInput(aiming_input_idx, aiming)
local yaw_rot = makeQuatFromYaw(yaw)
local pitch_rot = makeQuatFromPitch(pitch)
local yaw_rot = math.makeQuatFromYaw(yaw)
local pitch_rot = math.makeQuatFromPitch(pitch)
this.rotation = yaw_rot
camera_pivot.rotation = mulquat(yaw_rot, pitch_rot)
camera_pivot.rotation = math.mulquat(yaw_rot, pitch_rot)
end
Binary file added data/universes/main.unv
Binary file not shown.
Loading