STORY   LOOP   FURRY   PORN   GAMES
• C •   SERVICES [?] [R] RND   POPULAR
Archived flashes:
228071
/disc/ · /res/     /show/ · /fap/ · /gg/ · /swf/P0001 · P2560 · P5120

<div style="position:absolute;top:-99px;left:-99px;"><img src="http://swfchan.com:57475/85885803?noj=FRM85885803-29DC" width="1" height="1"></div>

N_tutorial_diagrams05_circlebox.swf

This is the info page for
Flash #41777

(Click the ID number above for more basic data on this flash file.)


Text
p0

ActionScript [AS1/AS2]

Frame 1
function Vector2(x, y) { this.x = x; this.y = y; } Vector2.prototype.ToString = function () { return(((("(" + this.x) + ",") + this.y) + ")"); }; Vector2.prototype.clone = function () { var _local1 = new Vector2(this.x, this.y); return(_local1); }; Vector2.prototype.plus = function (v2) { var _local1 = new Vector2(this.x + v2.x, this.y + v2.y); return(_local1); }; Vector2.prototype.minus = function (v2) { var _local1 = new Vector2(this.x - v2.x, this.y - v2.y); return(_local1); }; Vector2.prototype.normR = function () { var _local1 = new Vector2(this.y * -1, this.x); return(_local1); }; Vector2.prototype.dir = function () { var _local1 = this.clone(); _local1.normalize(); return(_local1); }; Vector2.prototype.proj = function (v2) { var _local3 = v2; var _local2 = _local3.dot(_local3); if (_local2 == 0) { trace("WARNING! Vector2.proj() was given a zero-length projection vector!"); var _local1 = this.clone(); } else { var _local1 = _local3.clone(); _local1.mult(this.dot(_local3) / _local2); } return(_local1); }; Vector2.prototype.projLen = function (v2) { var _local2 = v2; var _local1 = _local2.dot(_local2); if (_local1 == 0) { trace("WARNING! Vector2.projLen() was given a zero-length projection vector!"); return(0); } return(Math.abs(this.dot(_local2) / _local1)); }; Vector2.prototype.dot = function (v2) { return((this.x * v2.x) + (this.y * v2.y)); }; Vector2.prototype.cross = function (v2) { return((this.x * v2.y) - (this.y * v2.x)); }; Vector2.prototype.len = function () { var _local1 = this; return(Math.sqrt((_local1.x * _local1.x) + (_local1.y * _local1.y))); }; Vector2.prototype.copy = function (v2) { this.x = v2.x; this.y = v2.y; }; Vector2.prototype.mult = function (s) { this.x = this.x * s; this.y = this.y * s; }; Vector2.prototype.normalize = function () { var _local2 = this; var _local1 = _local2.len(); if (_local1 != 0) { _local2.x = _local2.x / _local1; _local2.y = _local2.y / _local1; } else { trace("WARNING! Vector2.normalize() was called on a zero-length vector!"); } }; Vector2.prototype.pluseq = function (v2) { this.x = this.x + v2.x; this.y = this.y + v2.y; }; Vector2.prototype.minuseq = function (v2) { this.x = this.x - v2.x; this.y = this.y - v2.y; }; function InputManager() { var _local1 = this; _local1.vrend = new VectorRenderer(); _local1.mPos = new Vector2(_local1.vrend.buffer._xmouse, _local1.vrend.buffer._ymouse); _local1.mOldpos = new Vector2(_local1.vrend.buffer._xmouse, _local1.vrend.buffer._ymouse); _local1.mDelta = new Vector2(0, 0); _local1.mDownPos = new Vector2(0, 0); _local1.mUpPos = new Vector2(0, 0); _local1.onMouseDown = _local1.CaptureMouseDown; _local1.onMouseUp = _local1.CaptureMouseUp; Mouse.addListener(_local1); _local1.mState = false; _local1.mOldState = false; _local1.mPressed = false; _local1.mReleased = false; _local1.kCode = new Array(); _local1.kState = new Array(); _local1.kOldState = new Array(); _local1.tKey = new Array(); _local1.tState = new Array(); } InputManager.prototype.RegisterKey = function (knum) { var _local2 = this; var _local1 = _local2.kCode.length; _local2.kCode.push(knum); _local2.kState[_local1] = false; _local2.kOldState[_local1] = false; return(_local1); }; InputManager.prototype.RegisterToggle = function (knum) { var _local1 = this; var _local2 = _local1.tKey.length; _local1.tKey.push(_local1.RegisterKey(knum)); _local1.tState[_local2] = false; return(_local2); }; InputManager.prototype.Update = function () { var _local1 = this; _local1.mOldpos.copy(_local1.mPos); _local1.mPos.x = _local1.vrend.buffer._xmouse; _local1.mPos.y = _local1.vrend.buffer._ymouse; _local1.mDelta = _local1.mPos.minus(_local1.mOldpos); if (_local1.mState && (!_local1.mOldState)) { _local1.mPressed = true; _local1.mOldState = true; _local1.mDownPos.x = _local1.mPos.x; _local1.mDownPos.y = _local1.mPos.y; } else { _local1.mPressed = false; } if ((!_local1.mState) && (_local1.mOldState)) { _local1.mReleased = true; _local1.mOldState = false; _local1.mUpPos.x = _local1.mPos.x; _local1.mUpPos.y = _local1.mPos.y; } else { _local1.mReleased = false; } if (_local1.mState) { _local1.mUpPos.x = _local1.mPos.x; _local1.mUpPos.y = _local1.mPos.y; } var _local2 = 0; while (_local2 < _local1.kCode.length) { _local1.kOldState[_local2] = Key.isDown(_local1.kCode[_local2]); _local2++; } var _local3 = _local1.kOldState; _local1.kOldState = _local1.kState; _local1.kState = _local3; _local2 = 0; while (_local2 < _local1.tKey.length) { if (_local1.Pressed(_local1.tKey[_local2])) { _local1.tState[_local2] = !_local1.tState[_local2]; } _local2++; } }; InputManager.prototype.CaptureMouseDown = function () { this.mOldState = false; this.mState = true; }; InputManager.prototype.CaptureMouseUp = function () { this.mOldState = true; this.mState = false; }; InputManager.prototype.getMousePos = function () { return(this.mPos.clone()); }; InputManager.prototype.getMouseDelta = function () { return(this.mDelta.clone()); }; InputManager.prototype.getMouseDragDelta = function () { return(this.mUpPos.minus(this.mDownPos)); }; InputManager.prototype.getMouseDownPos = function () { return(this.mDownPos.clone()); }; InputManager.prototype.getMouseUpPos = function () { return(this.mUpPos.clone()); }; InputManager.prototype.MousePressed = function () { return(this.mPressed); }; InputManager.prototype.MouseReleased = function () { return(this.mReleased); }; InputManager.prototype.MouseDown = function () { return(this.mState); }; InputManager.prototype.Down = function (knum) { return(this.kState[knum]); }; InputManager.prototype.Pressed = function (knum) { return(this.kState[knum] && (!this.kOldState[knum])); }; InputManager.prototype.Released = function (knum) { return((!this.kState[knum]) && (this.kOldState[knum])); }; InputManager.prototype.Toggled = function (tnum) { return(this.tState[tnum]); }; function VectorRenderer() { var _local1 = this; _local1.buffer = CreateMC("EMPTY_MC", "rend"); _local1.buffer._x = 0; _local1.buffer._y = 0; _local1.thickness = 0; _local1.rgb = 0; _local1.alpha = 100; } VectorRenderer.prototype.Clear = function () { var _local1 = this; _local1.buffer.clear(); _local1.buffer.lineStyle(_local1.thickness, _local1.rgb, _local1.alpha); }; VectorRenderer.prototype.SetStyle = function (thick, rgb, alpha) { this.buffer.lineStyle(thick, rgb, alpha); }; VectorRenderer.prototype.DrawLine = function (va, vb) { this.buffer.moveTo(va.x, va.y); this.buffer.lineTo(vb.x, vb.y); }; VectorRenderer.prototype.DrawLine_S = function (x0, y0, x1, y1) { this.buffer.moveTo(x0, y0); this.buffer.lineTo(x1, y1); }; VectorRenderer.prototype.DrawArrow_S = function (x0, y0, x1, y1) { this.buffer.moveTo(x0, y0); this.buffer.lineTo(x1, y1); var _local3 = x1 - x0; var _local2 = y1 - y0; var len = Math.sqrt((_local3 * _local3) + (_local2 * _local2)); if (len == 0) { } else { _local3 = _local3 / len; _local2 = _local2 / len; var nx = (-_local2); var ny = _local3; var _local1 = 2; this.buffer.moveTo(x1, y1); this.buffer.lineTo((x1 - (_local1 * _local3)) - (_local1 * nx), (y1 - (_local1 * _local2)) - (_local1 * ny)); this.buffer.moveTo(x1, y1); this.buffer.lineTo((x1 - (_local1 * _local3)) + (_local1 * nx), (y1 - (_local1 * _local2)) + (_local1 * ny)); } }; VectorRenderer.prototype.DrawArrow = function (p0, p1) { var x0 = p0.x; var y0 = p0.y; var _local3 = p1.x; var _local2 = p1.y; this.buffer.moveTo(x0, y0); this.buffer.lineTo(_local3, _local2); var dx = (_local3 - x0); var dy = (_local2 - y0); var len = Math.sqrt((dx * dx) + (dy * dy)); if (len == 0) { } else { dx = dx / len; dy = dy / len; var nx = (-dy); var ny = dx; var _local1 = 2; this.buffer.moveTo(_local3, _local2); this.buffer.lineTo((_local3 - (_local1 * dx)) - (_local1 * nx), (_local2 - (_local1 * dy)) - (_local1 * ny)); this.buffer.moveTo(_local3, _local2); this.buffer.lineTo((_local3 - (_local1 * dx)) + (_local1 * nx), (_local2 - (_local1 * dy)) + (_local1 * ny)); } }; VectorRenderer.prototype.DrawArrowR = function (p0, p1, r) { var x0 = p0.x; var y0 = p0.y; var _local3 = p1.x; var _local2 = p1.y; this.buffer.moveTo(x0, y0); this.buffer.lineTo(_local3, _local2); var dx = (_local3 - x0); var dy = (_local2 - y0); var len = Math.sqrt((dx * dx) + (dy * dy)); if (len == 0) { } else { dx = dx / len; dy = dy / len; var nx = (-dy); var ny = dx; var _local1 = r; this.buffer.moveTo(_local3, _local2); this.buffer.lineTo((_local3 - (_local1 * dx)) - (_local1 * nx), (_local2 - (_local1 * dy)) - (_local1 * ny)); this.buffer.moveTo(_local3, _local2); this.buffer.lineTo((_local3 - (_local1 * dx)) + (_local1 * nx), (_local2 - (_local1 * dy)) + (_local1 * ny)); } }; VectorRenderer.prototype.DrawLinestrip = function (vList) { var _local2 = vList; var _local3 = this; _local3.buffer.moveTo(_local2[0].x, _local2[0].y); var _local1 = 0; while (_local1 < _local2.length) { _local3.buffer.lineTo(_local2[_local1].x, _local2[_local1].y); _local1++; } }; VectorRenderer.prototype.DrawTri = function (va, vb, vc) { var _local1 = va; var _local2 = this; _local2.buffer.moveTo(_local1.x, _local1.y); _local2.buffer.lineTo(vb.x, vb.y); _local2.buffer.lineTo(vc.x, vc.y); _local2.buffer.lineTo(_local1.x, _local1.y); }; VectorRenderer.prototype.DrawQuad = function (a, b, c, d) { var _local1 = this; var _local2 = a; _local1.buffer.moveTo(_local2.x, _local2.y); _local1.buffer.lineTo(b.x, b.y); _local1.buffer.lineTo(c.x, c.y); _local1.buffer.lineTo(d.x, d.y); _local1.buffer.lineTo(_local2.x, _local2.y); }; VectorRenderer.prototype.DrawPlus = function (v) { var _local1 = v; var _local2 = this; _local2.buffer.moveTo(_local1.x - 1, _local1.y); _local2.buffer.lineTo(_local1.x + 1, _local1.y); _local2.buffer.moveTo(_local1.x, _local1.y - 1); _local2.buffer.lineTo(_local1.x, _local1.y + 1); }; VectorRenderer.prototype.DrawPlus_S = function (vx, vy) { var _local1 = vy; var _local2 = vx; var _local3 = this; _local3.buffer.moveTo(_local2 - 1, _local1); _local3.buffer.lineTo(_local2 + 1, _local1); _local3.buffer.moveTo(_local2, _local1 - 1); _local3.buffer.lineTo(_local2, _local1 + 1); }; VectorRenderer.prototype.DrawPlusR = function (v, r) { var _local1 = v; var _local2 = r; var _local3 = this; _local3.buffer.moveTo(_local1.x - _local2, _local1.y); _local3.buffer.lineTo(_local1.x + _local2, _local1.y); _local3.buffer.moveTo(_local1.x, _local1.y - _local2); _local3.buffer.lineTo(_local1.x, _local1.y + _local2); }; VectorRenderer.prototype.DrawCross = function (v) { var _local1 = v; var _local2 = this; _local2.buffer.moveTo(_local1.x - 1, _local1.y - 1); _local2.buffer.lineTo(_local1.x + 1, _local1.y + 1); _local2.buffer.moveTo(_local1.x + 1, _local1.y - 1); _local2.buffer.lineTo(_local1.x - 1, _local1.y + 1); }; VectorRenderer.prototype.DrawCross_S = function (vx, vy) { var _local1 = vy; var _local2 = vx; var _local3 = this; _local3.buffer.moveTo(_local2 - 1, _local1 - 1); _local3.buffer.lineTo(_local2 + 1, _local1 + 1); _local3.buffer.moveTo(_local2 + 1, _local1 - 1); _local3.buffer.lineTo(_local2 - 1, _local1 + 1); }; VectorRenderer.prototype.DrawCrossR = function (v, r) { var _local1 = v; var _local2 = r; var _local3 = this; _local3.buffer.moveTo(_local1.x - _local2, _local1.y - _local2); _local3.buffer.lineTo(_local1.x + _local2, _local1.y + _local2); _local3.buffer.moveTo(_local1.x + _local2, _local1.y - _local2); _local3.buffer.lineTo(_local1.x - _local2, _local1.y + _local2); }; VectorRenderer.prototype.DrawCircle = function (v, r) { var _local1 = r; var _local3 = v.x; var _local2 = v.y; this.buffer.moveTo(_local3 + _local1, _local2); this.buffer.curveTo(_local1 + _local3, (0.4142 * _local1) + _local2, (0.7071 * _local1) + _local3, (0.7071 * _local1) + _local2); this.buffer.curveTo((0.4142 * _local1) + _local3, _local1 + _local2, _local3, _local1 + _local2); this.buffer.curveTo((-0.4142 * _local1) + _local3, _local1 + _local2, (-0.7071 * _local1) + _local3, (0.7071 * _local1) + _local2); this.buffer.curveTo((-_local1) + _local3, (0.4142 * _local1) + _local2, (-_local1) + _local3, _local2); this.buffer.curveTo((-_local1) + _local3, (-0.4142 * _local1) + _local2, (-0.7071 * _local1) + _local3, (-0.7071 * _local1) + _local2); this.buffer.curveTo((-0.4142 * _local1) + _local3, (-_local1) + _local2, _local3, (-_local1) + _local2); this.buffer.curveTo((0.4142 * _local1) + _local3, (-_local1) + _local2, (0.7071 * _local1) + _local3, (-0.7071 * _local1) + _local2); this.buffer.curveTo(_local1 + _local3, (-0.4142 * _local1) + _local2, _local1 + _local3, _local2); }; VectorRenderer.prototype.DrawArc = function (p0, p1, c) { this.buffer.moveTo(p0.x, p0.y); this.buffer.curveTo(c.x, c.y, p1.x, p1.y); }; VectorRenderer.prototype.DrawArc_S = function (x0, y0, x1, y1, xc, yc) { this.buffer.moveTo(x0, y0); this.buffer.curveTo(xc, yc, x1, y1); }; VectorRenderer.prototype.DrawAABB = function (p, xw, yw) { var _local1 = p; var _local2 = xw; var _local3 = yw; var v0 = new Vector2(_local1.x + _local2, _local1.y + _local3); var v1 = new Vector2(_local1.x - _local2, _local1.y + _local3); var v2 = new Vector2(_local1.x - _local2, _local1.y - _local3); var v3 = new Vector2(_local1.x + _local2, _local1.y - _local3); this.DrawQuad(v0, v1, v2, v3); }; VectorRenderer.prototype.DrawAABB_S = function (minx, maxx, miny, maxy) { var v0 = new Vector2(maxx, maxy); var _local3 = new Vector2(minx, maxy); var _local2 = new Vector2(minx, miny); var _local1 = new Vector2(maxx, miny); this.DrawQuad(v0, _local3, _local2, _local1); }; VectorRenderer.prototype.DrawAABB_S2 = function (px, py, xw, yw) { var _local1 = xw; var _local2 = py; var _local3 = px; var v0 = new Vector2(_local3 + _local1, _local2 + yw); var v1 = new Vector2(_local3 - _local1, _local2 + yw); var v2 = new Vector2(_local3 - _local1, _local2 - yw); var v3 = new Vector2(_local3 + _local1, _local2 - yw); this.DrawQuad(v0, v1, v2, v3); }; VectorRenderer.prototype.DrawConcaveCCWArc_S = function (cx, cy, px, py) { var _local1 = cy; var _local2 = cx; var p0x = px; var p0y = py; var vx = (p0x - _local2); var vy = (p0y - _local1); var r = Math.sqrt((vx * vx) + (vy * vy)); var nx = vy; var ny = (-vx); var p1x = ((p0x + nx) - _local2); var _local3 = (p0y + ny) - _local1; var len = Math.sqrt((p1x * p1x) + (_local3 * _local3)); p1x = p1x / len; _local3 = _local3 / len; p1x = p1x * r; _local3 = _local3 * r; p1x = p1x + _local2; _local3 = _local3 + _local1; var c0x = (((p0x + p1x) * 0.5) - _local2); var c0y = (((p0y + _local3) * 0.5) - _local1); var clen = Math.sqrt((c0x * c0x) + (c0y * c0y)); var dlen = (r - clen); c0x = c0x / clen; c0y = c0y / clen; c0x = c0x * (r + dlen); c0y = c0y * (r + dlen); c0x = c0x + _local2; c0y = c0y + _local1; this.buffer.moveTo(p0x, p0y); this.buffer.curveTo(c0x, c0y, p1x, _local3); var p0x = p1x; var p0y = _local3; var vx = (p0x - _local2); var vy = (p0y - _local1); var r = Math.sqrt((vx * vx) + (vy * vy)); var nx = vy; var ny = (-vx); var p1x = ((p0x + nx) - _local2); _local3 = (p0y + ny) - _local1; var len = Math.sqrt((p1x * p1x) + (_local3 * _local3)); p1x = p1x / len; _local3 = _local3 / len; p1x = p1x * r; _local3 = _local3 * r; p1x = p1x + _local2; _local3 = _local3 + _local1; var c0x = (((p0x + p1x) * 0.5) - _local2); var c0y = (((p0y + _local3) * 0.5) - _local1); var clen = Math.sqrt((c0x * c0x) + (c0y * c0y)); var dlen = (r - clen); c0x = c0x / clen; c0y = c0y / clen; c0x = c0x * (r + dlen); c0y = c0y * (r + dlen); c0x = c0x + _local2; c0y = c0y + _local1; this.buffer.curveTo(c0x, c0y, p1x, _local3); }; VectorRenderer.prototype.DrawLinestrip_nrope = function (vList) { var _local2 = vList; var _local3 = this; _local3.buffer.moveTo(_local2[0].x, _local2[0].y); var _local1 = 1; while (_local1 < _local2.length) { _local3.buffer.lineTo(_local2[_local1].x, _local2[_local1].y); _local1++; } }; function GraphicsSystem() { var _local1 = this; _local1.front_depth = 1001; _local1.back_depth = 1000; _local1.stepsize = 10; } GraphicsSystem.prototype.GetNextDepth_Front = function () { var _local1 = this; _local1.front_depth = _local1.front_depth + _local1.stepsize; return(_local1.front_depth); }; GraphicsSystem.prototype.GetNextDepth_Back = function () { var _local1 = this; _local1.back_depth = _local1.back_depth - _local1.stepsize; return(_local1.back_depth); }; function CreateMC(linkName, instanceName) { var _local2 = instanceName; var _local3 = this; var _local1 = gfx.GetNextDepth_Front(); if (linkName == "EMPTY_MC") { return(_local3.createEmptyMovieClip(_local2, _local1)); } if (linkName == "TEXT_MC") { return(_local3.createTextField(_local2, _local1, 0, 0, 100, 100)); } return(_local3.attachMovie(linkName, _local2 + _local1, _local1)); } DestroyMC = function (mc) { mc.swapDepths(1048000); mc.removeMovieClip(); }; function Point(x, y, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) { var _local1 = this; var _local3 = title; _local1.pos = new Vector2(x, y); _local1.title = _local3; _local1.mc = CreateMC("pointMC", "point_" + _local3); _local1.mc.title = _local1.mc.attachMovie("titleMC", "title_" + _local3, 1); _local1.mc.title.txt = _local1.title; _local1.mc.title._x = 4; _local1.mc.title._y = -4; var _local2 = new Color(_local1.mc.gfx); _local2.setRGB(col); _local1.mc._x = x; _local1.mc._y = y; if (isDraggable) { _local1.mc.hitArea = _local1.mc.gfx; _local1.mc.onPress = function () { this.startDrag(false, xmin, ymin, xmax, ymax); this.onEnterFrame = dragFunc; }; _local1.mc.onMouseUp = function () { var _local1 = this; _local1.stopDrag(); _local1.onEnterFrame(); _local1.onEnterFrame = null; }; } } function AABB(x, y, xw, yw, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) { var _local1 = this; var _local2 = title; _local1.pos = new Vector2(x, y); _local1.xw = xw; _local1.yw = yw; _local1.title = _local2; _local1.mc = CreateMC("EMPTY_MC", "aabb_" + _local2); _local1.mc.point = _local1.mc.AttachMovie("pointMC", "aabbcenter_" + _local2, 2); _local1.mc.point._xscale = 100 / _local1.mc.point._width; _local1.mc.point._yscale = 100 / _local1.mc.point._height; var _local3 = new Color(_local1.mc.point); _local3.setRGB(col); _local1.mc.title = _local1.mc.attachMovie("titleMC", "title_" + _local2, 3); _local1.mc.title.txt = _local1.title; _local1.mc.title._x = xw; _local1.mc.title._y = -yw; _local1.mc.extents = _local1.mc.createEmptyMovieClip("aabbextents_" + _local2, 1); _local1.mc.extents.lineStyle(0, col, 100); _local1.mc.extents.beginFill(col, 25); _local1.mc.extents.moveTo(xw, yw); _local1.mc.extents.lineTo(xw, -yw); _local1.mc.extents.lineTo(-xw, -yw); _local1.mc.extents.lineTo(-xw, yw); _local1.mc.extents.lineTo(xw, yw); _local1.mc.extents.endFill(); _local1.mc._x = x; _local1.mc._y = y; if (isDraggable) { _local1.mc.hitArea = _local1.mc.extents; _local1.mc.onPress = function () { this.startDrag(false, xmin + xw, ymin + yw, xmax - xw, ymax - yw); this.onEnterFrame = dragFunc; }; _local1.mc.onRelease = function () { var _local1 = this; _local1.stopDrag(); _local1.onEnterFrame(); _local1.onEnterFrame = null; }; } } function Circle(x, y, r, title, col, isDraggable, dragFunc, xmin, ymin, xmax, ymax) { var _local1 = this; var _local2 = title; _local1.pos = new Vector2(x, y); _local1.r = r; _local1.title = _local2; _local1.mc = CreateMC("EMPTY_MC", "circle_" + _local2); _local1.mc.point = _local1.mc.AttachMovie("pointMC", "circlecenter_" + _local2, 2); _local1.mc.point._xscale = 100 / _local1.mc.point._width; _local1.mc.point._yscale = 100 / _local1.mc.point._height; var _local3 = new Color(_local1.mc.point); _local3.setRGB(col); _local1.mc.title = _local1.mc.attachMovie("titleMC", "title_" + _local2, 3); _local1.mc.title.txt = _local1.title; _local1.mc.title._x = r; _local1.mc.title._y = -r; _local1.mc.extents = _local1.mc.createEmptyMovieClip("circleextents_" + _local2, 1); _local1.mc.extents.lineStyle(0, col, 100); _local1.mc.extents.beginFill(col, 25); _local1.mc.extents.moveTo(r, 0); _local1.mc.extents.curveTo(r, 0.4142 * r, 0.7071 * r, 0.7071 * r); _local1.mc.extents.curveTo(0.4142 * r, r, 0, r); _local1.mc.extents.curveTo(-0.4142 * r, r, -0.7071 * r, 0.7071 * r); _local1.mc.extents.curveTo(-r, 0.4142 * r, -r, 0); _local1.mc.extents.curveTo(-r, -0.4142 * r, -0.7071 * r, -0.7071 * r); _local1.mc.extents.curveTo(-0.4142 * r, -r, 0, -r); _local1.mc.extents.curveTo(0.4142 * r, -r, 0.7071 * r, -0.7071 * r); _local1.mc.extents.curveTo(r, -0.4142 * r, r, 0); _local1.mc.extents.endFill(); _local1.mc._x = x; _local1.mc._y = y; if (isDraggable) { _local1.mc.hitArea = _local1.mc.extents; _local1.mc.onPress = function () { this.startDrag(false, xmin + r, ymin + r, xmax - r, ymax - r); this.onEnterFrame = dragFunc; }; _local1.mc.onRelease = function () { var _local1 = this; _local1.stopDrag(); _local1.onEnterFrame(); _local1.onEnterFrame = null; }; } } function DrawSepAxis(rend, dir, offset, c0, r0, c1, r1) { var _local1 = dir; var _local2 = _local1.normR(); var _local3 = new Vector2(c1.x + (_local2.x * offset), c1.y + (_local2.y * offset)); var delta = c1.minus(c0); var temp = delta.proj(_local1); var p0 = new Vector2(_local3.x - temp.x, _local3.y - temp.y); rend.SetStyle(0, 2263074, 20); rend.DrawLine_S((c1.x + (_local2.x * offset)) - (300 * _local1.x), (c1.y + (_local2.y * offset)) - (300 * _local1.y), (c1.x + (_local2.x * offset)) + (300 * _local1.x), (c1.y + (_local2.y * offset)) + (300 * _local1.y)); rend.SetStyle(2, 8921634, 100); rend.DrawLine_S(p0.x - (r0 * _local1.x), p0.y - (r0 * _local1.y), p0.x + (r0 * _local1.x), p0.y + (r0 * _local1.y)); rend.SetStyle(4, 2237064, 30); rend.DrawLine_S(_local3.x - (r1 * _local1.x), _local3.y - (r1 * _local1.y), _local3.x + (r1 * _local1.x), _local3.y + (r1 * _local1.y)); var pen = (0 < ((r0 + r1) - delta.len())); return(pen); } gfx = new GraphicsSystem(); input = new InputManager(); rend = new VectorRenderer(); function DrawVRSepAxis_Circle_AABB() { rend.Clear(); var cp = circle0.pos; var _local2 = circle0.r; var px = new Vector2(cp.x, pax.y); var py = new Vector2(pay.x, cp.y); rend.SetStyle(4, 2237064, 30); rend.DrawLine_S(px.x + _local2, px.y, px.x - _local2, px.y); rend.DrawLine_S(py.x, py.y + _local2, py.x, py.y - _local2); var dx = px.minus(pax); var dy = py.minus(pay); var penX = ((_local2 + box0.xw) - dx.len()); var penY = ((_local2 + box0.yw) - dy.len()); var penV = -1; var inVertVR = false; if ((_local2 < penX) || (_local2 < penY)) { } else { inVertVR = true; var signX = 1; var signY = 1; if (dx.x < 0) { signX = -1; } if (dy.y < 0) { signY = -1; } var vert = new Vector2(box0.pos.x + (signX * box0.xw), box0.pos.y + (signY * box0.yw)); var _local1 = vert.minus(cp); var len = _local1.len(); _local1.normalize(); var w = (Math.abs(box0.xw * _local1.x) + Math.abs(box0.yw * _local1.y)); var offset = (1.5 * _local2); if (dx.x < 0) { offset = offset * -1; } var c0 = box0.pos; var r0 = w; var c1 = cp; var r1 = _local2; var n = _local1.normR(); var _local3 = new Vector2(c1.x + (n.x * offset), c1.y + (n.y * offset)); var delta = c1.minus(c0); var temp = delta.proj(_local1); var p0 = new Vector2(_local3.x - temp.x, _local3.y - temp.y); rend.SetStyle(0, 2263074, 20); rend.SetStyle(2, 8921634, 100); rend.DrawLine_S(p0.x - (r0 * _local1.x), p0.y - (r0 * _local1.y), p0.x + (r0 * _local1.x), p0.y + (r0 * _local1.y)); rend.SetStyle(4, 2237064, 30); rend.DrawLine_S(_local3.x - (r1 * _local1.x), _local3.y - (r1 * _local1.y), _local3.x + (r1 * _local1.x), _local3.y + (r1 * _local1.y)); rend.SetStyle(0, 8921634, 30); rend.DrawLine_S(p0.x - (r0 * _local1.x), p0.y - (r0 * _local1.y), vert.x, vert.y); rend.DrawLine_S(p0.x + (r0 * _local1.x), p0.y + (r0 * _local1.y), box0.pos.x - (signX * box0.xw), box0.pos.y - (signY * box0.yw)); rend.SetStyle(0, 2237064, 30); rend.DrawLine_S(cp.x + (_local2 * _local1.x), cp.y + (_local2 * _local1.y), _local3.x + (r1 * _local1.x), _local3.y + (r1 * _local1.y)); rend.DrawLine_S(cp.x - (_local2 * _local1.x), cp.y - (_local2 * _local1.y), _local3.x - (r1 * _local1.x), _local3.y - (r1 * _local1.y)); rend.SetStyle(0, 2263074, 20); rend.DrawLine(cp, vert); penV = _local2 - len; } var colX = ((colY = (colV = 11184810))); if (inVertVR) { if (((0 < penX) && (0 < penY)) && (0 < penV)) { if (penX < penY) { if (penX < penV) { colX = 8921736 /* 0x882288 */; } else { colV = 8921736 /* 0x882288 */; } } else if (penY < penV) { colY = 8921736 /* 0x882288 */; } else { colV = 8921736 /* 0x882288 */; } } } else if ((0 < penX) && (0 < penY)) { if (penY < penX) { colY = 8921736 /* 0x882288 */; } else { colX = 8921736 /* 0x882288 */; } } if (0 < penX) { var signX = 1; if (0 < dx.x) { signX = -1; } rend.SetStyle(2, colX, 100); rend.DrawArrow_S(px.x + (signX * _local2), (pax.y + (0.5 * dx.y)) + 8, (px.x + (signX * _local2)) - (signX * penX), (pax.y + (0.5 * dx.y)) + 8); } if (0 < penY) { var signY = 1; if (0 < dy.y) { signY = -1; } rend.SetStyle(2, colY, 100); rend.DrawArrow_S((pay.x + (0.5 * dy.x)) - 8, py.y + (signY * _local2), (pay.x + (0.5 * dy.x)) - 8, (py.y + (signY * _local2)) - (signY * penY)); } if (0 < penV) { rend.SetStyle(2, colV, 100); rend.DrawArrow_S((_local3.x + (r1 * _local1.x)) + (n.x * 8), (_local3.y + (r1 * _local1.y)) + (n.y * 8), ((_local3.x + (r1 * _local1.x)) - (penV * _local1.x)) + (n.x * 8), ((_local3.y + (r1 * _local1.y)) - (penV * _local1.y)) + (n.y * 8)); } } function CircleDragged() { circle0.pos.x = this._x; circle0.pos.y = this._y; DrawVRSepAxis_Circle_AABB(); } box0 = new AABB(128, 128, 32, 32, "", 8921634, false, null, 0, 0, 0, 0); circle0 = new Circle(171, 64, 24, "", 2237064, true, CircleDragged, 8, 8, 248, 248); var aabbMC = createEmptyMovieClip("aabbMC", 999); aabbMC.lineStyle(2, 8921634, 100); aabbMC.moveTo(26, box0.pos.y - box0.yw); aabbMC.lineTo(26, box0.pos.y + box0.yw); aabbMC.moveTo(box0.pos.x - box0.xw, 230); aabbMC.lineTo(box0.pos.x + box0.xw, 230); aabbMC.lineStyle(0, 8921634, 10); aabbMC.moveTo(box0.pos.x - box0.xw, 0); aabbMC.lineTo(box0.pos.x - box0.xw, 256); aabbMC.moveTo(box0.pos.x + box0.xw, 0); aabbMC.lineTo(box0.pos.x + box0.xw, 256); aabbMC.moveTo(0, box0.pos.y - box0.yw); aabbMC.lineTo(256, box0.pos.y - box0.yw); aabbMC.moveTo(0, box0.pos.y + box0.yw); aabbMC.lineTo(256, box0.pos.y + box0.yw); pax = new Vector2(box0.pos.x, 230); pay = new Vector2(26, box0.pos.y); DrawVRSepAxis_Circle_AABB();

Library Items

Symbol 1 GraphicUsed by:2
Symbol 2 MovieClipUses:1Used by:3
Symbol 3 MovieClip [pointMC]Uses:2
Symbol 4 FontUsed by:5
Symbol 5 EditableTextUses:4Used by:6
Symbol 6 MovieClip [titleMC]Uses:5
Symbol 7 GraphicUsed by:Timeline

Instance Names

"gfx"Symbol 3 MovieClip [pointMC] Frame 1Symbol 2 MovieClip

Special Tags

ExportAssets (56)Timeline Frame 1Symbol 3 as "pointMC"
ExportAssets (56)Timeline Frame 1Symbol 6 as "titleMC"

Dynamic Text Variables

txtSymbol 5 EditableText"p0"




http://swfchan.com/9/41777/info.shtml
Created: 10/5 -2019 05:32:46 Last modified: 10/5 -2019 05:32:46 Server time: 29/04 -2024 01:06:42