Skip to content

Instantly share code, notes, and snippets.

View iszn11's full-sized avatar

iszn11

  • Wrocław
  • 09:23 (UTC +02:00)
View GitHub Profile
@iszn11
iszn11 / SceneViewXZFlight.cs
Created April 26, 2020 21:03
Proof of concept. Put in Editor folder and toggle in menu (Tools/Toggle XZ flight).
using UnityEditor;
using UnityEngine;
[InitializeOnLoad]
public static class SceneViewXZFlight
{
private static readonly float SlowSpeed = 0.5f;
private static readonly float FastSpeed = 2.0f;
private static bool movingCamera = false;
@iszn11
iszn11 / image.zig
Last active August 4, 2021 10:39
PNG decoder based on stb_image.h implementation.
const std = @import("std");
const ArrayList = std.ArrayList;
const Allocator = std.mem.Allocator;
// PNG decoder based on stb_image.h implementation, including zlib decompressor. A bit more zig-friendly than original. Compared to
// stb_image.h:
// - only decodes from a slice (filename or callbacks not supported)
// - only decodes to 8-bit channels (any other bit depth is converted, no decoding to 16-bit or float samples)
// - requires an allocator (zig style)
// - doesn't support interlaced images
import * as t from "io-ts";
export type Accessor = { componentType: ComponentType, count: number, type: AccessorType, bufferView?: number, byteOffset?: number, normalized?: boolean, max?: number[], min?: number[], sparse?: AccessorSparse, extensions?: Extensions, extras?: unknown };
export type AccessorSparse = { count: number, indices: AccessorSparseIndices, values: AccessorSparseValues, extensions?: Extensions, extras?: unknown };
export type AccessorSparseIndices = { bufferView: number, componentType: IndexComponentType, byteOffset?: number, extensions?: Extensions, extras?: unknown };
export type AccessorSparseValues = { bufferView: number, byteOffset?: number, extensions?: Extensions, extras?: unknown };
export type Animation = { channels: AnimationChannel[], samplers: AnimationSampler[], name?: string, extensions?: Extensions, extras?: unknown };
export type AnimationChannel = { sampler: number, target: AnimationChannelTarget, extensions?: Extensions, extras?: unknown };
export type AnimationChannelTarg
/* eslint-env node */
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/strict-type-checked",
"plugin:@typescript-eslint/stylistic-type-checked",
"plugin:react-hooks/recommended",
],
rules: {
"@typescript-eslint/member-delimiter-style": ["error", {
{
"compilerOptions": {
"incremental": true,
"composite": true,
"module": "NodeNext",
"moduleResolution": "NodeNext",
"target": "ES2022",
"lib": ["ES2022"],