protected override List <(float x, float y, float z)> GetVerticesTopDownView() { PositionAngle posAngle = GetPositionAngle(); float x = (float)posAngle.X; float y = (float)posAngle.Y; float z = (float)posAngle.Z; float yaw = (float)GetYaw(); float size = _useRecommendedArrowLength ? (float)GetRecommendedSize() : Size; (float arrowHeadX, float arrowHeadZ) = ((float, float))MoreMath.AddVectorToPoint(size, yaw, x, z); (float pointSide1X, float pointSide1Z) = ((float, float))MoreMath.AddVectorToPoint(_arrowHeadSideLength, yaw + 32768 + 8192, arrowHeadX, arrowHeadZ); (float pointSide2X, float pointSide2Z) = ((float, float))MoreMath.AddVectorToPoint(_arrowHeadSideLength, yaw + 32768 - 8192, arrowHeadX, arrowHeadZ); List <(float x, float y, float z)> vertices = new List <(float x, float y, float z)>(); vertices.Add((x, y, z)); vertices.Add((arrowHeadX, y, arrowHeadZ)); vertices.Add((arrowHeadX, y, arrowHeadZ)); vertices.Add((pointSide1X, y, pointSide1Z)); vertices.Add((arrowHeadX, y, arrowHeadZ)); vertices.Add((pointSide2X, y, pointSide2Z)); return(vertices); }
public override MapObjectHoverData GetHoverDataOrthographicView(bool isForObjectDrag, bool forceCursorPosition) { if (_customImage == null) { return(null); } Point?relPosMaybe = MapObjectHoverData.GetPositionMaybe(isForObjectDrag, forceCursorPosition); if (!relPosMaybe.HasValue) { return(null); } Point relPos = relPosMaybe.Value; (double x, double y, double z) = PositionAngle.GetMidPoint(_posAngle1, _posAngle2); (float controlX, float controlZ) = MapUtilities.ConvertCoordsForControlOrthographicView((float)x, (float)y, (float)z, UseRelativeCoordinates); double dist = MoreMath.GetDistanceBetween(controlX, controlZ, relPos.X, relPos.Y); double radius = Scales ? _iconSize * Config.CurrentMapGraphics.MapViewScaleValue : _iconSize; if (dist <= radius || forceCursorPosition) { return(new MapObjectHoverData(this, x, y, z)); } return(null); }
public static MapCustomPositionAngleObject Create() { string text = DialogUtilities.GetStringFromDialog(labelText: "Enter a PositionAngle."); PositionAngle posAngle = PositionAngle.FromString(text); return(posAngle != null ? new MapCustomPositionAngleObject(posAngle) : null); }
public MapCustomSphereObject(PositionAngle posAngle) : base() { _posAngle = posAngle; Size = 1000; }
public override MapObjectHoverData GetHoverDataTopDownView(bool isForObjectDrag, bool forceCursorPosition) { if (_customImage == null) { return(null); } Point?relPosMaybe = MapObjectHoverData.GetPositionMaybe(isForObjectDrag, forceCursorPosition); if (!relPosMaybe.HasValue) { return(null); } Point relPos = relPosMaybe.Value; (float inGameX, float inGameZ) = MapUtilities.ConvertCoordsForInGameTopDownView(relPos.X, relPos.Y); (double x, double y, double z) = PositionAngle.GetMidPoint(_posAngle1, _posAngle2); double dist = MoreMath.GetDistanceBetween(x, z, inGameX, inGameZ); double radius = Scales ? _iconSize : _iconSize / Config.CurrentMapGraphics.MapViewScaleValue; if (dist <= radius || forceCursorPosition) { return(new MapObjectHoverData(this, x, y, z)); } return(null); }
public MapObjectObjectCeiling(PositionAngle posAngle) : base() { _posAngle = posAngle; _autoUpdate = true; _tris = new List <TriangleDataModel>(); }
public TtcBobomb(TtcRng rng, uint address) : this( rng : rng, blinkingTimer : Config.Stream.GetInt32(address + 0xF4), withinMarioRange : PositionAngle.GetDistance(PositionAngle.Obj(address), PositionAngle.Mario) < 4000 ? 1 : 0) { }
public override void SetDragPositionTopDownView(double?x = null, double?y = null, double?z = null) { if (!x.HasValue || !z.HasValue) { return; } PositionAngle posAngle = GetPositionAngle(); double dist = MoreMath.GetDistanceBetween(posAngle.X, posAngle.Z, x.Value, z.Value); double angle = MoreMath.AngleTo_AngleUnits(posAngle.X, posAngle.Z, x.Value, z.Value); if (!KeyboardUtilities.IsCtrlHeld()) { if (_useRecommendedArrowLength) { SetRecommendedSize(dist); } else { GetParentMapTracker().SetSize((float)(Scales ? dist : dist *Config.CurrentMapGraphics.MapViewScaleValue)); } } if (!KeyboardUtilities.IsShiftHeld()) { SetYaw(angle); } }
public MapCustomPositionAngleObject(PositionAngle posAngle) : base() { _posAngle = posAngle; positionAngleProvider = () => new[] { _posAngle }; InternalRotates = true; }
public MapEffectiveHurtboxCylinderObject(PositionAngle posAngle) : base() { _posAngle = posAngle; Color = Color.Purple; }
public override void SetDragPositionTopDownView(double?x = null, double?y = null, double?z = null) { if (!x.HasValue || !z.HasValue) { return; } PositionAngle posAngle = _posAngle.GetBasePositionAngle(); double dist = MoreMath.GetDistanceBetween(posAngle.X, posAngle.Z, x.Value, z.Value); double angle = MoreMath.AngleTo_AngleUnits(posAngle.X, posAngle.Z, x.Value, z.Value); if (Rotates) { angle -= posAngle.Angle; } if (!KeyboardUtilities.IsCtrlHeld()) { _posAngle.SetOffsetDist(dist); } if (!KeyboardUtilities.IsShiftHeld()) { _posAngle.SetOffsetAngle(angle); } MapTracker mapTracker = GetParentMapTracker(); mapTracker.SetSize((float)_posAngle.GetOffsetDist()); mapTracker.SetLineWidth((float)_posAngle.GetOffsetAngle()); }
public MapObjectCustomPositionAngle(PositionAngle posAngle) : base() { _posAngle = posAngle; InternalRotates = true; }
private (float x, float y, float z) GetArrowHeadPosition() { PositionAngle posAngle = GetPositionAngle(); float x = (float)posAngle.X; float y = (float)posAngle.Y; float z = (float)posAngle.Z; float preYaw = (float)GetYaw() + _angleOffset; float yaw = _useTruncatedAngle ? MoreMath.NormalizeAngleTruncated(preYaw) : preYaw; float pitch = _usePitch ? (float)GetPitch() : 0; float size = _useRecommendedArrowLength ? (float)GetRecommendedSize() : Size; if (!Scales) { size /= Config.CurrentMapGraphics.MapViewScaleValue; } float arrowHeadX; float arrowHeadY; float arrowHeadZ; if (_usePitch) { (arrowHeadX, arrowHeadY, arrowHeadZ) = ((float, float, float)) MoreMath.AddVectorToPointWithPitch(size, yaw, pitch, x, y, z, false); } else { (arrowHeadX, arrowHeadZ) = ((float, float)) MoreMath.AddVectorToPoint(size, yaw, x, z); arrowHeadY = y; } return(arrowHeadX, arrowHeadY, arrowHeadZ); }
public MapObjectCustomCylinder(PositionAngle posAngle) : base() { _posAngle = posAngle; Size = 1000; }
public MapObjectPushHitboxCylinder(PositionAngle posAngle) : base() { _posAngle = posAngle; Color = Color.Orange; }
public MapObjectObjectCustomArrow(PositionAngle posAngle, uint yawOffset, int numBytes) : base() { _posAngle = posAngle; _yawOffset = yawOffset; _numBytes = numBytes; }
public MapObjectCoffinBox(PositionAngle posAngle) : base() { _posAngle = posAngle; LineWidth = 3; LineColor = Color.Magenta; }
public MapObjectEffectiveHurtboxCylinder(PositionAngle posAngle) : base() { _posAngle = posAngle; _useInteractionStatusAsColor = false; Color = Color.Purple; }
public MapCurrentUnitObject(PositionAngle posAngle) : base() { _posAngle = posAngle; Opacity = 0.5; Color = Color.Purple; }
public MapObjectCustomArrowObject(PositionAngle posAngle, uint yawOffset, int numBytes) : base() { _posAngle = posAngle; _objAddress = posAngle.GetObjAddress(); _yawOffset = yawOffset; _numBytes = numBytes; }
public MapObjectCurrentCell(PositionAngle posAngle) : base() { _posAngle = posAngle; Opacity = 0.5; Color = Color.Yellow; }
public MapFacingDividerObject(PositionAngle posAngle) : base() { _posAngle = posAngle; Size = 1000; OutlineWidth = 3; OutlineColor = Color.Red; }
public MapObjectOffsetPositionAngle(PositionAngle posAngle) : base() { _posAngle = posAngle; _iconSize = 25; Size = 100; LineWidth = 0; }
public MapHomeLineObject(uint objAddress) : base() { _objPosAngle = PositionAngle.Obj(objAddress); _homePosAngle = PositionAngle.ObjHome(objAddress); OutlineWidth = 3; OutlineColor = Color.Black; }
public MapObjectFacingDivider(PositionAngle posAngle) : base() { _posAngle = posAngle; Size = 1000; LineWidth = 3; LineColor = Color.Red; }
public MapObjectHomeLine(PositionAngle posAngle) : base() { _objPosAngle = PositionAngle.Obj(posAngle.GetObjAddress()); _homePosAngle = PositionAngle.ObjHome(posAngle.GetObjAddress()); LineWidth = 3; LineColor = Color.Black; }
public MapSectorObject(PositionAngle posAngle) : base() { _posAngle = posAngle; _angleRadius = 4096; Size = 1000; Opacity = 0.5; Color = Color.Yellow; }
public override List <ToolStripItem> GetHoverContextMenuStripItems(MapObjectHoverData hoverData) { List <ToolStripItem> output = base.GetHoverContextMenuStripItems(hoverData); (double x, double y, double z) = PositionAngle.GetMidPoint(_posAngle1, _posAngle2); ToolStripMenuItem copyPositionItem = MapUtilities.CreateCopyItem(x, y, z, "Position"); output.Insert(0, copyPositionItem); return(output); }
public static MapObject Create(string text1, string text2) { PositionAngle posAngle1 = PositionAngle.FromString(text1); PositionAngle posAngle2 = PositionAngle.FromString(text2); if (posAngle1 == null || posAngle2 == null) { return(null); } return(new MapLineSegmentObject(posAngle1, posAngle2)); }
public MapLineSegmentObject(PositionAngle posAngle1, PositionAngle posAngle2) : base() { _posAngle1 = posAngle1; _posAngle2 = posAngle2; _useFixedSize = false; _backwardsSize = 0; Size = 0; OutlineWidth = 3; OutlineColor = Color.Red; }