Code cleanup.

This commit is contained in:
2023-04-20 00:20:28 +08:00
parent 8670482c04
commit 93d9fdd4b8
3 changed files with 18 additions and 38 deletions

View File

@@ -275,7 +275,7 @@ namespace Cryville.Crtr {
public override int Priority { get { return -2; } }
public Motion() {
SubmitPropOp("motion", new PropOp.String(v => motion = v));
SubmitPropOp("motion", new PropOp.String(v => motion = v)); // TODO Obsolete
SubmitPropOp("name", new PropOp.Identifier(v => {
var n = new Identifier(v);
if (name == n) { }

View File

@@ -206,12 +206,8 @@ namespace Cryville.Crtr {
public float Value;
public Vec1() { Value = 0; }
public Vec1(float[] v) {
Value = v[0];
}
public Vec1(float i) {
Value = i;
}
public Vec1(float[] v) { Value = v[0]; }
public Vec1(float i) { Value = i; }
public override byte Dimension { get { return 1; } }
@@ -257,12 +253,8 @@ namespace Cryville.Crtr {
public int Value;
public VecI1() { Value = 0; }
public VecI1(float[] v) {
Value = (int)Math.Round(v[0]);
}
public VecI1(int i) {
Value = i;
}
public VecI1(float[] v) { Value = (int)v[0]; }
public VecI1(int i) { Value = i; }
public override byte Dimension { get { return 1; } }
@@ -308,12 +300,8 @@ namespace Cryville.Crtr {
public float Value;
public Vec1m() { Value = 1; }
public Vec1m(float[] v) {
Value = v[0];
}
public Vec1m(float i) : base() {
Value = i;
}
public Vec1m(float[] v) { Value = v[0]; }
public Vec1m(float i) : base() { Value = i; }
public override byte Dimension { get { return 1; } }
@@ -359,12 +347,8 @@ namespace Cryville.Crtr {
float x, y;
public Vec2() { x = y = 0; }
public Vec2(float[] v) {
x = v[0]; y = v[1];
}
public Vec2(float x, float y) {
this.x = x; this.y = y;
}
public Vec2(float[] v) { x = v[0]; y = v[1]; }
public Vec2(float x, float y) { this.x = x; this.y = y; }
public override byte Dimension { get { return 2; } }
@@ -419,12 +403,8 @@ namespace Cryville.Crtr {
float x, y, z;
public Vec3() { x = y = z = 0; }
public Vec3(float[] v) {
x = v[0]; y = v[1]; z = v[2];
}
public Vec3(float x, float y, float z) {
this.x = x; this.y = y; this.z = z;
}
public Vec3(float[] v) { x = v[0]; y = v[1]; z = v[2]; }
public Vec3(float x, float y, float z) { this.x = x; this.y = y; this.z = z; }
public override byte Dimension { get { return 3; } }

View File

@@ -41,7 +41,7 @@ namespace Cryville.Crtr {
var p = Position;
foreach (var i in sgos) {
i.Reset();
i.AppendPoint(p, s.QuatDir);
i.AppendPoint(p, Rotation);
}
}
}
@@ -50,7 +50,7 @@ namespace Cryville.Crtr {
cpt = s.ScreenPoint;
ptime = s.Time;
Position = pwp + cpt + spos;
Rotation = Quaternion.Euler(s.Direction);
Rotation = s.QuatDir;
}
Vector3 cpt; // Current point
@@ -82,11 +82,11 @@ namespace Cryville.Crtr {
ptime = s.Time;
Position = pwp + cpt + spos;
Rotation = Quaternion.Euler(s.Direction);
Rotation = s.QuatDir;
if (!RootTransform || s.CloneType == 3) return;
foreach (var i in sgos)
i.AppendPoint(Position, s.QuatDir);
i.AppendPoint(Position, Rotation);
}
else UpdatePosition(s);
}
@@ -98,7 +98,7 @@ namespace Cryville.Crtr {
ptime = s.Time;
length = 0;
Position = pwp + cpt + spos;
Rotation = Quaternion.Euler(s.Direction);
Rotation = s.QuatDir;
}
// TODO Fix anchor rotation
@@ -112,7 +112,7 @@ namespace Cryville.Crtr {
EndUpdatePosition(s);
var p = Position;
foreach (var i in sgos) {
i.AppendPoint(p, s.QuatDir);
i.AppendPoint(p, Rotation);
i.Seal();
}
}
@@ -134,7 +134,7 @@ namespace Cryville.Crtr {
pwp = wp;
ppt += dpt;
Position = pwp + cpt + spos;
Rotation = Quaternion.Euler(s.Direction);
Rotation = s.QuatDir;
}
}
}