Skip to content

Instantly share code, notes, and snippets.

View cart's full-sized avatar

Carter Anderson cart

View GitHub Profile
@cart
cart / gist:cc095f4950c40c1fe25169be5ee78247
Created February 1, 2018 06:34
A collection of C# Math extensions for Godot
using Godot;
namespace HighHat.MathHelpers
{
public static class MathExtensions
{
// TODO: expose Godot's Transform::interpolate_with to scripting. This is just a C# port
public static Transform InterpolateWith(this Transform transform, Transform targetTransform, float percent, bool includeScale = true)
{
var rotation = transform.basis.Orthonormalized().ToQuat();
@cart
cart / NodeExtensions.cs
Created February 1, 2018 06:31
A collection of C# Node extensions for Godot
using Godot;
using System;
using System.Collections.Generic;
using System.Text.RegularExpressions;
namespace HighHat.Scene.Nodes
{
public static class NodeExtensions
{
private static Regex _nameRegex = new Regex("@*(?<Name>[\\w|\\d]+)@*.*");