Files
SlaveMatrix-SDL/SlaveMatrix/SlaveMatrix/BodyPartClasses/飛膜_根.cs
2025-05-07 10:45:18 -07:00

387 lines
13 KiB
C#

using _2DGAMELIB;
namespace SlaveMatrix
{
public class _根 : Ele
{
public Par X0Y0_飛膜;
public Par X0Y1_飛膜;
public ColorD CD;
public ColorP X0Y0_飛膜CP;
public ColorP X0Y1_飛膜CP;
public override bool
{
get
{
return _;
}
set
{
_ = value;
.IndexY = (_ ? 1 : 0);
}
}
public override bool
{
get
{
return _;
}
set
{
_ = value;
}
}
public override bool
{
get
{
return _;
}
set
{
_ = value;
}
}
public bool _表示
{
get
{
return X0Y0_飛膜.Dra;
}
set
{
X0Y0_飛膜.Dra = value;
X0Y1_飛膜.Dra = value;
X0Y0_飛膜.Hit = value;
X0Y1_飛膜.Hit = value;
}
}
public override bool
{
get
{
return _表示;
}
set
{
_表示 = value;
}
}
public override double
{
get
{
return CD.;
}
set
{
CD. = value;
}
}
public bool _外線
{
get
{
return X0Y0_飛膜.OP[(!) ? 3 : 0].Outline;
}
set
{
X0Y0_飛膜.OP[(!) ? 3 : 0].Outline = value;
X0Y1_飛膜.OP[(!) ? 10 : 0].Outline = value;
}
}
public _根(double DisUnit, , )
{
ThisType = GetType();
= new Difs(Sta.["飛膜根"]);
Pars pars = [0][0];
X0Y0_飛膜 = pars["飛膜"].ToPar();
pars = [0][1];
X0Y1_飛膜 = pars["飛膜"].ToPar();
Xasix = false;
.SetJoints();
= new JointD();
base. = ;
();
X0Y0_飛膜CP = new ColorP(X0Y0_飛膜, CD, DisUnit, abj: true);
X0Y1_飛膜CP = new ColorP(X0Y1_飛膜, CD, DisUnit, abj: true);
}
public void (_蝙 , _蝙 , _蝙 , Vector2D )
{
if (.IndexY == 0)
{
if ( || X_ || Y_)
{
(, , , );
}
else
{
(, , , );
}
}
else if ( || X_ || Y_)
{
(, , , );
}
else
{
(, , , );
}
}
private void (_蝙 , _蝙 , _蝙 , Vector2D )
{
Vector2D vector2D = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.JP[0].Joint));
Vector2D vector2D2 = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.OP[3].ps[1]));
X0Y0_飛膜.OP[0].ps[0] = vector2D;
X0Y0_飛膜.OP[0].ps[2] = vector2D2;
X0Y0_飛膜.OP[0].ps[1] = (X0Y0_飛膜.OP[0].ps[0] + X0Y0_飛膜.OP[0].ps[2]) * 0.5;
X0Y0_飛膜.OP[1].ps[0] = X0Y0_飛膜.OP[0].ps[2];
X0Y0_飛膜.OP[1].ps[2] = X0Y0_飛膜.ToLocal();
X0Y0_飛膜.OP[1].ps[1] = (X0Y0_飛膜.OP[1].ps[0] + X0Y0_飛膜.OP[1].ps[2]) * 0.5;
X0Y0_飛膜.OP[2].ps[0] = X0Y0_飛膜.OP[1].ps[2];
if ( == null)
{
if ( == null)
{
X0Y0_飛膜.OP[2].ps[2] = vector2D;
X0Y0_飛膜.OP[2].ps[1] = (X0Y0_飛膜.OP[2].ps[0] + X0Y0_飛膜.OP[2].ps[2]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[2].ps[1] += (vector2D3 = (vector2D2 - X0Y0_飛膜.OP[2].ps[1]) * 0.2);
}
else
{
X0Y0_飛膜.OP[2].ps[2] = X0Y0_飛膜.ToLocal(.X0Y0_獣翼下腕.ToGlobal(.X0Y0_獣翼下腕.JP[0].Joint));
X0Y0_飛膜.OP[2].ps[1] = (X0Y0_飛膜.OP[2].ps[0] + X0Y0_飛膜.OP[2].ps[2]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[2].ps[1] += (vector2D3 = (vector2D - X0Y0_飛膜.OP[2].ps[1]) * 0.2);
}
X0Y0_飛膜.OP[3].ps[0] = X0Y0_飛膜.OP[2].ps[2];
X0Y0_飛膜.OP[3].ps[2] = vector2D;
X0Y0_飛膜.OP[3].ps[1] = (X0Y0_飛膜.OP[3].ps[0] + X0Y0_飛膜.OP[3].ps[2]) * 0.5;
}
else
{
X0Y0_飛膜.OP[2].ps[2] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指3.ToGlobal(.X0Y0_小指_指3.OP[0].ps[0]));
X0Y0_飛膜.OP[2].ps[1] = (X0Y0_飛膜.OP[2].ps[0] + X0Y0_飛膜.OP[2].ps[2]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[2].ps[1] += (vector2D3 = (X0Y0_飛膜.ToLocal(.X0Y0_小指_指1.Position) - X0Y0_飛膜.OP[2].ps[1]) * 0.1);
X0Y0_飛膜.OP[3].ps[0] = X0Y0_飛膜.OP[2].ps[2];
X0Y0_飛膜.OP[3].ps[2] = vector2D;
X0Y0_飛膜.OP[3].ps[1] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指2.Position);
}
}
private void (_蝙 , _蝙 , _蝙 , Vector2D )
{
Vector2D vector2D = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.JP[0].Joint));
Vector2D vector2D2 = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.OP[0].ps[4]));
X0Y0_飛膜.OP[3].ps[2] = vector2D;
X0Y0_飛膜.OP[3].ps[0] = vector2D2;
X0Y0_飛膜.OP[3].ps[1] = (X0Y0_飛膜.OP[3].ps[2] + X0Y0_飛膜.OP[3].ps[0]) * 0.5;
X0Y0_飛膜.OP[2].ps[2] = X0Y0_飛膜.OP[3].ps[0];
X0Y0_飛膜.OP[2].ps[0] = X0Y0_飛膜.ToLocal();
X0Y0_飛膜.OP[2].ps[1] = (X0Y0_飛膜.OP[2].ps[2] + X0Y0_飛膜.OP[2].ps[0]) * 0.5;
X0Y0_飛膜.OP[1].ps[2] = X0Y0_飛膜.OP[2].ps[0];
if ( == null)
{
if ( == null)
{
X0Y0_飛膜.OP[1].ps[0] = vector2D;
X0Y0_飛膜.OP[1].ps[1] = (X0Y0_飛膜.OP[1].ps[2] + X0Y0_飛膜.OP[1].ps[0]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[1].ps[1] += (vector2D3 = (vector2D2 - X0Y0_飛膜.OP[1].ps[1]) * 0.2);
}
else
{
X0Y0_飛膜.OP[1].ps[0] = X0Y0_飛膜.ToLocal(.X0Y0_獣翼下腕.ToGlobal(.X0Y0_獣翼下腕.JP[0].Joint));
X0Y0_飛膜.OP[1].ps[1] = (X0Y0_飛膜.OP[1].ps[2] + X0Y0_飛膜.OP[1].ps[0]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[1].ps[1] += (vector2D3 = (vector2D - X0Y0_飛膜.OP[1].ps[1]) * 0.2);
}
X0Y0_飛膜.OP[0].ps[2] = X0Y0_飛膜.OP[1].ps[0];
X0Y0_飛膜.OP[0].ps[0] = vector2D;
X0Y0_飛膜.OP[0].ps[1] = (X0Y0_飛膜.OP[0].ps[2] + X0Y0_飛膜.OP[0].ps[0]) * 0.5;
}
else
{
X0Y0_飛膜.OP[1].ps[0] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指3.ToGlobal(.X0Y0_小指_指3.OP[2].ps[2]));
X0Y0_飛膜.OP[1].ps[1] = (X0Y0_飛膜.OP[1].ps[2] + X0Y0_飛膜.OP[1].ps[0]) * 0.5;
Vector2D vector2D3;
X0Y0_飛膜.OP[1].ps[1] += (vector2D3 = (X0Y0_飛膜.ToLocal(.X0Y0_小指_指1.Position) - X0Y0_飛膜.OP[1].ps[1]) * 0.1);
X0Y0_飛膜.OP[0].ps[2] = X0Y0_飛膜.OP[1].ps[0];
X0Y0_飛膜.OP[0].ps[0] = vector2D;
X0Y0_飛膜.OP[0].ps[1] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指2.Position);
}
}
private void (_蝙 , _蝙 , _蝙 , Vector2D )
{
Vector2D vector2D = X0Y1_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.JP[0].Joint));
Vector2D value = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.OP[3].ps[1]));
X0Y1_飛膜.OP[0].ps[0] = vector2D;
X0Y1_飛膜.OP[0].ps[2] = value;
X0Y1_飛膜.OP[0].ps[1] = (X0Y1_飛膜.OP[0].ps[0] + X0Y1_飛膜.OP[0].ps[2]) * 0.5;
X0Y1_飛膜.OP[1].ps[0] = X0Y1_飛膜.OP[0].ps[2];
X0Y1_飛膜.OP[1].ps[2] = X0Y1_飛膜.ToLocal();
X0Y1_飛膜.OP[1].ps[1] = (X0Y1_飛膜.OP[1].ps[0] + X0Y1_飛膜.OP[1].ps[2]) * 0.5;
Vector2D vector2D2 = X0Y1_飛膜.OP[1].ps[2];
Vector2D vector2D3 = (( != null) ? X0Y1_飛膜.ToLocal(.X0Y0_小指_指3.ToGlobal(.X0Y0_小指_指3.OP[0].ps[0])) : (( == null) ? vector2D : X0Y1_飛膜.ToLocal(.X0Y0_獣翼下腕.ToGlobal(.X0Y0_獣翼下腕.JP[0].Joint))));
Vector2D vector2D4 = (vector2D2 + vector2D3) * 0.5;
Vector2D v = vector2D2 - vector2D3;
double num = v.LengthSquared();
Vector2D vector2D5 = (X0Y1_飛膜.OP[2].ps[0] + X0Y1_飛膜.OP[9].ps[2]) * 0.5;
Vector2D v2 = X0Y1_飛膜.OP[2].ps[0] - X0Y1_飛膜.OP[9].ps[2];
double num2 = v2.LengthSquared();
double num3 = v2.Angle02π(Dat.Vec2DUnitX);
QuaternionD rotation = num3.RotationZQ();
QuaternionD rotation2 = (v2.Angle02π(v) - num3).RotationZQ();
double num4 = num / num2;
double num5 = vector2D5.X - vector2D5.X * num4;
Vector2D vector2D6 = vector2D4 - vector2D5;
for (int i = 0; i < 8; i++)
{
int index = i + 2;
for (int j = 0; j < X0Y1_飛膜.OP[index].ps.Count; j++)
{
Vector2D coord = X0Y1_飛膜.OP[index].ps[j].TransformCoordinateBP(vector2D5, rotation);
coord.X = coord.X * num4 + num5;
X0Y1_飛膜.OP[index].ps[j] = coord.TransformCoordinateBP(vector2D5, rotation2) + vector2D6;
}
}
X0Y1_飛膜.OP[2].ps[0] = vector2D2;
X0Y1_飛膜.OP[9].ps[2] = vector2D3;
X0Y1_飛膜.OP[10].ps[0] = vector2D3;
X0Y1_飛膜.OP[10].ps[2] = vector2D;
if ( == null)
{
X0Y1_飛膜.OP[10].ps[1] = (X0Y1_飛膜.OP[10].ps[0] + X0Y1_飛膜.OP[10].ps[2]) * 0.5;
}
else
{
X0Y1_飛膜.OP[10].ps[1] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指2.Position);
}
}
private void (_蝙 , _蝙 , _蝙 , Vector2D )
{
Vector2D vector2D = X0Y1_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.JP[0].Joint));
Vector2D value = X0Y0_飛膜.ToLocal(.X0Y0_獣翼上腕.ToGlobal(.X0Y0_獣翼上腕.OP[0].ps[4]));
X0Y1_飛膜.OP[10].ps[2] = vector2D;
X0Y1_飛膜.OP[10].ps[0] = value;
X0Y1_飛膜.OP[10].ps[1] = (X0Y1_飛膜.OP[10].ps[2] + X0Y1_飛膜.OP[10].ps[0]) * 0.5;
X0Y1_飛膜.OP[9].ps[2] = X0Y1_飛膜.OP[10].ps[0];
X0Y1_飛膜.OP[9].ps[0] = X0Y1_飛膜.ToLocal();
X0Y1_飛膜.OP[9].ps[1] = (X0Y1_飛膜.OP[9].ps[2] + X0Y1_飛膜.OP[9].ps[0]) * 0.5;
Vector2D vector2D2 = X0Y1_飛膜.OP[9].ps[0];
Vector2D vector2D3 = (( != null) ? X0Y1_飛膜.ToLocal(.X0Y0_小指_指3.ToGlobal(.X0Y0_小指_指3.OP[2].ps[2])) : (( == null) ? vector2D : X0Y1_飛膜.ToLocal(.X0Y0_獣翼下腕.ToGlobal(.X0Y0_獣翼下腕.JP[0].Joint))));
Vector2D vector2D4 = (vector2D2 + vector2D3) * 0.5;
Vector2D v = vector2D2 - vector2D3;
double num = v.LengthSquared();
Vector2D vector2D5 = (X0Y1_飛膜.OP[8].ps[2] + X0Y1_飛膜.OP[1].ps[0]) * 0.5;
Vector2D v2 = X0Y1_飛膜.OP[8].ps[2] - X0Y1_飛膜.OP[1].ps[0];
double num2 = v2.LengthSquared();
double num3 = v2.Angle02π(-Dat.Vec2DUnitX);
QuaternionD rotation = num3.RotationZQ();
QuaternionD rotation2 = (v2.Angle02π(v) - num3).RotationZQ();
double num4 = num / num2;
double num5 = vector2D5.X - vector2D5.X * num4;
Vector2D vector2D6 = vector2D4 - vector2D5;
for (int i = 0; i < 8; i++)
{
int index = 10 - (i + 2);
for (int j = 0; j < X0Y1_飛膜.OP[index].ps.Count; j++)
{
Vector2D coord = X0Y1_飛膜.OP[index].ps[j].TransformCoordinateBP(vector2D5, rotation);
coord.X = coord.X * num4 + num5;
X0Y1_飛膜.OP[index].ps[j] = coord.TransformCoordinateBP(vector2D5, rotation2) + vector2D6;
}
}
X0Y1_飛膜.OP[8].ps[2] = vector2D2;
X0Y1_飛膜.OP[1].ps[0] = vector2D3;
X0Y1_飛膜.OP[0].ps[2] = vector2D3;
X0Y1_飛膜.OP[0].ps[0] = vector2D;
if ( == null)
{
X0Y1_飛膜.OP[0].ps[1] = (X0Y1_飛膜.OP[0].ps[2] + X0Y1_飛膜.OP[0].ps[0]) * 0.5;
}
else
{
X0Y1_飛膜.OP[0].ps[1] = X0Y0_飛膜.ToLocal(.X0Y0_小指_指2.Position);
}
}
public override void ()
{
if (.IndexY == 0)
{
X0Y0_飛膜CP.Update();
}
else
{
X0Y1_飛膜CP.Update();
}
}
public override void (Vector2D[] mm)
{
if (.IndexY == 0)
{
X0Y0_飛膜CP.Update(mm);
}
else
{
X0Y1_飛膜CP.Update(mm);
}
}
private void ( )
{
switch ()
{
case .N0:
N0();
break;
case .T0:
T0();
break;
case .T1:
T1();
break;
default:
N0();
break;
}
}
private void N0( )
{
CD = new ColorD(ref Col.Black, ref .R);
}
private void T0( )
{
CD = new ColorD(ref Col.Black, ref .R);
}
private void T1( )
{
CD = new ColorD(ref Col.Black, ref .R);
}
}
}