Skip to content

Instantly share code, notes, and snippets.

View moolicc's full-sized avatar
🤠
Howdy!

Joel moolicc

🤠
Howdy!
View GitHub Profile
@GeorgeHahn
GeorgeHahn / gist:914f2ebafff1ccd485b4
Last active September 12, 2018 19:34
Considering Rust + CLR interop

#Brainstorming Rust + C# interop

Use case A

  • Rust UI via WPF or Persperex
  • Make it feel like XAML is Rust-native
  • Put function name in WPF event handler, we stub out from that to Rust code
  • Rust event handlers written with a macro that we use to write interop stubs on each side
  • Can I do GUI nesting without XAML? Eg like the Zinc.rs config block, but for UI elements
  • Pros:
@mrhelmut
mrhelmut / Easing.cs
Created March 16, 2018 16:40
C# implementation of Robert Penner's easing functions
// TERMS OF USE - EASING EQUATIONS
//
// Open source under the BSD License.
//
// Copyright © 2001 Robert Penner
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
//
// Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
const int C2_GJK_ITERS = 20;
public const int C2_MAX_POLYGON_VERTS = 8;
// position of impact p = ray.p + ray.d * raycast.t
public static c2v c2Impact(c2Ray ray, float t) => c2Add(ray.p, c2Mulvs(ray.d, t));
#region Wrapper Methods
public static unsafe bool c2Collided(void* A, c2x* ax, C2_TYPE typeA, void* B, c2x* bx, C2_TYPE typeB)
@Treeki
Treeki / TurnipPrices.cpp
Last active November 22, 2024 19:48
AC:NH turnip price calculator
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
// munged from https://github.com/simontime/Resead
namespace sead
{
class Random
{