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: | |
// | |
// currentPos = ExpEase.Out(currentPos, targetPos, -4.0); | |
// | |
// or | |
// | |
// ExpEase.Out2(currentPos, targetPos, -4.0); // This modifies currentPos. | |
// | |
using UnityEngine; |
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; | |
public class EnumFlagAttribute : PropertyAttribute | |
{ | |
public string enumName; | |
public EnumFlagAttribute() {} | |
public EnumFlagAttribute(string name) | |
{ |
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. |
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
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 <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
// 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
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
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
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; | |
} | |
} |
OlderNewer