mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
Merge branch 'MihailRis:main' into main
This commit is contained in:
commit
55c7308495
5 changed files with 56 additions and 5 deletions
2
.github/workflows/windows.yml
vendored
2
.github/workflows/windows.yml
vendored
|
|
@ -12,7 +12,7 @@ jobs:
|
|||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- os: windows-latest
|
||||
- os: windows-2022
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,22 @@
|
|||
"VOXELENGINE_BUILD_TESTS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "default-ninja-mingw-windows",
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
},
|
||||
"generator": "Ninja Multi-Config",
|
||||
"binaryDir": "${sourceDir}/build-mingw",
|
||||
"cacheVariables": {
|
||||
"CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake",
|
||||
"VCPKG_HOST_TRIPLET": "x64-mingw-static",
|
||||
"VCPKG_TARGET_TRIPLET": "x64-mingw-static",
|
||||
"VOXELENGINE_BUILD_TESTS": "ON"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "default-ninja-gnu-linux",
|
||||
"condition": {
|
||||
|
|
@ -60,6 +76,11 @@
|
|||
"configurePreset": "default-vs-msvc-windows",
|
||||
"configuration": "Debug"
|
||||
},
|
||||
{
|
||||
"name": "default-ninja-mingw-windows",
|
||||
"configurePreset": "default-ninja-mingw-windows",
|
||||
"configuration": "Debug"
|
||||
},
|
||||
{
|
||||
"name": "default-ninja-gnu-linux",
|
||||
"configurePreset": "default-ninja-gnu-linux",
|
||||
|
|
|
|||
20
README.md
20
README.md
|
|
@ -152,6 +152,26 @@ cmake --build --preset default-vs-msvc-windows
|
|||
> [!NOTE]
|
||||
> Make sure your `CMakeUserPresets.json` (if used) contains the correct `VCPKG_ROOT` path.
|
||||
|
||||
---
|
||||
### Building with CLion (MinGW / Ninja)
|
||||
|
||||
> [!NOTE]
|
||||
> Requirements: **vcpkg**, **Git**, and **CLion** (bundled with CMake, Ninja and MinGW toolchain).
|
||||
|
||||
> [!WARNING]
|
||||
> Avoid installing tools in paths with spaces (e.g. `Program Files`).
|
||||
> This may break MinGW builds (especially `windres`).
|
||||
|
||||
Install **vcpkg** manually as described in the Visual Studio section.
|
||||
|
||||
|
||||
#### Configure CLion
|
||||
Open the project in CLion and configure CMake profile:
|
||||
```text
|
||||
Settings → Build, Execution, Deployment → CMake
|
||||
```
|
||||
Reload CMake project and build the engine.
|
||||
|
||||
---
|
||||
|
||||
## Build using Docker
|
||||
|
|
|
|||
|
|
@ -37,6 +37,14 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/"
|
||||
)
|
||||
else()
|
||||
set(LUAJIT_PACKAGE_DIR "$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}")
|
||||
|
||||
if(EXISTS "$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit-2.1")
|
||||
set(LUAJIT_INCLUDE_DIR "$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit-2.1")
|
||||
else()
|
||||
set(LUAJIT_INCLUDE_DIR "$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit")
|
||||
endif()
|
||||
|
||||
add_library(luajit SHARED IMPORTED)
|
||||
set_target_properties(
|
||||
luajit
|
||||
|
|
@ -45,8 +53,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
|||
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/bin/lua51.dll"
|
||||
IMPORTED_IMPLIB
|
||||
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/lib/lua51.lib"
|
||||
INTERFACE_INCLUDE_DIRECTORIES
|
||||
"$ENV{VCPKG_ROOT}/packages/luajit_${VCPKG_TARGET_TRIPLET}/include/luajit"
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${LUAJIT_INCLUDE_DIR}"
|
||||
)
|
||||
endif()
|
||||
|
||||
|
|
|
|||
|
|
@ -151,7 +151,10 @@ bool PhysicsSolver::calcCollisionNegY(
|
|||
continue;
|
||||
}
|
||||
auto aabb = AABB(pos - half, pos + half);
|
||||
aabb.scale(glm::vec3(1.0f - E * 4.0f, 1.0f - E * 2, 1.0f - E * 4.0f));
|
||||
glm::vec3 scale(1.0f);
|
||||
scale.x = 1.0f - E * 4.0f;
|
||||
scale.z = 1.0f - E * 4.0f;
|
||||
aabb.scale(scale);
|
||||
|
||||
auto boxhalf = box->getHalfSize();
|
||||
if (box->position.y < pos.y && box->getAABB().intersects(aabb)) {
|
||||
|
|
@ -241,7 +244,7 @@ void PhysicsSolver::calcCollisions(
|
|||
float x = (pos.x - half.x + E) + ix;
|
||||
for (int iz = 0; iz <= glm::ceil((half.z - E) * 2); iz++) {
|
||||
float z = (pos.z - half.z + E) + iz;
|
||||
float y = (pos.y + half.y + E) + 0.5f;
|
||||
float y = (pos.y + half.y + E) - E;
|
||||
if (auto aabb = chunks.isObstacleAt(x, y, z, boxAABB)) {
|
||||
float newy = std::floor(y) - half.y + aabb->min().y - E;
|
||||
if (pos.y >= newy) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue