Implement source-backed Scooter vehicle in tutorial and outside
This commit is contained in:
1 parent
8df5e81070
commit
62c07a3d59
44 files changed
+3135
-174
No files matched your search
+83
-10
@@ -33,6 +33,8 @@ internal static class Program
|
||||
catch (Exception error) { Console.Error.WriteLine(error); return 1; }
|
||||
}
|
||||
|
||||
private static int ScooterEngineFrequency(int baseFrequency,float speed)=>Math.Max(7000,(int)(baseFrequency+(double)speed*(1/1.9)*51));
|
||||
|
||||
private static string? Option(string[] args, string name)
|
||||
{
|
||||
var i = Array.IndexOf(args, name);
|
||||
@@ -90,6 +92,7 @@ internal static class Program
|
||||
--smoke-shrink-ray Fire at an actual VR04 soldier; explicit player-placement fixture
|
||||
--smoke-invisible Accelerated recharge/activation/flash/expiry/unequip fixture in VR03
|
||||
--smoke-baseball VR07 aim/release/flight/target/respawn fixture
|
||||
--smoke-scooter VR05 / outside summon-drive-cleanup replay
|
||||
--smoke-grappler VR08 attach/reel/swing/cleanup fixture
|
||||
--smoke-rocketship VR02 flight/turn/roll/control fixture
|
||||
--smoke-bubble VR01 expand/throttle/bounce/cleanup/fade input fixture
|
||||
@@ -265,6 +268,7 @@ internal static class Program
|
||||
var invisibleSmoke = args.Contains("--smoke-invisible");
|
||||
var bubbleSmoke = args.Contains("--smoke-bubble");
|
||||
var baseballSmoke = args.Contains("--smoke-baseball");
|
||||
var scooterSmoke=args.Contains("--smoke-scooter");
|
||||
var grapplerSmoke = args.Contains("--smoke-grappler");
|
||||
var rocketSmoke = args.Contains("--smoke-rocketship");
|
||||
var carlSmoke = args.Contains("--smoke-carl-cutscene");
|
||||
@@ -287,7 +291,7 @@ internal static class Program
|
||||
var defaultStory = (defaultScene || args.Contains("--walk")) && !args.Contains("--inspect") && !walkSmoke && !args.Contains("--smoke-window")
|
||||
&& animationPath == null && !args.Contains("--time");
|
||||
var story = defaultStory || loadedSave != null || saveOutput != null || args.Contains("--story") || args.Contains("--story-time")
|
||||
|| args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || gadgetWindowSmoke || practiceWindowSmoke || practiceReturnSmoke || carlSmoke || controlPhaseSmoke || objectiveSmoke;
|
||||
|| args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || scooterSmoke || gadgetWindowSmoke || practiceWindowSmoke || practiceReturnSmoke || carlSmoke || controlPhaseSmoke || objectiveSmoke;
|
||||
if (story && (args.Contains("--inspect") || walkSmoke || args.Contains("--smoke-window")))
|
||||
throw new ArgumentException("Story playback requires its own simulation mode.");
|
||||
if (walkSmoke && args.Contains("--inspect")) throw new ArgumentException("Walk smoke cannot run in inspection mode.");
|
||||
@@ -320,6 +324,8 @@ internal static class Program
|
||||
SceneBaseballs? baseballs = null;
|
||||
BaseballVisuals? baseballVisuals = null;
|
||||
BaseballAimOverlay? baseballAim = null;
|
||||
Scooter? scooter=null;
|
||||
ScooterVisuals? scooterVisuals=null;
|
||||
Rocketship? rocketship = null;
|
||||
RocketshipVisuals? rocketshipVisuals = null;
|
||||
GrapplerVisuals? grapplerVisuals = null;
|
||||
@@ -351,7 +357,7 @@ internal static class Program
|
||||
var standingPose = AseMesh.Load(AssetPath.Resolve(root, "ASE/jimstop.ase"));
|
||||
if (walking)
|
||||
{
|
||||
var cameraRay = level!.Code is "LV1B" or "VR01" or "VR02" or "VR04" or "VR07" or "VR08" or "LEV1"
|
||||
var cameraRay = level!.Code is "LV1B" or "VR01" or "VR02" or "VR04" or "VR05" or "VR07" or "VR08" or "LEV1"
|
||||
? OriginalCameraRay.FromRouteScene(world, level.Code) : null;
|
||||
debugCameraRay = cameraRay;
|
||||
simulation = new LabSimulation(new SceneCollision(world), standingPose, originalStart.Position, originalStart.Rotation.Y,
|
||||
@@ -398,13 +404,23 @@ internal static class Program
|
||||
simulation!.Energy = interactions.Energy;
|
||||
simulation.JetpackInventoryState = () => interactions.Inventory.State(0, 3);
|
||||
simulation.ScoreChanged += interactions.ChangeScore;
|
||||
if(level.Code is "VR05" or "LEV1")
|
||||
{
|
||||
if(director.FindActor("C3DGODDARD")==null)
|
||||
{
|
||||
var behind=simulation.ActorRoot+RocketOrientation.Rotate(new(0,0,-250),new(0,simulation.Yaw,0));
|
||||
var ray=OriginalCameraRay.FromRouteScene(world,level.Code);
|
||||
director.EnsureCompanion(ray.TraceGeometry(simulation.ActorRoot,behind)==null?behind:originalStart!.Position,Vector3.Zero);
|
||||
}
|
||||
scooter=new(director.AddOwnedActor("C3DJEEP","3JEE",Vector3.Zero),world,level.Code);
|
||||
}
|
||||
if(level.Code=="VR02")rocketship=new(director.Actors.Single(a=>a.Kind=="3ROC"),world,level.Code);
|
||||
if (level.Code is "LV1B" or "VR04" or "LEV1")
|
||||
{
|
||||
gadgets = new SceneGadgets(director,interactions.Inventory,simulation,world);
|
||||
gadgets.ScoreAwarded += interactions.ChangeScore;
|
||||
}
|
||||
if(level.Code is "LV1B" or "VR01" or "VR04" or "VR07" or "VR08" or "LEV1")
|
||||
if(level.Code is "LV1B" or "VR01" or "VR04" or "VR05" or "VR07" or "VR08" or "LEV1")
|
||||
{
|
||||
baseballs=new(director,simulation,world);
|
||||
baseballs.ScoreAwarded+=interactions.ChangeScore;
|
||||
@@ -437,6 +453,7 @@ internal static class Program
|
||||
grounded = resolved.Supported;
|
||||
return new(resolved.Body.Position, resolved.Body.Velocity);
|
||||
});
|
||||
patrol.FollowPlayer=actor.Kind=="3DOG"&&level!.Code is "VR05" or "LEV1";
|
||||
patrols.Add(actor.Tag, patrol);
|
||||
director.RegisterPatrolConsumer(actor.Tag);
|
||||
director.ActorChanged += changed => { if (ReferenceEquals(changed, actor)) patrol.SynchronizeAuthoredState(); };
|
||||
@@ -461,6 +478,11 @@ internal static class Program
|
||||
}
|
||||
else simulation.DynamicRootResolver = (previous, position, radius) =>
|
||||
DynamicBodyResponse.Resolve(staticVisuals.DoorColliders(), previous, position, radius);
|
||||
if(scooter!=null)
|
||||
{
|
||||
scooter.DynamicRootResolver=(a,b,r)=>DynamicBodyResponse.Resolve(staticVisuals.DoorColliders(),a,b,r);
|
||||
scooterVisuals=new(mesh,Path.GetFullPath(Path.Combine(Path.GetDirectoryName(scene!)!,"..")));mesh=scooterVisuals.Mesh;
|
||||
}
|
||||
jetpackVisuals = new JetpackVisuals(mesh, Path.GetFullPath(Path.Combine(Path.GetDirectoryName(scene!)!, "..")));
|
||||
mesh = jetpackVisuals.Mesh;
|
||||
bubbleVisuals = new(mesh,Path.GetFullPath(Path.Combine(Path.GetDirectoryName(scene!)!,"..")));
|
||||
@@ -520,7 +542,7 @@ internal static class Program
|
||||
var storyTime = double.Parse(Option(args, "--story-time") ?? "0", System.Globalization.CultureInfo.InvariantCulture);
|
||||
if (!double.IsFinite(storyTime) || storyTime < 0 || storyTime > 3600 || storyTime > 0 && !headless)
|
||||
throw new ArgumentException("Story time must be0..3600 seconds in headless mode.");
|
||||
var frames = int.Parse(Option(args, "--frames") ?? (grapplerSmoke ? "9" : rocketSmoke ? "10" : walkSmoke ? "240" : jetpackSmoke ? "300" : shrinkSmoke ? "90" : invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke ? "8" : gadgetWindowSmoke ? "24" : objectiveWindowSmoke ? "180" : carlSmoke ? "60" : controlPhaseSmoke ? "32" : toolsSmoke ? "20" : debugSmoke ? "16" : diagnosticsSmoke ? "24" : headless ? "1" : "0"));
|
||||
var frames = int.Parse(Option(args, "--frames") ?? (scooterSmoke ? "10" : grapplerSmoke ? "9" : rocketSmoke ? "10" : walkSmoke ? "240" : jetpackSmoke ? "300" : shrinkSmoke ? "90" : invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke ? "8" : gadgetWindowSmoke ? "24" : objectiveWindowSmoke ? "180" : carlSmoke ? "60" : controlPhaseSmoke ? "32" : toolsSmoke ? "20" : debugSmoke ? "16" : diagnosticsSmoke ? "24" : headless ? "1" : "0"));
|
||||
if (gadgetWindowSmoke && (headless || level?.Code != "LV1B" || loadedSave != null || frames < 24))
|
||||
throw new ArgumentException("Gadget menu SDL fixture requires a fresh windowed lab and24 frames");
|
||||
if (shrinkSmoke && (level?.Code != "VR04" || gadgets == null || frames < 60))
|
||||
@@ -531,6 +553,8 @@ internal static class Program
|
||||
throw new ArgumentException("Bubble smoke requires a fresh VR01 and at least8 frames");
|
||||
if(baseballSmoke && (level?.Code!="VR07" || frames<8 || loadedSave!=null))
|
||||
throw new ArgumentException("Baseball fixture requires a fresh VR07 and at least8 frames");
|
||||
if(scooterSmoke&&(scooter==null||frames<10||loadedSave!=null))
|
||||
throw new ArgumentException("Scooter replay requires fresh VR05 or outsideLEV1 and10 frames");
|
||||
if(grapplerSmoke&&(level?.Code!="VR08"||frames<9||loadedSave!=null))
|
||||
throw new ArgumentException("Grappler fixture requires fresh VR08 and at least9 frames");
|
||||
if(rocketSmoke&&(level?.Code!="VR02"||frames<10||loadedSave!=null))
|
||||
@@ -559,7 +583,7 @@ internal static class Program
|
||||
var height = uint.Parse(Option(args, "--height") ?? "720");
|
||||
if (width is < 64 or > 8192 || height is < 64 or > 8192) throw new ArgumentException("Viewport dimensions must be64..8192");
|
||||
using var playerBinding = director == null ? null
|
||||
: new PlayerSceneBinding(director, simulation!, interactions!.Inventory, level!.Player!.Tag!,rocketship);
|
||||
: new PlayerSceneBinding(director, simulation!, interactions!.Inventory, level!.Player!.Tag!,rocketship,scooter);
|
||||
var renderer = presentation.LoadScene(mesh, texture, headless,
|
||||
walking ? WalkTitle : animations?.WindowTitle ?? "Jimmy Neutron — scene preview | C camera",
|
||||
width, height, !args.Contains("--no-validation"));
|
||||
@@ -570,6 +594,8 @@ internal static class Program
|
||||
InvisibleSmoke? invisibleFixture = null;
|
||||
BubbleSmoke? bubbleFixture = null;
|
||||
BaseballSmoke? baseballFixture = null;
|
||||
ScooterSmoke? scooterFixture=null;
|
||||
var sawScooterKeys=0;
|
||||
GrapplerSmoke? grapplerFixture=null;
|
||||
RocketshipSmoke? rocketFixture=null;
|
||||
var sawRocketKeys=0;
|
||||
@@ -581,6 +607,7 @@ internal static class Program
|
||||
using var audio = Option(args, "--audio") is { } audioFile
|
||||
? new SdlAudio(audioFile, args.Contains("--loop-audio"), debugMenu.Open) : null;
|
||||
using var sceneAudio = resources != null && !headless && !args.Contains("--mute") ? new SceneAudio(resources) : null;
|
||||
using var scooterLifetime=scooter;
|
||||
using var grapplerLifetime = simulation?.Grappler;
|
||||
if(simulation?.Grappler is{} grapplerAudio)
|
||||
{
|
||||
@@ -593,6 +620,12 @@ internal static class Program
|
||||
simulation.GadgetSound += (id,loop) => sceneAudio?.Effect(id,loop?"bubble":null);
|
||||
simulation.BubbleSoundStopped += () => sceneAudio?.StopLoop("bubble");
|
||||
}
|
||||
if(scooter!=null)
|
||||
{
|
||||
scooter.EngineStarted+=()=>sceneAudio?.Effect(46,"scooter");
|
||||
scooter.EngineStopped+=()=>sceneAudio?.StopLoop("scooter");
|
||||
scooter.EngineSpeedChanged+=speed=>sceneAudio?.TuneLoop("scooter",baseFrequency=>ScooterEngineFrequency(baseFrequency,speed));
|
||||
}
|
||||
if(baseballs!=null)baseballs.Sound+=id=>sceneAudio?.Effect(id);
|
||||
if(rocketship!=null)
|
||||
{
|
||||
@@ -643,7 +676,7 @@ internal static class Program
|
||||
Console.WriteLine($"Practice RETURN: exact saved root={restored}, root={simulation.ActorRoot}, STRT yaw={simulation.Yaw}, intro suppressed={!director.Playing}, companion restored={companionRestored}, retained player input order={simulation.InputAfterPlayerUpdate}, gadget availability={interactions.Inventory.State(0, 3)}.");
|
||||
if (!restored) throw new InvalidOperationException("RETURN did not restore the live departure root without replaying STRT actions");
|
||||
}
|
||||
if (args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || gadgetWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke || controlPhaseSmoke) { sceneAudio?.StopSpeech(); director.Skip(); }
|
||||
if (args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || scooterSmoke || gadgetWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke || controlPhaseSmoke) { sceneAudio?.StopSpeech(); director.Skip(); }
|
||||
if (gadgetWindowSmoke) { interactions!.Inventory.SetState(0,3,1); interactions.Inventory.SelectGadget(3); }
|
||||
if (controlPhaseSmoke)
|
||||
{
|
||||
@@ -725,6 +758,7 @@ internal static class Program
|
||||
}
|
||||
if (invisibleSmoke) invisibleFixture = new(simulation!,interactions!.Inventory);
|
||||
if(baseballSmoke)baseballFixture=new(simulation!,playerBinding!,interactions!.Inventory,baseballs!,director);
|
||||
if(scooterSmoke)scooterFixture=new(simulation!,playerBinding!,director,interactions!,level!.Code);
|
||||
if(grapplerSmoke)grapplerFixture=new(simulation!,playerBinding!,director,interactions!);
|
||||
if(rocketSmoke)rocketFixture=new(simulation!,playerBinding!,director,interactions!);
|
||||
if (bubbleSmoke) bubbleFixture = new(simulation!,interactions!.Inventory);
|
||||
@@ -820,6 +854,12 @@ internal static class Program
|
||||
if (practice.Active) practice.Key(17, Vector2.Zero);
|
||||
playerBinding?.ResetVehicle();simulation.Reset(); poseTime = 0; sceneAudio?.StopSpeech(); director?.Begin(originalStart!);
|
||||
rocketship?.Reset();
|
||||
if(scooter!=null)
|
||||
{
|
||||
var behind=simulation.ActorRoot+RocketOrientation.Rotate(new(0,0,-250),new(0,simulation.Yaw,0));
|
||||
var ray=OriginalCameraRay.FromRouteScene(world,level!.Code);
|
||||
director!.EnsureCompanion(ray.TraceGeometry(simulation.ActorRoot,behind)==null?behind:originalStart!.Position,Vector3.Zero);
|
||||
}
|
||||
interactions?.Reset(); mechanisms?.Reset(); gadgets?.Reset(); baseballs?.Reset(); mouseFire = false;
|
||||
director?.SyncActor(level!.Player!.Tag!, simulation.ActorRoot, new Vector3(0, simulation.Yaw, 0));
|
||||
}
|
||||
@@ -920,6 +960,11 @@ internal static class Program
|
||||
debugMenu.Message=rocketship?.Mounted==true?"ROCKETSHIP EQUIPPED - ARROWS FLY, ENTER/T TURN, R ROLL":
|
||||
"ROCKETSHIP GIVEN - SELECT ITS PRACTICE TILE TO FLY IN VR02";
|
||||
break;
|
||||
case DebugAction.GiveScooter when interactions != null:
|
||||
interactions.Inventory.SetState(0,4,1);interactions.Inventory.SelectGadget(4);
|
||||
debugMenu.Message=scooter?.Spawned==true?"SCOOTER SUMMONED AT GODDARD - WALK INTO IT TO MOUNT":
|
||||
"SCOOTER GIVEN - AVAILABLE IN VR05 AND OUTSIDE";
|
||||
break;
|
||||
case DebugAction.GiveGrappler when interactions != null:
|
||||
interactions.Inventory.SetState(0,7,1);interactions.Inventory.SelectGadget(7);
|
||||
debugMenu.Message=simulation?.GadgetMode==7?"GRAPPLER EQUIPPED - FIRE ATTACH/REEL, JUMP DETACH":
|
||||
@@ -990,6 +1035,11 @@ internal static class Program
|
||||
}
|
||||
while (running)
|
||||
{
|
||||
scooterFixture?.BeforeFrame(count,(key,down)=>
|
||||
{
|
||||
var e=new Sdl.Event{Type=down?Sdl.KeyDown:Sdl.KeyUp,Scancode=key,Down=down?(byte)1:(byte)0};
|
||||
if(!Sdl.SDL_PushEvent(ref e))throw new InvalidOperationException(Sdl.Error);
|
||||
},headless);
|
||||
grapplerFixture?.BeforeFrame(count,(key,down)=>
|
||||
{
|
||||
var e=new Sdl.Event{Type=down?Sdl.KeyDown:Sdl.KeyUp,Scancode=key,Down=down?(byte)1:(byte)0};
|
||||
@@ -1061,6 +1111,8 @@ internal static class Program
|
||||
}
|
||||
while (!headless && Sdl.SDL_PollEvent(out var e))
|
||||
{
|
||||
if(scooterSmoke&&e.Type==Sdl.KeyDown)
|
||||
sawScooterKeys|=e.Scancode switch{81=>1,82=>2,80=>4,225=>8,43=>16,60=>32,21=>64,_=>0};
|
||||
if(grapplerSmoke&&e.Type==Sdl.KeyDown)
|
||||
sawGrapplerKeys|=e.Scancode switch{80=>1,224=>2,82=>4,225=>8,60=>16,_=>0};
|
||||
if(rocketSmoke&&e.Type==Sdl.KeyDown)
|
||||
@@ -1193,12 +1245,13 @@ internal static class Program
|
||||
}
|
||||
}
|
||||
if (debugMenu.Open) animationStarted += elapsed;
|
||||
if (simulation != null && !debugMenu.Open && !inspecting && !practice.Active && gadgetScreen?.Open != true && (active || headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || gadgetWindowSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke))
|
||||
if (simulation != null && !debugMenu.Open && !inspecting && !practice.Active && gadgetScreen?.Open != true && (active || headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || scooterSmoke || gadgetWindowSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke))
|
||||
{
|
||||
var steps = headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || gadgetWindowSmoke || practiceWindowSmoke || carlSmoke || controlPhaseSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke ? 1 : stepClock.Advance(elapsed);
|
||||
var steps = headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || bubbleSmoke || baseballSmoke || rocketSmoke || grapplerSmoke || scooterSmoke || gadgetWindowSmoke || practiceWindowSmoke || carlSmoke || controlPhaseSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke ? 1 : stepClock.Advance(elapsed);
|
||||
for (var step = 0; step < steps; step++)
|
||||
{
|
||||
var input = carlSmoke || controlPhaseSmoke ? new PlayerInput(true, false, true, false, true)
|
||||
: scooterSmoke && headless ? ScooterSmoke.Input(count,level!.Code)
|
||||
: grapplerSmoke && headless ? GrapplerSmoke.Input(count)
|
||||
: rocketSmoke && headless ? RocketshipSmoke.Input(count)
|
||||
: baseballSmoke && headless ? BaseballSmoke.Input(count)
|
||||
@@ -1220,6 +1273,7 @@ internal static class Program
|
||||
bool acceptsInput;
|
||||
if (playerBinding != null) acceptsInput = playerBinding.Step(input);
|
||||
else { simulation.Step(input); acceptsInput = true; }
|
||||
scooterFixture?.Received(input);
|
||||
grapplerFixture?.Received(input);
|
||||
rocketFixture?.Received(input);
|
||||
gadgets?.StepTimers(FixedStepClock.Step);
|
||||
@@ -1235,7 +1289,7 @@ internal static class Program
|
||||
if (!simulation.Noclip)
|
||||
{
|
||||
director?.Touch(level!.Player!.Tag!, simulation.ActorRoot);
|
||||
interactions?.Update(simulation.ActorRoot, simulation.InteractionRadius,rocketship is{Mounted:true}?rocketship.Actor:null);
|
||||
interactions?.Update(simulation.ActorRoot, simulation.InteractionRadius,rocketship is{Mounted:true}?rocketship.Actor:scooter is{Mounted:true}?scooter.Actor:null);
|
||||
}
|
||||
if (practice.Active) { keys.Clear(); mouseJump = false; stepClock.Reset(); break; }
|
||||
if (!simulation.Noclip) mechanisms?.Update(simulation.ActorRoot, simulation.InteractionRadius);
|
||||
@@ -1278,6 +1332,11 @@ internal static class Program
|
||||
view = Matrix4x4.CreateLookAtLeftHanded(simulation.CameraEye, simulation.CameraTarget, Vector3.UnitY);
|
||||
renderEye = simulation.CameraEye; renderTarget = simulation.CameraTarget;
|
||||
}
|
||||
if(!inspecting&&scooter is{Mounted:true})
|
||||
{
|
||||
renderEye=scooter.CameraEye;renderTarget=scooter.CameraTarget;
|
||||
view=Matrix4x4.CreateLookAtLeftHanded(renderEye,renderTarget,Vector3.UnitY);
|
||||
}
|
||||
if(!inspecting&&rocketship is{Mounted:true})
|
||||
{
|
||||
renderEye=rocketship.CameraEye;renderTarget=rocketship.CameraTarget;
|
||||
@@ -1300,6 +1359,7 @@ internal static class Program
|
||||
if(rocketship!=null)rocketshipVisuals?.Update(mesh,rocketship,rocketship.FrameSteps/60d,simulation!.Appearance);
|
||||
if(simulation?.Grappler is{} grapplerRender)grapplerVisuals?.Update(mesh,grapplerRender,simulation.ActorRoot,
|
||||
new(simulation.Pitch,simulation.Yaw,simulation.Roll),poseTime,simulation.Appearance,renderEye,renderTarget);
|
||||
if(scooter!=null)scooterVisuals?.Update(mesh,scooter,scooter.FrameSteps/60d,simulation!.Appearance);
|
||||
spriteVisuals?.FaceCamera(renderEye, renderTarget, mesh);
|
||||
objectivePanel?.Key(keys.Contains(18) && !debugMenu.Open && !inspecting && !practice.Active && gadgetScreen?.Open != true
|
||||
&& director is { Controlled: true, InventoryEnabled: true });
|
||||
@@ -1334,6 +1394,7 @@ internal static class Program
|
||||
: simulation?.Bubble.Collapsing==true ? "FADE" : "OFF",
|
||||
BaseballState=simulation==null?"OFF":$"{(simulation.Baseball.Equipped?"ON":"OFF")} AIM {simulation.Baseball.SavedPitch:F1} PENDING {simulation.Baseball.PendingThrow} THROWS {simulation.Baseball.Throws}",
|
||||
GrapplerState=simulation?.Grappler is{} g?$"{(g.Attached?"ON":"OFF")} LEN {g.Memory.Length:F1} FIRST {g.Memory.FirstLength:F1} HIT {g.Contacts}":null,
|
||||
ScooterState=scooter==null?null:$"{(scooter.Mounted?"RIDE":scooter.Spawned?"PARK":"OFF")} SPEED {scooter.Steering.Speed:F1} WHEELS {scooter.FrontSupports}/{scooter.RearSupports}",
|
||||
RocketshipState=rocketship==null?null:$"{(rocketship.Mounted?"ON":"OFF")} SPEED {rocketship.Steering.Speed:F1} VY {rocketship.Velocity.Y:F1} HIT {rocketship.Contacts}",
|
||||
BodyRadius = simulation?.InteractionRadius ?? 60, BodyFactor=simulation?.BodyFactor ?? 1.265f,
|
||||
Objective = interactions?.CurrentObjective ?? 0, ObjectiveTime = objectivePanel?.Elapsed ?? 0,
|
||||
@@ -1366,7 +1427,7 @@ internal static class Program
|
||||
}
|
||||
if (simulation != null && characterDraw != null)
|
||||
{
|
||||
characterDraw.Visible=rocketship?.Mounted!=true && simulation.Grappler?.SwingPose!=true;
|
||||
characterDraw.Visible=rocketship?.Mounted!=true && scooter?.Mounted!=true && simulation.Grappler?.SwingPose!=true;
|
||||
PlayerGadgetMaterial.Apply(characterDraw,simulation.Appearance);
|
||||
var color=simulation.Appearance.Color;
|
||||
for(var i=0;i<animations!.Current.Base.Vertices.Length;i++)
|
||||
@@ -1374,6 +1435,12 @@ internal static class Program
|
||||
}
|
||||
renderer.UpdateVertices(mesh.Vertices);
|
||||
renderer.Render(view * projection);
|
||||
if(scooterFixture!=null)
|
||||
{
|
||||
scooterFixture.AfterFrame(count);
|
||||
if(ScooterSmoke.StageName(count) is{} stage&&Option(args,"--screenshot") is{} capture)
|
||||
renderer.SavePpm(Path.ChangeExtension(capture,$".{stage}.ppm"));
|
||||
}
|
||||
if(grapplerFixture!=null)
|
||||
{
|
||||
grapplerFixture.AfterFrame(count);
|
||||
@@ -1678,6 +1745,12 @@ internal static class Program
|
||||
if(!headless)Console.WriteLine($"Baseball SDL keys received: {sawBaseballKeys==15}.");
|
||||
if(!baseballFixture.Passed || !headless && sawBaseballKeys!=15)return 2;
|
||||
}
|
||||
if(scooterFixture!=null)
|
||||
{
|
||||
Console.WriteLine(scooterFixture.Report);
|
||||
if(!headless)Console.WriteLine($"Scooter SDL keys received: {sawScooterKeys==127}.");
|
||||
if(!scooterFixture.Passed||!headless&&sawScooterKeys!=127)return 2;
|
||||
}
|
||||
if(grapplerFixture!=null)
|
||||
{
|
||||
Console.WriteLine(grapplerFixture.Report);
|
||||
|
||||
Reference in new issue
Block a user