Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
152 commits
Select commit Hold shift + click to select a range
c5cccfe
Hole and ball feel improvements
damacaa Aug 27, 2025
0efb0bc
Remove OpenGL debug in release
damacaa Aug 29, 2025
6982f1c
Tweaks
damacaa Aug 29, 2025
c3ba238
Merge branch 'main' into feature/tuning-for-first-game
damacaa Oct 2, 2025
de1c31b
Update Simulation2D.cpp
damacaa Oct 2, 2025
f10cb00
Improving 2d renderer
damacaa Oct 4, 2025
8e1b5ba
New lighting model
damacaa Oct 8, 2025
5110029
Updated penalty push
damacaa Oct 8, 2025
4ad866a
Update 2DLightingShader.frag
damacaa Oct 8, 2025
ac22238
Update 2DLightingShader.frag
damacaa Oct 9, 2025
1a962cb
Distance correction inside shapes
damacaa Oct 10, 2025
e5e9bf1
Remove aa since it's no longer needed
damacaa Oct 10, 2025
b8787d0
Improved performance of jump flooding
damacaa Oct 10, 2025
0c7d349
Clean up
damacaa Oct 10, 2025
dfecae2
Correct depth outside or inside
damacaa Oct 11, 2025
7e71920
Fixed physics engine performance issue
damacaa Oct 11, 2025
1ecc447
Comment
damacaa Oct 11, 2025
2966674
Sleep less
damacaa Oct 11, 2025
4e7cd92
Transparent materials
damacaa Oct 11, 2025
c87fdf6
Smooth substraction and physics raymarch
damacaa Oct 11, 2025
ec81449
Extra lighting details
damacaa Oct 11, 2025
1d29f00
Comments
damacaa Oct 12, 2025
8897ae5
Removed old "soft shadows"
damacaa Oct 12, 2025
938f49e
Add library and sample file
damacaa Oct 12, 2025
1c0ab00
WIP integration test
damacaa Oct 12, 2025
749011f
Correct outside distance
damacaa Oct 12, 2025
05c8e11
Fixed compilation error on windows
damacaa Oct 12, 2025
e30d266
It works if run from file explorer instead of clion
damacaa Oct 12, 2025
eb53f8e
Merge branch 'feature/tuning-for-first-game' into feature/adding-mini…
damacaa Oct 12, 2025
015fa01
Checking drivers before initialization
damacaa Oct 14, 2025
2f24ec3
Refactor: Separate Renderer components
google-labs-jules[bot] Oct 14, 2025
505fd43
Update SDLInitializer.cpp
damacaa Oct 14, 2025
e445f3a
Less broken
damacaa Oct 14, 2025
bbb2ddb
Fix: Correct member initialization order in Renderer
google-labs-jules[bot] Oct 14, 2025
dd13a76
Revert "Fix: Correct member initialization order in Renderer"
damacaa Oct 14, 2025
9adf9a8
Update SDLInitializer.cpp
damacaa Oct 14, 2025
fea306e
Fixed black screen
damacaa Oct 14, 2025
8fae5ff
Avoid u_time optimization
damacaa Oct 15, 2025
7f40a16
Update ShapesCombinations.h
damacaa Oct 15, 2025
2d96aa5
Add manual sine wave and noise
damacaa Oct 15, 2025
35a3402
MVP audio engine
damacaa Oct 15, 2025
8b54970
Merge pull request #32 from damacaa/refactor-renderer
damacaa Oct 15, 2025
6fbfdc3
Added friction sounds and also improved friction calculation
damacaa Oct 15, 2025
ce765e3
Fixed NaN
damacaa Oct 15, 2025
f03856e
Adjusted volumes
damacaa Oct 15, 2025
c269c35
More tweaks
damacaa Oct 15, 2025
35fde27
Audio and physics improvements
damacaa Oct 16, 2025
643559a
[WIP] Gemini gave a few functions to control amplitude better
damacaa Oct 16, 2025
e60d220
Moved audio logic to audio class (smart)
damacaa Oct 16, 2025
100f9dd
Update AudioEngine.cpp
damacaa Oct 17, 2025
d75dcd8
Pink noise sounds better
damacaa Oct 20, 2025
c5d65e4
[WIP] Sound ditance falloff
damacaa Oct 20, 2025
1fdd5fa
WIP Adding collision sounds
damacaa Oct 21, 2025
908cf49
Less collisions
damacaa Oct 21, 2025
ba7fa26
Improved friction sound and remove unused options
damacaa Oct 29, 2025
44b2ddc
Speed
damacaa Oct 29, 2025
9b16cbc
[WIP] Scene handles shape collisions
damacaa Oct 29, 2025
4304af4
Collision sounds
damacaa Oct 29, 2025
d65ad73
Colors
damacaa Oct 29, 2025
f9bb456
Merge pull request #33 from damacaa/feature/adding-miniaudio
damacaa Oct 29, 2025
ca627aa
Fix empty project
damacaa Oct 29, 2025
2692017
Statically link MinGW runtime in game executable
damacaa Oct 30, 2025
be39911
Update .gitignore
damacaa Oct 30, 2025
dd8f9a9
Test shaders
damacaa Oct 30, 2025
7bde6ba
Stop scaling distance inside shapes
damacaa Oct 30, 2025
3fb4358
Disabled distance correction because it messes with distance samples …
damacaa Oct 30, 2025
5b68ebf
If you want to interpolate data do it manually, texture save to disk …
damacaa Oct 30, 2025
c8f9db3
Cleaning up
damacaa Oct 31, 2025
03492d1
[WIP] Organizing files
damacaa Nov 4, 2025
ce9a347
[WIP] Trying a method to improve motion blur
damacaa Nov 6, 2025
4ea4ac4
Fixed camera motion compensation for motion blur
damacaa Nov 7, 2025
012a3b3
Update 2DSDFDistanceShader.frag
damacaa Nov 7, 2025
6c59d3c
Cleaning up sample scenes
damacaa Nov 7, 2025
fdcfe39
Delta time motion blur
damacaa Nov 7, 2025
ea28897
Fix vsync
damacaa Nov 7, 2025
0877eeb
Same material motion trail
damacaa Nov 7, 2025
2a0e43d
Fixed motion blur compensation with different aspect ratio
damacaa Nov 7, 2025
30d4e3b
Shader include system and default shapes moved to a new file
damacaa Nov 9, 2025
a7041f6
More info on collisions
damacaa Nov 9, 2025
d37393f
Update 2DSDFDistanceShader.frag
damacaa Nov 9, 2025
2ccbfbc
Split shape collision detection and resolution and call events properly
damacaa Nov 10, 2025
0566e60
Cleaning up physics
damacaa Nov 10, 2025
ac977ba
Actual tweaks
damacaa Nov 11, 2025
5ace841
Improving API and fixing samples
damacaa Nov 12, 2025
a0101cf
Motion blur consistent with different zoom levels
damacaa Nov 12, 2025
42dc51d
Removed and fixed some sample scenes
damacaa Nov 12, 2025
8b9333e
Distance upscaling
damacaa Nov 12, 2025
54af438
Wrong texture size
damacaa Nov 13, 2025
10de478
"Fixed race condition"
damacaa Nov 16, 2025
00a1a0a
Improving collisions
damacaa Nov 19, 2025
e10fda5
Merge branch 'feature/tuning-for-first-game' of https://github.com/da…
damacaa Nov 19, 2025
76bf4c8
Fixed sample scenes
damacaa Nov 20, 2025
6453581
Simple dynamic shader define system
damacaa Nov 20, 2025
93a1a89
Upscale now takes advantage of default texture filtering to save a fe…
damacaa Nov 20, 2025
7a9c17f
Antialiasing
damacaa Nov 20, 2025
62f41fb
Fixed collision bug
damacaa Nov 24, 2025
e84a19d
Improved ramp as an example
damacaa Nov 24, 2025
91d95bc
Enable/disable sdf fix
damacaa Nov 25, 2025
9869f86
Update 2DLightingShader.frag
damacaa Nov 25, 2025
68d1310
Toggle dithering
damacaa Nov 28, 2025
81ad2e9
Separate light and shadows
damacaa Nov 28, 2025
2ebdad1
Soft shadows!
damacaa Nov 28, 2025
c5d529d
Basic light
damacaa Nov 28, 2025
2d0a6b2
More controls
damacaa Nov 28, 2025
905fad1
Merge branch 'feature/tuning-for-first-game' into feature/2d-aa
damacaa Nov 28, 2025
0d9f692
Constant light edge size
damacaa Dec 1, 2025
cf878a9
Update 2DDistanceCorrection.frag
damacaa Dec 4, 2025
6cb307f
Limit shadow raymarch outside of frame
damacaa Dec 4, 2025
fe8bb97
Slightly reduced artifacts by improving blending between original and…
damacaa Dec 5, 2025
d7e17b3
Changed threshold
damacaa Dec 5, 2025
53a0b75
Use two distance textures for different purposes
damacaa Dec 6, 2025
4a93276
Fixed
damacaa Dec 6, 2025
9418af6
Simplified correction and increased steps to reduce artifacts
damacaa Dec 6, 2025
983ffcb
Automatic viewport adjustment
damacaa Dec 6, 2025
c4368da
Merge branch 'feature/tuning-for-first-game' into feature/2d-aa
damacaa Dec 6, 2025
ea0ba75
Fix old style uniforms
damacaa Dec 6, 2025
ae29cba
Merge branch 'feature/tuning-for-first-game' into feature/2d-aa
damacaa Dec 6, 2025
058b139
Merge branch 'feature/2d-aa' into feature/separate-shape-and-shadow-t…
damacaa Dec 6, 2025
d35f4f5
Tweaks to improve shadows at low resolution
damacaa Dec 6, 2025
4b43b05
Smooth lighting
damacaa Dec 6, 2025
0f60cc1
Dont check collisions when simulation is paused
damacaa Dec 6, 2025
e16b1cd
Update 2DLightingShader.frag
damacaa Dec 6, 2025
f9c32c4
Update Renderer.cpp
damacaa Dec 6, 2025
9eafab0
[WIP] Building UI using same distance shader
damacaa Dec 6, 2025
0fd1b7f
Screen coordinates
damacaa Dec 7, 2025
97fd022
Fix color texture contructor
damacaa Dec 7, 2025
44a305a
Fixed wrong type
damacaa Dec 10, 2025
bbf9949
UI Dot component and render system is now templated to allow normal a…
damacaa Dec 10, 2025
36391f3
fixed issues on windows
damacaa Dec 10, 2025
2fa0e9c
Added UI shapes
damacaa Dec 10, 2025
54e32bb
Update CMakeLists.txt
damacaa Dec 11, 2025
e1560bc
UI cleanup
damacaa Dec 11, 2025
7efecd4
Revert to old collision check
damacaa Dec 11, 2025
326b333
[WIP] Fixing shape groups
damacaa Dec 12, 2025
8578a4d
Liquid glass effect
damacaa Dec 19, 2025
a133b80
Various small changes and improvements
damacaa Dec 19, 2025
2fdba84
[WIP] UI materials
damacaa Dec 19, 2025
1a16b97
Removed some artifacts
damacaa Dec 19, 2025
7f68f15
Update 2DLightingShader.frag
damacaa Dec 21, 2025
537c858
Antialiasing refraction sample
damacaa Dec 22, 2025
90d13d5
[WIP] Text component
damacaa Dec 22, 2025
31b529b
[WIP] Text
damacaa Dec 23, 2025
3223852
Cooler text
damacaa Dec 23, 2025
797e00a
Fixed negative delta time in renderer
damacaa Dec 23, 2025
9eca879
Imprving text and fixed motion blur bug
damacaa Dec 24, 2025
cf886a7
Update ShapesCombinations.h
damacaa Dec 25, 2025
14f9f3a
Merge pull request #34 from damacaa/feature/ui
damacaa Dec 25, 2025
105079b
Fixed GLSL issue with amd drivers
damacaa Dec 26, 2025
2189abf
SDL3 changed to static link and build option
damacaa Dec 26, 2025
8878b18
Fonts path
damacaa Dec 27, 2025
153c5a9
Standalone build
damacaa Dec 27, 2025
15d5eb4
I don't need DLL's anymore (for now)
damacaa Dec 27, 2025
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ bld/
.vscode/
[Bb]uild/

# Ignore CLion build/temporary directories
cmake-build*/

# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
Expand Down
29 changes: 26 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ message(STATUS "WeirdEngine path: ${CMAKE_CURRENT_SOURCE_DIR}")

set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")

file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.frag")
file(GLOB_RECURSE SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.vert" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.frag" "${CMAKE_CURRENT_SOURCE_DIR}/src/*.glsl")
file(GLOB_RECURSE HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/include/*.hpp")

add_library(${PROJECT_NAME} STATIC ${SOURCES} ${HEADERS})
Expand All @@ -31,6 +31,11 @@ target_include_directories(glad


# SDL3 setup
# FORCE SDL3 to build as a STATIC library.
# This prevents the creation of libSDL3.so and embeds the code
# directly into your engine/game.
set(SDL_SHARED OFF CACHE BOOL "Build SDL shared library" FORCE)
set(SDL_STATIC ON CACHE BOOL "Build SDL static library" FORCE)
# Add dependencies
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/third-party/SDL)
# add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/third-party/SDL_image)
Expand Down Expand Up @@ -68,11 +73,29 @@ target_link_libraries(${PROJECT_NAME} PUBLIC SDL3::SDL3)


# Shaders
option(WEIRD_ENGINE_USE_RUNTIME_ASSETS
"Load shaders/assets from runtime folder instead of source tree"
OFF
)

if (WEIRD_ENGINE_USE_RUNTIME_ASSETS)
set(WEIRD_ENGINE_FONTS_PATH "./fonts/")
set(WEIRD_ENGINE_SHADERS_PATH "./shaders/")
else()
set(WEIRD_ENGINE_FONTS_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/src/weird-renderer/fonts/"
)
set(WEIRD_ENGINE_SHADERS_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/src/weird-renderer/shaders/"
)
endif()

target_compile_definitions(${PROJECT_NAME} PUBLIC
ENGINE_PATH="${CMAKE_CURRENT_SOURCE_DIR}"
SHADERS_PATH="${CMAKE_CURRENT_SOURCE_DIR}/src/weird-renderer/shaders/"
FONTS_PATH="${WEIRD_ENGINE_FONTS_PATH}"
SHADERS_PATH="${WEIRD_ENGINE_SHADERS_PATH}"
)


#
set_target_properties(${PROJECT_NAME} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/lib
Expand Down
4 changes: 4 additions & 0 deletions examples/empty-project/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ message(STATUS "Assets path: ${ASSETS_PATH}")
# Use the variable in target_compile_definitions
target_compile_definitions(${PROJECT_NAME} PUBLIC ASSETS_PATH="${ASSETS_PATH}")

if (MINGW)
target_link_options(${PROJECT_NAME} PRIVATE -static -static-libgcc -static-libstdc++)
endif()

# ----------------------------------------------------------
# Helper function to assign source groups based on folder structure.
function(assign_source_groups TARGET)
Expand Down
14 changes: 7 additions & 7 deletions examples/empty-project/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class EmptyScene : public Scene
private:
void onStart() override
{
m_renderMode = RenderMode::RayMarching2D;
}

void onUpdate() override
{
}

void onRender() override
{
}
void onUpdate(float delta) override{}
void onCreate() override{}
void onRender(WeirdRenderer::RenderTarget& renderTarget) override{}
void onCollision(WeirdEngine::CollisionEvent& event) override{}
void onShapeCollision(WeirdEngine::ShapeCollisionEvent& event) override{}
void onDestroy() override{}
};

int main()
Expand Down
84 changes: 58 additions & 26 deletions examples/sample-scenes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,30 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

# Option to switch between local and online version of WeirdEngine
option(USE_LOCAL_WEIRD_ENGINE "Use local version of WeirdEngine" ON)

# Set paths for the local WeirdEngine
set(WEIRD_ENGINE_LOCAL_PATH "../../")

# Option to build for standalone deployment
option(DEPLOY_STANDALONE "Configure paths and copy assets for a standalone distribution" ON)

if(DEPLOY_STANDALONE)
message(STATUS ">> DEPLOY MODE: Assets will be copied to output. Paths set to relative.")
# Force the engine to expect runtime assets
set(WEIRD_ENGINE_USE_RUNTIME_ASSETS ON CACHE BOOL "" FORCE)
else()
message(STATUS ">> DEV MODE: Assets read directly from source folder.")
endif()

# -------------------------------------------------------------------------
# INCLUDE ENGINE & CAPTURE SOURCE PATH
# -------------------------------------------------------------------------
if(USE_LOCAL_WEIRD_ENGINE)
# Use the local version of WeirdEngine
message(STATUS "Using local version of WeirdEngine")
add_subdirectory(${WEIRD_ENGINE_LOCAL_PATH} ${CMAKE_BINARY_DIR}/weird-engine)

# Resolve the local path to an absolute path for copying files later
get_filename_component(WEIRD_ENGINE_REAL_SOURCE "${WEIRD_ENGINE_LOCAL_PATH}" ABSOLUTE)
else()
# Fetch WeirdEngine from GitHub
message(STATUS "Using online version of WeirdEngine")
Expand All @@ -29,6 +45,9 @@ else()
GIT_TAG main
)
FetchContent_MakeAvailable(WeirdEngine)

# FetchContent defines <name>_SOURCE_DIR (usually lowercase)
set(WEIRD_ENGINE_REAL_SOURCE "${weirdengine_SOURCE_DIR}")
endif()

# Glob source files and header files from the proper directories.
Expand All @@ -54,48 +73,61 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(${PROJECT_NAME} PRIVATE WeirdEngine)

# Set Asset Path Macro
# Define the assets path variable
set(ASSETS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/assets/")
# set(ASSETS_PATH "./assets") # Set the asset path macro in release mode to a relative path that assumes the assets folder is in the same directory as the game executable

# Print the assets path for debugging or confirmation
message(STATUS "Assets path: ${ASSETS_PATH}")
if(DEPLOY_STANDALONE)
set(ASSETS_PATH "./assets/")
else()
set(ASSETS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/assets/")
endif()

# Use the variable in target_compile_definitions
message(STATUS "Assets path: ${ASSETS_PATH}")
target_compile_definitions(${PROJECT_NAME} PUBLIC ASSETS_PATH="${ASSETS_PATH}")

# Example for the future with more libraries
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
# Command for SDL3
COMMAND ${CMAKE_COMMAND} -E copy_if_different
$<TARGET_FILE:SDL3::SDL3>
$<TARGET_FILE_DIR:${PROJECT_NAME}>
if (MINGW)
target_link_options(${PROJECT_NAME} PRIVATE -static -static-libgcc -static-libstdc++)
endif()

# Command for SDL3_image
# -------------------------------------------------------------------------
# POST BUILD COMMANDS (DLLs + Assets + Fonts + Shaders)
# -------------------------------------------------------------------------
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
# 1. Copy DLLs (SDL3)
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
# $<TARGET_FILE:SDL3_image::SDL3_image> #<-- Note the target name might be different
# $<TARGET_FILE_DIR:${PROJECT_NAME}>

COMMENT "Copying runtime DLLs to executable directory"
# $<TARGET_FILE:SDL3::SDL3>
# $<TARGET_FILE_DIR:${PROJECT_NAME}>

# 2. Copy Project ASSETS folder -> Build/assets
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_SOURCE_DIR}/assets"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/assets"

# 3. Copy WeirdEngine FONTS -> Build/fonts
# We look into the captured WEIRD_ENGINE_REAL_SOURCE/src/weird-renderer/fonts
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${WEIRD_ENGINE_REAL_SOURCE}/src/weird-renderer/fonts"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/fonts"

# 4. Copy WeirdEngine SHADERS -> Build/shaders
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${WEIRD_ENGINE_REAL_SOURCE}/src/weird-renderer/shaders"
"$<TARGET_FILE_DIR:${PROJECT_NAME}>/shaders"

COMMENT "Copying Runtime DLLs, Game Assets, Engine Fonts, and Engine Shaders"
)

# ----------------------------------------------------------
# Helper function to assign source groups based on folder structure.
# -------------------------------------------------------------------------
# SOURCE GROUPS
# -------------------------------------------------------------------------
function(assign_source_groups TARGET)
foreach(source_file IN LISTS ARGN)
# Get the full path to the file's directory.
get_filename_component(FILE_PATH "${source_file}" PATH)
# Compute the path relative to the project's root.
file(RELATIVE_PATH REL_PATH "${CMAKE_SOURCE_DIR}" "${FILE_PATH}")
# Replace forward slashes with backslashes for Visual Studio filter naming.
string(REPLACE "/" "\\" FILTER_PATH "${REL_PATH}")
if(FILTER_PATH STREQUAL "")
set(FILTER_PATH "Root")
endif()
# Assign the file to the computed filter.
source_group("${FILTER_PATH}" FILES "${source_file}")
endforeach()
endfunction()

# Assign source groups for all your files.
assign_source_groups(${PROJECT_NAME} ${WEIRDGAME_SOURCES} ${WEIRDGAME_HEADERS} ${WEIRDGAME_ASSETS})
assign_source_groups(${PROJECT_NAME} ${WEIRDGAME_SOURCES} ${WEIRDGAME_HEADERS} ${WEIRDGAME_ASSETS})
50 changes: 0 additions & 50 deletions examples/sample-scenes/include/ApparentCircularMotionScene.h

This file was deleted.

2 changes: 2 additions & 0 deletions examples/sample-scenes/include/Classic.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ class ClassicScene : public Scene

m_ball = entity;
}

m_ecs.getComponent<Transform>(m_mainCamera).position = vec3(0,2,10);
}

void onUpdate(float delta) override
Expand Down
10 changes: 7 additions & 3 deletions examples/sample-scenes/include/CollisionHandling.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <weird-engine.h>
#include <random>

#include "globals.h"

using namespace WeirdEngine;
class CollisionHandlingScene : public Scene
{
Expand Down Expand Up @@ -39,23 +41,25 @@ class CollisionHandlingScene : public Scene
// Floor
{
float variables[8]{0.5f, 1.5f, -1.0f};
addShape(0, variables, 3);
addShape(DefaultShapes::SINE, variables, 3);
}

// Wall right
{
float variables[8]{30 + 5, 0, 5.0f, 30.0f, 0.0f};
addShape(m_sdfs.size() - 1, variables, 3);
addShape(DefaultShapes::BOX, variables, 3);
}

// Wall left
{
float variables[8]{-5, 0, 5.0f, 30.0f, 0.0f};
addShape(m_sdfs.size() - 1, variables, 3);
addShape(DefaultShapes::BOX, variables, 3);
}

m_ecs.getComponent<FlyMovement2D>(m_mainCamera).targetPosition = vec3(15.0f, 15.0f, 10.0f);
m_ecs.getComponent<Transform>(m_mainCamera).position = vec3(15.0f, 15.0f, 10.0f);

m_ecs.getComponent<Transform>(m_mainCamera).position = g_cameraPositon;
}

void onUpdate(float delta) override
Expand Down
6 changes: 5 additions & 1 deletion examples/sample-scenes/include/DestroyScene.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

#include <weird-engine.h>

#include "globals.h"

using namespace WeirdEngine;
class DestroyScene : public Scene
{
Expand Down Expand Up @@ -73,7 +75,9 @@ class DestroyScene : public Scene
{
{
float variables[8]{ 0.0f, 0.0f };
addShape(0, variables, 3);
addShape(DefaultShapes::SINE, variables, 3);
}

m_ecs.getComponent<Transform>(m_mainCamera).position = g_cameraPositon;
}
};
3 changes: 2 additions & 1 deletion examples/sample-scenes/include/Fire.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <weird-engine.h>
#include "weird-renderer/Debug.h"

using namespace WeirdEngine;
class FireScene : public Scene
Expand Down Expand Up @@ -469,7 +470,7 @@ class FireSceneRayMarching : public FireScene

Transform& cameraTransform = m_ecs.getComponent<Transform>(m_mainCamera);

cameraTransform.position = vec3(0.0f, 1.0f, 10.0f);
cameraTransform.position = vec3(0.0f, 2.0f, 10.0f);
cameraTransform.rotation = vec3(0.0f, 0.0f, -1.0f);
}
};
Loading