Fix position and rotation of track anchors not set.
This commit is contained in:
@@ -133,7 +133,7 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
|
||||
Vector3 GetFramePoint(ContainerState state, float track) {
|
||||
return GetFrame(state, track, th => ((TrackHandler)th.Handler).GetCurrentWorldPoint());
|
||||
return GetFrame(state, track, th => th.Handler.Position);
|
||||
}
|
||||
|
||||
Quaternion GetFrameRotation(ContainerState state, float track) {
|
||||
|
@@ -35,7 +35,7 @@ namespace Cryville.Crtr {
|
||||
base.StartGraphicalUpdate(s);
|
||||
if (RootTransform) {
|
||||
TransformAwake(s);
|
||||
var p = GetCurrentWorldPoint();
|
||||
var p = Position;
|
||||
foreach (var i in sgos) {
|
||||
i.Reset();
|
||||
i.AppendPoint(p, s.QuatDir);
|
||||
@@ -51,6 +51,8 @@ namespace Cryville.Crtr {
|
||||
bpos = cpt;
|
||||
brot = Quaternion.Euler(s.Direction);
|
||||
}
|
||||
Position = pwp + cpt + spos;
|
||||
Rotation = Quaternion.Euler(s.Direction);
|
||||
}
|
||||
|
||||
Vector3 cpt; // Current point
|
||||
@@ -81,11 +83,12 @@ namespace Cryville.Crtr {
|
||||
ppt += dpt;
|
||||
|
||||
ptime = s.Time;
|
||||
Position = pwp + cpt + spos;
|
||||
Rotation = Quaternion.Euler(s.Direction);
|
||||
|
||||
if (!RootTransform || s.CloneType == 3) return;
|
||||
var p = GetCurrentWorldPoint();
|
||||
foreach (var i in sgos)
|
||||
i.AppendPoint(p, s.QuatDir);
|
||||
i.AppendPoint(Position, s.QuatDir);
|
||||
}
|
||||
else UpdatePosition(s);
|
||||
}
|
||||
@@ -96,19 +99,20 @@ namespace Cryville.Crtr {
|
||||
pwp = Vector3.zero;
|
||||
ptime = s.Time;
|
||||
length = 0;
|
||||
// Logger.LogFormat("main", 0, "Debug", "SV: {0}", cs.GetRawValue<Vec1m>("svm").Value);
|
||||
Position = pwp + cpt + spos;
|
||||
Rotation = Quaternion.Euler(s.Direction);
|
||||
}
|
||||
|
||||
// TODO Fix anchor rotation
|
||||
public override void Anchor() {
|
||||
base.Anchor();
|
||||
spos = bpos - GetCurrentWorldPoint();
|
||||
spos = bpos - Position;
|
||||
}
|
||||
|
||||
protected override void EndGraphicalUpdate(ContainerState s) {
|
||||
base.EndGraphicalUpdate(s);
|
||||
EndUpdatePosition(s);
|
||||
var p = GetCurrentWorldPoint();
|
||||
var p = pwp + cpt + spos;
|
||||
foreach (var i in sgos) {
|
||||
i.AppendPoint(p, s.QuatDir);
|
||||
i.Seal();
|
||||
@@ -131,10 +135,8 @@ namespace Cryville.Crtr {
|
||||
var wp = pwp + dwp; // World point
|
||||
pwp = wp;
|
||||
ppt += dpt;
|
||||
}
|
||||
|
||||
public Vector3 GetCurrentWorldPoint() {
|
||||
return pwp + cpt + spos;
|
||||
Position = pwp + cpt + spos;
|
||||
Rotation = Quaternion.Euler(s.Direction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user