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 UnityEngine; | |
/* | |
* Oklab Unity implementation by Ferran Bertomeu Castells @fonserbc | |
* | |
* Oklab by Björn Ottosson https://bottosson.github.io/posts/oklab/ | |
* under Public Domain | |
* | |
* For the conversions, I understand unity's Color as a gamma-space color | |
*/ |
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
/* | |
Bullet Continuous Collision Detection and Physics Library | |
Copyright (c) 2015 Google Inc. http://bulletphysics.org | |
This software is provided 'as-is', without any express or implied warranty. | |
In no event will the authors be held liable for any damages arising from the use of this software. | |
Permission is granted to anyone to use this software for any purpose, | |
including commercial applications, and to alter it and redistribute it freely, | |
subject to the following restrictions: |
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
float evalCurve(float x, float tx, float ty, float sa, float sb) | |
{ | |
const float EPS = 1e-6f; | |
if (x < tx) { | |
return (ty * x) / (x + sa * (tx - x) + EPS); | |
} else { | |
return ((1-ty) * (x-1)) / ((1-x) - sb * (tx - x) + EPS) + 1.0f; | |
} | |
} |
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
const std = @import("std"); | |
test "fields" { | |
const U1s = packed struct { | |
a: u1, | |
b: u1, | |
c: u1, | |
}; | |
const x = U1s{ .a = 1, .b = 0, .c = 0 }; |
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 BovineLabs.Entities.Systems; | |
using Unity.Burst; | |
using Unity.Entities; | |
using Unity.Jobs; | |
using Unity.Collections; | |
using Unity.Physics; | |
using Unity.Physics.Systems; | |
using UnityEngine; | |
[UpdateAfter(typeof(BuildPhysicsWorld)), UpdateBefore(typeof(EndFramePhysicsSystem))] |
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 of using DX10-style HLSL texture and sampler objects in | |
// Unity shaders | |
Shader "Unlit/Example" | |
{ | |
Properties | |
{ | |
_MainTex ("Texture", 2D) = "white" {} | |
} | |
SubShader | |
{ |
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
#include <glm/matrix.hpp> | |
class Frustum | |
{ | |
public: | |
Frustum() {} | |
// m = ProjectionMatrix * ViewMatrix | |
Frustum(glm::mat4 m); |
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 UnityEngine; | |
using UnityEditor; | |
using System.Reflection; | |
using Type = System.Type; | |
public class InlineCurveEditor | |
{ | |
private object curveEditor; | |
private Type curveType; |
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
#include <iostream> | |
#include <algorithm> | |
#include <vector> | |
#include <regex> | |
std::regex::flag_type parse_flags(const std::string& flag_str) { | |
std::regex::flag_type grammar = std::regex::ECMAScript; | |
std::regex::flag_type flags = grammar ^ grammar; | |
for (const auto& c: flag_str) { | |
switch (c) { |
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
from numpy import * | |
from matplotlib.pyplot import * | |
# A Dugoff Tire model implementation in python/numpy | |
#Alexander Brown, Ph.D. | |
# [email protected] | |
class DugoffTire: | |
""" This python class implements the Dugoff tire model based on friction coefficients, cornering stiffnesses. | |
Forces are applied in same sign as slip angle, so be aware of this when you implement. |
NewerOlder