Correction: I originally labeled this post and the corresponding youtube video as describing a simple harmonic oscillator. Incidentally, it isn’t. It’s just an oscillator. Not sure what I was thinking when I made this. I’ve made all the corrections I could without changing the video. I’ll post an updated version eventually.
Oscillators run through physics. Light waves, sound waves, pendulums, bouncing balls, shock absorbers, springs, circuits, and any other repeated process can be described using the math of oscillators. In Portal 2, we can make an oscillator using two portals placed on a horizontal surface.
A few things to note:
1) Objects other than the player are dampened because they feel air resistance. The strength of the air resistance will be covered later.
2) There is a minimum amplitude for oscillations through portals. No matter the object, eventually it will become an undampened simple harmonic oscillator.
3) As described in the video, the math behind finding the period of an oscillation is pretty simple and appears to work. That being said, it’s worth investigating a little more rigorously to determine the accuracy of the Source engine. Other physics engines have been found to cheat with physics, especially in terms of the way time goes by in the game. For instance, the Karma engine that Unreal Tournament 2004 uses has been found running time at 110% speed. I’d be interested to know if Source does something similar.
edit: 4) This isn’t technically a dampened oscillator! I’ll be investigating the differences soon!