Code cleanup.

This commit is contained in:
2023-04-19 13:31:17 +08:00
parent f664708165
commit cf6a7a795b
9 changed files with 27 additions and 31 deletions

View File

@@ -29,7 +29,10 @@ namespace Cryville.Crtr {
}
protected override void StartPreGraphicalUpdate(ContainerState s) {
base.StartPreGraphicalUpdate(s);
spos = Vector3.zero;
TransformAwake(s);
bpos = Position;
brot = Rotation;
}
protected override void StartGraphicalUpdate(ContainerState s) {
base.StartGraphicalUpdate(s);
@@ -46,11 +49,6 @@ namespace Cryville.Crtr {
pwp = Vector3.zero;
cpt = s.ScreenPoint;
ptime = s.Time;
if (s.CloneType == 3) {
spos = Vector3.zero;
bpos = cpt;
brot = Quaternion.Euler(s.Direction);
}
Position = pwp + cpt + spos;
Rotation = Quaternion.Euler(s.Direction);
}
@@ -112,7 +110,7 @@ namespace Cryville.Crtr {
protected override void EndGraphicalUpdate(ContainerState s) {
base.EndGraphicalUpdate(s);
EndUpdatePosition(s);
var p = pwp + cpt + spos;
var p = Position;
foreach (var i in sgos) {
i.AppendPoint(p, s.QuatDir);
i.Seal();