mirror of
https://github.com/4sval/FModel.git
synced 2026-03-22 01:34:37 -05:00
teleport at computed position
This commit is contained in:
parent
835d5f9d40
commit
c596f85c55
|
|
@ -36,13 +36,13 @@ public class Camera
|
|||
}
|
||||
|
||||
public void Setup(FBox box) => Teleport(FVector.ZeroVector, box, true);
|
||||
public void Teleport(FVector instancePos, FBox box, bool updateAll = false)
|
||||
public void Teleport(Vector3 instancePos, FBox box, bool updateAll = false)
|
||||
{
|
||||
box.GetCenterAndExtents(out var center, out var extents);
|
||||
center += instancePos;
|
||||
center += new FVector(instancePos.X, instancePos.Z, instancePos.Y);
|
||||
var distance = extents.AbsMax();
|
||||
|
||||
Position = new Vector3(instancePos.X, center.Z, instancePos.Y + distance * 2);
|
||||
Position = new Vector3(instancePos.X, center.Z, instancePos.Z + distance * 2);
|
||||
Direction = new Vector3(center.X, center.Z, center.Y);
|
||||
if (updateAll)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ Snooper aims to give an accurate preview of models, materials, skeletal animatio
|
|||
ImGui.EndDisabled();
|
||||
if (ImGui.Selectable("Teleport To"))
|
||||
{
|
||||
var instancePos = model.Transforms[model.SelectedInstance].Position;
|
||||
var instancePos = model.Transforms[model.SelectedInstance].Matrix.Translation;
|
||||
s.Renderer.CameraOp.Teleport(instancePos, model.Box);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user