Reconstruct lab story, interactions, patrol and jet pack practice flow
This commit is contained in:
1 parent
58424120bb
commit
c929f942e1
84 files changed
+7957
-305
No files matched your search
@@ -0,0 +1,31 @@
|
||||
using System.Numerics;
|
||||
using GamePort.Assets;
|
||||
using GamePort.Game;
|
||||
|
||||
namespace GamePort.Application;
|
||||
|
||||
/// <summary>Original C3DJetpackFire DEFAULT shape/texture, following the owner root/Euler.</summary>
|
||||
public sealed class JetpackVisuals
|
||||
{
|
||||
private readonly MorphAnimation clip;
|
||||
private readonly int offset;
|
||||
private readonly MeshDraw draw;
|
||||
public Mesh Mesh { get; }
|
||||
|
||||
public JetpackVisuals(Mesh combined, string preparedRoot)
|
||||
{
|
||||
clip = new MorphAnimation(Path.Combine(preparedRoot, "actors/jetpack/fire/animation.json"));
|
||||
offset = combined.Vertices.Length;
|
||||
Mesh = clip.AppendTo(combined, int.MinValue + 10_000);
|
||||
draw = Mesh.Draws[^1]; draw.Visible = false;
|
||||
}
|
||||
|
||||
public void Update(Mesh destination, LabSimulation owner)
|
||||
{
|
||||
draw.Visible = owner.JetpackEffectVisible;
|
||||
if (!draw.Visible) return;
|
||||
var model = Matrix4x4.CreateRotationY(-owner.Yaw * MathF.PI / 180)
|
||||
* Matrix4x4.CreateTranslation(owner.ActorRoot);
|
||||
clip.Sample(owner.Steps / 60d, destination.Vertices.AsSpan(offset, clip.Base.Vertices.Length), model);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user