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
/////////////////////////////////////////////////////////////////////////////// | |
// ABOUT: A unity Shader .cginc to draw numbers in the fragment shader | |
// AUTHOR: Freya Holmér | |
// LICENSE: Use for whatever, commercial or otherwise! | |
// Don't hold me liable for issues though | |
// But pls credit me if it works super well <3 | |
// LIMITATIONS: There's some precision loss beyond 3 decimal places | |
// CONTRIBUTORS: yes please! if you know a more precise way to get | |
// decimal digits then pls lemme know! | |
// GetDecimalSymbolAt() could use some more love/precision |
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
https://gdcvault.com/play/1020787/Math-for-Game-Programmers-Introduction | |
https://marctenbosch.com/quaternions/ // About Rotor instead of Quats | |
https://jacquesheunis.com/post/rotors/ | |
https://www.youtube.com/watch?v=htYh-Tq7ZBI // Freya about vectors | |
https://math.okstate.edu/people/lebl/osu4013-f19/diffforms.pdf | |
https://www.youtube.com/watch?v=_pKxbNyjNe8&list=PLRlVmXqzHjUQARA37r4Qw3SHPqVXgqO6c // what is a tensors plus more |
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
// OcTree with Morton Order | |
// based on http://marupeke296.com/COL_3D_No15_Octree.html | |
// | |
// +------+------+ | |
// |\ 2 \ 3 \ | |
// | +------+------+ | |
// + |\ \ \ | |
// |\| +------+------+ | |
// | + | | | | |
// +0|\| 6 | 7 | |
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
audioContainer: { | |
height: '30px', | |
overflow: 'hidden', | |
backgroundColor: '#26476F', | |
boxShadow: '0px 0px 5px 2px rgba( 0,0,0,0.55 )', | |
borderRadius: '4px', | |
color: '#ffffff', | |
}, | |
audio: { |
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
/** | |
* \brief Returns positional offset for a given point as a result of summing 4 gerstner waves | |
* \param positionWS point in world space | |
* \param wavelengths wavelength of each of the 4 waves | |
* \param amplitudes amplitudes of each of the 4 waves | |
* \param directions direction of each of the 4 waves (each row = one direction). MUST BE NORMALIZED! | |
* \param speed global speed multiplier. Individual wave speed depends on Wavelength | |
* \param steepness Gerstner wave 'Steepness' parameter. Modulates the horizontal offset of points | |
* \param normal returns the normal of given point. | |
* \return positional offset of the given point |
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
// #region CUSTOM - NON-BLENDER CODE | |
/* | |
USAGE | |
vec3 ramp_col[9] = vec3[]( | |
rgb(0x0F2936), | |
rgb(0x123243), | |
rgb(0x24525D), | |
rgb(0x437274), | |
rgb(0x263F41), |
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.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
public class pipeGenerator : MonoBehaviour | |
{ | |
[SerializeField] Mesh straightMesh; | |
[SerializeField] Mesh elbowMesh; | |
[Space] | |
[SerializeField] Vector3[] pathPoints; |
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 heap = new BinaryHeap( IsMinCompare ); | |
heap.add( 5 ); | |
heap.add( 8 ); | |
heap.add( 6 ); | |
heap.add( 9 ); | |
heap.add( 13 ); | |
heap.add( 3 ); | |
heap.add( 1 ); |
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 a faux sphere in screen space, determine the arc transform to orbit | |
* the camera around a target position. A continuous orientation will | |
* be provided for further calls. | |
*/ | |
function arcBallTransform( | |
scrSize, // Screen size, vec2 | |
scrPos0, // Starting mouse position, vec2 | |
scrPos1, // Ending Mouse Positiong, vec2 | |
rotOrientation, // Current arc orientation, quaternion | |
targetPos, // Position to orbit around |
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
/* | |
vec3 rot = vec3( 90.0, 90.0, 0.0 ); | |
vec3 pos = position * scale; | |
vec3 norm = normal; | |
eulerRotation( rot * DEG2RAD, pos, norm ); | |
*/ | |
const float DEG2RAD = 0.01745329251; // PI / 180 | |
// Apply YXZ radian rotation |
NewerOlder