Skip to content

Instantly share code, notes, and snippets.

View painkkiller's full-sized avatar
🎯
Focusing

Dmitry painkkiller

🎯
Focusing
View GitHub Profile
public static function isPointInPolygon(point:Vector3D, polygon:Vector.<Vector3D>):Boolean {
var i:int, j:int, nvert:int = polygon.length;
var result:Boolean = false;
for (i = 0, j = nvert - 1; i < nvert; j = i++) {
if (((polygon[i].z) >= point.z != (polygon[j].z >= point.z)) &&
(point.x <= (polygon[j].x - polygon[i].x) * (point.z - polygon[i].z) / (polygon[j].z - polygon[i].z) + polygon[i].x))
result = !result;
}
@painkkiller
painkkiller / gist:5275d30acd20268bfc7d
Created December 24, 2015 06:35
Эксепш при переходе в фуллскрин, блокировке компьютера и выходе из блокировки
Error: Error #3694: The object was disposed by an earlier call of dispose() on it.
at flash.display3D::Context3D/createRectangleTexture()
at starling.textures::Texture$/empty()[/Users/jenkins/Workspaces/workspace/heavens2-client-web-build-rc/client/libs/Starling/src/starling/textures/Texture.as:464]
at ru.rainal.component::StandardImage()[/Users/jenkins/Workspaces/workspace/heavens2-client-web-build-rc/client/libs/Starling/src/ru/rainal/component/StandardImage.as:28]
at game.ui::SmartImage()[/Users/jenkins/Workspaces/workspace/heavens2-client-web-build-rc/client/libs/Core/src/game/ui/SmartImage.as:18]
at game.ui.text::VariableTextField/createChildren()[/Users/jenkins/Workspaces/workspace/heavens2-client-web-build-rc/client/libs/Core/src/game/ui/text/VariableTextField.as:61]
at ru.rainal.display::SmartDisplayObjectContainer/initInstance()[/Users/jenkins/Workspaces/workspace/heavens2-client-web-build-rc/client/libs/Starling/src/ru/rainal/display/SmartDisplayObjectContainer.as:212]
at
package game.utils
{
import flash.utils.describeType;
public class EnumParser
{
// static methods (get/set, public, protected, private, handlers)
/**