This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Created 2024 StagPoint. Released to the public domain. | |
using System; | |
using System.Runtime.CompilerServices; | |
using Unity.Collections; | |
using UnityEngine; | |
using UnityEngine.Scripting; | |
using UnityEngine.UIElements; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StagPoint.EditorUtils | |
{ | |
using System; | |
using System.Linq; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEditor.Animations; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2017-2021 StagPoint Software | |
namespace StagPoint.Collections | |
{ | |
using System; | |
using System.Diagnostics; | |
using System.Runtime.CompilerServices; | |
using Unity.Collections; | |
using Unity.Collections.LowLevel.Unsafe; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace StagPoint.Math | |
{ | |
using Unity.Collections; | |
using Unity.Mathematics; | |
/// <summary> | |
/// Implements a simplistic 3D curve smoother | |
/// </summary> | |
public static class CurveSmoother | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ************************************************** | |
// EXAMPLE USAGE: | |
// | |
// // Returns a single value with arguments x and y interleaved | |
// var code = MortonCode2D.Interleave( 123, 456 ); | |
// | |
// // Extracts the interleaved values (123 and 456) into integer variables x and y | |
// MortonCode2D.Deinterleave( code, out int x, out int y ) | |
// | |
// ************************************************** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Runtime.InteropServices; | |
using System.Runtime.CompilerServices; | |
using Unity.Burst; | |
using Unity.Mathematics; | |
public static class CameraMath | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// "Dusty nebula 4" by Duke | |
// https://www.shadertoy.com/view/MsVXWW | |
//------------------------------------------------------------------------------------- | |
// Based on "Dusty nebula 3" (https://www.shadertoy.com/view/lsVSRW) | |
// and "Protoplanetary disk" (https://www.shadertoy.com/view/MdtGRl) | |
// otaviogood's "Alien Beacon" (https://www.shadertoy.com/view/ld2SzK) | |
// and Shane's "Cheap Cloud Flythrough" (https://www.shadertoy.com/view/Xsc3R4) shaders | |
// Some ideas came from other shaders from this wonderful site | |
// Press 1-2-3 to zoom in and zoom out. | |
// License: Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Disable all XML Comment warnings in this file, because Unity won't allow us to turn this bullshit off and keeps overwriting our settings // | |
#pragma warning disable 1591 | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class NewBehaviourScript : MonoBehaviour | |
{ | |
// Use this for initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private bool planesIntersectAtSinglePoint( Plane p0, Plane p1, Plane p2, out Vector3 intersectionPoint ) | |
{ | |
const float EPSILON = 1e-4f; | |
var det = Vector3.Dot( Vector3.Cross( p0.normal, p1.normal ), p2.normal ); | |
if( det < EPSILON ) | |
{ | |
intersectionPoint = Vector3.zero; | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) 2017 StagPoint Software | |
namespace StagPoint.ObjectPooling | |
{ | |
using System; | |
using System.Collections.Generic; | |
public class ObjectPool<T> where T : class | |
{ | |
#region Static variables |
NewerOlder