Skip to content

Instantly share code, notes, and snippets.

@Lightnet
Lightnet / README.md
Created April 25, 2025 21:00
raylib c simple physics 3d test.

Simple physics collision 3d.

Raylib 5.5

W,A,S,D = movement. Space = jump.

Notes:

  • landing will off sets bug.
@Lightnet
Lightnet / raylib_collision3d.c
Last active April 25, 2025 17:37
refine physics collision but wall lag too many collisions. raylib.
#define WIN32_LEAN_AND_MEAN
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#define NOGDI
#define NOUSER
#define MMNOSOUND
#include "raylib.h"
#include "raymath.h"
#include <stdio.h>
#include <stdlib.h>
@Lightnet
Lightnet / README.md
Last active April 24, 2025 21:55
c raylib collision3d test
@Lightnet
Lightnet / flecs_test.c
Created April 19, 2025 06:14
flecs_test.c
// parent
// https://www.flecs.dev/flecs/md_docs_2Relationships.html#iterate-all-children-for-a-parent
//
#include "flecs.h"
int main(){
// Initialize Flecs world
ecs_world_t *world = ecs_init();
ecs_entity_t parent = ecs_entity(world, {.name = "Parent"});
@Lightnet
Lightnet / server.js
Created April 15, 2025 15:11
very simple server throttle download file. Limit to 50 KiB/s
/*
Credits:
* https://github.com/juliangruber/stream
* https://gist.github.com/4poc/1454516
*/
import http from 'http';
import path from 'path';
import fs from 'fs';
import mime from 'mime';
@Lightnet
Lightnet / raylib_simple_collision.c
Created April 3, 2025 04:18
very simple collision with the help of AI model. raylib 5.5
#define WIN32_LEAN_AND_MEAN
#define _WINSOCK_DEPRECATED_NO_WARNINGS
#define NOGDI
#define NOUSER
#define MMNOSOUND
#include "raylib.h"
#include "raymath.h"
// Object entity structure
@Lightnet
Lightnet / CMakeLists.txt
Created March 26, 2025 06:13
raylib flecs render ode test
cmake_minimum_required(VERSION 3.14)
project(raylib_luajit LANGUAGES C CXX)
# Set up cache directory for built artifacts
set(CACHE_DIR "${CMAKE_BINARY_DIR}/cache")
file(MAKE_DIRECTORY ${CACHE_DIR})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/cmake/CPM.cmake")
file(DOWNLOAD
"https://github.com/cpm-cmake/CPM.cmake/releases/latest/download/CPM.cmake"
@Lightnet
Lightnet / README.md
Created March 24, 2025 23:58
Test raylib3d flecs transform hierarchy

Information:

This simple test build to make transform hierarchy node or system.

Red is parent Blue is child.

controls:

tab = for toggle position. W,A,S,D = movement Q,W,E,A,S,D = rotate

@Lightnet
Lightnet / CMakeLists.txt
Last active February 28, 2025 00:05
Grok3 SDL3 Vulkan CMake build. Most simple triangle test. Pure C Language. VS2022
cmake_minimum_required(VERSION 3.20)
project(VulkanSDL3Project C)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_COMPILER "")
set(CMAKE_CXX_FOUND FALSE)
include(FetchContent)