Skip to content

Instantly share code, notes, and snippets.

{
"CarChoices": [],
"IncludeOutputSettingsInProfile": false,
"UnmuteEffectsAfterSimhubRestart": true,
"EffectsContainers": [
{
"ContainerType": "JumpContainer",
"IsEnabled": true,
"Gain": 100.0,
"Description": "Provides localized feedback for jump landings",
@dreasgrech
dreasgrech / CarManager.lua
Created November 2, 2025 13:17
A hotfix for Assetto Corsa Realistic Trackday 0.9.1 for older CSP version which didn't yet have ac.getCarMaxSpeedWithGear. Replace file: assettocorsa\apps\lua\AssettoCorsaRealisticTrackday\CarManager.lua
local CarManager = {}
-- Andreas: used while still writing the accident system
local DISABLE_ACCIDENTCOLLISION_DETECTION = true
local CAR_SPEEDS_BUFFER_SIZE = 600
---@type table<integer,boolean>
CarManager.cars_initialized = {}
---@type table<integer,number>
@dreasgrech
dreasgrech / ResolvingMatterCollisionsInPhaser3.js
Last active September 26, 2023 09:14
Resolving collisions using Matter physics with Phaser 3 in constant O(1) time
/*
This code shows how to resolve collisions using Matter physics with Phaser 3 in constant O(1) time.
Going through all the collision pairs is still linear O(n) time depending on how many collisions happened this frame
but the code that handles the resolution of the collision is constant and will not change with the total number of CollisionCategories / collision-lookups.
The way the code works is by generating a number based on the each of the collision combinations, use that number as a key for storing a pointer to the respective collision handler function,
and then when a collision happens, calculate the number again of both bodies' collision categories and use that number to fetch the collision handler function. Simple.
// dreasgrech - https://github.com/dreasgrech/
*/