Renamed Joi to JointPoint
This commit is contained in:
@@ -305,7 +305,7 @@ namespace _2DGAMELIB
|
||||
foreach (ShapePart p0 in array2)
|
||||
{
|
||||
Vector2D p = p0.Position;
|
||||
if (array.All((ShapePart p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance))))
|
||||
if (array.All((ShapePart p1) => p0 == p1 || p1.JP.All((JointPoint j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance))))
|
||||
{
|
||||
return p0;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace _2DGAMELIB
|
||||
int num = 0;
|
||||
List<int> list = new List<int>();
|
||||
List<ShapePart> list2 = EnumPar.ToList();
|
||||
foreach (Joi item in JoinRoot.JP)
|
||||
foreach (JointPoint item in JoinRoot.JP)
|
||||
{
|
||||
Vector2D v = JoinRoot.ToGlobal(item.Joint);
|
||||
int num2 = 0;
|
||||
@@ -59,7 +59,7 @@ namespace _2DGAMELIB
|
||||
{
|
||||
ShapePart shapePart = js.Joins[i].Par1;
|
||||
int num3 = 0;
|
||||
foreach (Joi item in shapePart.JP)
|
||||
foreach (JointPoint item in shapePart.JP)
|
||||
{
|
||||
Vector2D v = shapePart.ToGlobal(item.Joint);
|
||||
int num4 = 0;
|
||||
@@ -108,7 +108,7 @@ namespace _2DGAMELIB
|
||||
if (JoinRoot != item2)
|
||||
{
|
||||
int num2 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
foreach (JointPoint item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (ShapePart item4 in item2.EnumJoinRoot)
|
||||
@@ -160,7 +160,7 @@ namespace _2DGAMELIB
|
||||
if (difs != item2)
|
||||
{
|
||||
int num4 = 0;
|
||||
foreach (Joi item3 in item.JP)
|
||||
foreach (JointPoint item3 in item.JP)
|
||||
{
|
||||
Vector2D v = item.ToGlobal(item3.Joint);
|
||||
foreach (ShapePart item4 in item2.EnumJoinRoot)
|
||||
|
||||
@@ -6,16 +6,16 @@ namespace _2DGAMELIB
|
||||
|
||||
//its the position of a joint
|
||||
[Serializable]
|
||||
public class Joi
|
||||
public class JointPoint
|
||||
{
|
||||
public Vector2D Joint = DataConsts.Vec2DZero;
|
||||
|
||||
public Joi(Joi Joi)
|
||||
public JointPoint(JointPoint JointPoint)
|
||||
{
|
||||
Joint = Joi.Joint;
|
||||
Joint = JointPoint.Joint;
|
||||
}
|
||||
|
||||
public Joi(Vector2D Joint)
|
||||
public JointPoint(Vector2D Joint)
|
||||
{
|
||||
this.Joint = Joint;
|
||||
}
|
||||
@@ -228,7 +228,7 @@ namespace _2DGAMELIB
|
||||
if (difs.EnumJoinRoot.All(delegate(ShapePart p0)
|
||||
{
|
||||
p = p0.Position;
|
||||
return pa.All((ShapePart p1) => p0 == p1 || p1.JP.All((Joi j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance)));
|
||||
return pa.All((ShapePart p1) => p0 == p1 || p1.JP.All((JointPoint j) => !(p1.ToGlobal(j.Joint).DistanceSquared(p) <= Join.IdentityDistance)));
|
||||
}))
|
||||
{
|
||||
return difs;
|
||||
|
||||
@@ -18,7 +18,8 @@ namespace _2DGAMELIB
|
||||
.Add("_2DGAMELIB.Par", typeof(ShapePart))
|
||||
.Add("_2DGAMELIB.ParT", typeof(ShapePartT))
|
||||
.Add("_2DGAMELIB.Pars", typeof(PartGroup))
|
||||
.Add("_2DGAMELIB.Out", typeof(CurveOutline));
|
||||
.Add("_2DGAMELIB.Out", typeof(CurveOutline))
|
||||
.Add("_2DGAMELIB.Joi", typeof(JointPoint));
|
||||
|
||||
private static BinaryFormatter NewFormatter()
|
||||
{
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace _2DGAMELIB
|
||||
|
||||
protected List<CurveOutline> op = new List<CurveOutline>();
|
||||
|
||||
protected List<Joi> jp = new List<Joi>();
|
||||
protected List<JointPoint> jp = new List<JointPoint>();
|
||||
|
||||
protected Vector2D basePointBase = DataConsts.Vec2DZero;
|
||||
|
||||
@@ -176,7 +176,7 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public List<Joi> JP
|
||||
public List<JointPoint> JP
|
||||
{
|
||||
get
|
||||
{
|
||||
@@ -188,7 +188,7 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Joi> InitializeJP
|
||||
public IEnumerable<JointPoint> InitializeJP
|
||||
{
|
||||
set
|
||||
{
|
||||
@@ -588,10 +588,10 @@ namespace _2DGAMELIB
|
||||
{
|
||||
op.Add(new CurveOutline(ShapePart.op[i]));
|
||||
}
|
||||
jp = new List<Joi>(ShapePart.jp.Count);
|
||||
jp = new List<JointPoint>(ShapePart.jp.Count);
|
||||
for (int j = 0; j < ShapePart.jp.Count; j++)
|
||||
{
|
||||
jp.Add(new Joi(ShapePart.jp[j]));
|
||||
jp.Add(new JointPoint(ShapePart.jp[j]));
|
||||
}
|
||||
basePointBase = ShapePart.basePointBase;
|
||||
basePointCont = ShapePart.basePointCont;
|
||||
|
||||
@@ -69,11 +69,11 @@ namespace _2DGAMELIB
|
||||
return vec2DZero / num;
|
||||
}
|
||||
|
||||
public static Vector2D GetCenter(this IEnumerable<Joi> Joi)
|
||||
public static Vector2D GetCenter(this IEnumerable<JointPoint> Joi)
|
||||
{
|
||||
double num = 0.0;
|
||||
Vector2D vec2DZero = DataConsts.Vec2DZero;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
vec2DZero += item.Joint;
|
||||
num += 1.0;
|
||||
@@ -200,60 +200,60 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingX(this IEnumerable<Joi> Joi, Vector2D BP, double Rate)
|
||||
public static void ScalingX(this IEnumerable<JointPoint> Joi, Vector2D BP, double Rate)
|
||||
{
|
||||
double num = BP.X - BP.X * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.X = item.Joint.X * Rate + num;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingX(this IEnumerable<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ScalingX(this IEnumerable<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
double num = BP.X - BP.X * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.X = item.Joint.X * Rate + num;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingY(this IEnumerable<Joi> Joi, Vector2D BP, double Rate)
|
||||
public static void ScalingY(this IEnumerable<JointPoint> Joi, Vector2D BP, double Rate)
|
||||
{
|
||||
double num = BP.Y - BP.Y * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.Y = item.Joint.Y * Rate + num;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingY(this IEnumerable<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ScalingY(this IEnumerable<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
double num = BP.Y - BP.Y * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.Y = item.Joint.Y * Rate + num;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingXY(this IEnumerable<Joi> Joi, Vector2D BP, double Rate)
|
||||
public static void ScalingXY(this IEnumerable<JointPoint> Joi, Vector2D BP, double Rate)
|
||||
{
|
||||
Vector2D vector2D = default(Vector2D);
|
||||
vector2D.X = BP.X - BP.X * Rate;
|
||||
vector2D.Y = BP.Y - BP.Y * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.X = item.Joint.X * Rate + vector2D.X;
|
||||
item.Joint.Y = item.Joint.Y * Rate + vector2D.Y;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ScalingXY(this IEnumerable<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ScalingXY(this IEnumerable<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
Vector2D vector2D = default(Vector2D);
|
||||
vector2D.X = BP.X - BP.X * Rate;
|
||||
vector2D.Y = BP.Y - BP.Y * Rate;
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.X = item.Joint.X * Rate + vector2D.X;
|
||||
item.Joint.Y = item.Joint.Y * Rate + vector2D.Y;
|
||||
@@ -308,19 +308,19 @@ namespace _2DGAMELIB
|
||||
Out.Reverse();
|
||||
}
|
||||
|
||||
public static void ReverseX(this List<Joi> Joi, ref Vector2D BP)
|
||||
public static void ReverseX(this List<JointPoint> Joi, ref Vector2D BP)
|
||||
{
|
||||
double num = BP.X - (1.0 - BP.X);
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.X = 1.0 - item.Joint.X + num;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReverseY(this List<Joi> Joi, ref Vector2D BP)
|
||||
public static void ReverseY(this List<JointPoint> Joi, ref Vector2D BP)
|
||||
{
|
||||
double num = BP.Y - (1.0 - BP.Y);
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint.Y = 1.0 - item.Joint.Y + num;
|
||||
}
|
||||
@@ -400,9 +400,9 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExpansionX(this List<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ExpansionX(this List<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
Vector2D vector2D = (item.Joint - BP).newNormalize();
|
||||
vector2D.Y = 0.0;
|
||||
@@ -410,9 +410,9 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExpansionY(this List<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ExpansionY(this List<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
Vector2D vector2D = (item.Joint - BP).newNormalize();
|
||||
vector2D.X = 0.0;
|
||||
@@ -420,17 +420,17 @@ namespace _2DGAMELIB
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExpansionXY(this List<Joi> Joi, Vector2D BP, double Rate)
|
||||
public static void ExpansionXY(this List<JointPoint> Joi, Vector2D BP, double Rate)
|
||||
{
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint += (item.Joint - BP).newNormalize() * Rate;
|
||||
}
|
||||
}
|
||||
|
||||
public static void ExpansionXY(this List<Joi> Joi, ref Vector2D BP, double Rate)
|
||||
public static void ExpansionXY(this List<JointPoint> Joi, ref Vector2D BP, double Rate)
|
||||
{
|
||||
foreach (Joi item in Joi)
|
||||
foreach (JointPoint item in Joi)
|
||||
{
|
||||
item.Joint += (item.Joint - BP).newNormalize() * Rate;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user