crude player physics & collision response

This commit is contained in:
2024-08-16 00:27:35 +10:00
parent 60ced3691d
commit 6b92b538a5
6 changed files with 206 additions and 34 deletions

View File

@ -350,10 +350,10 @@ public class Renderer {
matrix_float4x4(instance.rotation) *
.scale(instance.scale),
color: .init(
UInt8(instance.color.x * 0xFF),
UInt8(instance.color.y * 0xFF),
UInt8(instance.color.z * 0xFF),
UInt8(instance.color.w * 0xFF)))
UInt8(truncating: NSNumber(value: instance.color.x * 0xFF)),
UInt8(truncating: NSNumber(value: instance.color.y * 0xFF)),
UInt8(truncating: NSNumber(value: instance.color.z * 0xFF)),
UInt8(truncating: NSNumber(value: instance.color.w * 0xFF))))
}
// Ideal as long as our uniforms total 4 KB or less