This file contains hidden or 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
| // Source: http://allenchou.net/2015/04/game-math-precise-control-over-numeric-springing/ | |
| public void Spring(ref float x, ref float v, float xt, float zeta, float omega, float h) | |
| { | |
| float f = 1.0f + 2.0f * h * zeta * omega; | |
| float oo = omega * omega; | |
| float hoo = h * oo; | |
| float hhoo = h * hoo; | |
| float detInv = 1.0f / (f + hhoo); | |
| float detX = f * x + h * v + hhoo * xt; | |
| float detV = v + hoo * (xt - x); |
This file contains hidden or 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
| ## Photon Methods | |
| **public class Blank : Photon.PunBehaviour** | |
| instead of mono behavior, use this to receive photon callbacks in your script. | |
| **public override void OnLeftRoom()** | |
| An example of overriding a punbehavior callback |
This file contains hidden or 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.Collections; | |
| using System.Collections.Generic; | |
| using UnityEngine; | |
| using UnityEngine.Profiling; | |
| public class KdTree<T> : IEnumerable<T>, IEnumerable where T : Component | |
| { | |
| protected KdNode _root; | |
| protected KdNode _last; |