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
// pitch and yaw are in degrees | |
Vector3D getDirectionVector() { | |
return new Vector3D(-Math.cos(pitch * Math.PI / 180.0) * Math.sin(yaw * Math.PI / 180.0), Math.sin(pitch * Math.PI / 180.0), -Math.cos(pitch * Math.PI / 180.0) * Math.cos(yaw * Math.PI / 180.0)); | |
} |
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
<?php | |
function time_ago($date,$granularity=2) { | |
$difference = time() - $date; | |
$retval = ''; | |
$periods = array('decade' => 315360000, | |
'year' => 31536000, | |
'month' => 2628000, | |
'week' => 604800, | |
'day' => 86400, | |
'hour' => 3600, |