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
@@ -238,7 +238,7 @@ public sealed class LabSimulation
|
||||
return ((float)Math.Sin(radians), (float)Math.Cos(radians));
|
||||
}
|
||||
|
||||
public void Step(PlayerInput input, bool controlled = true, bool? anyControlled = null, Action? afterPhysics = null)
|
||||
public void Step(PlayerInput input, bool controlled = true, bool? anyControlled = null, Action? afterPhysics = null,Func<bool>? controlledAfterPhysics=null)
|
||||
{
|
||||
if (Noclip)
|
||||
{
|
||||
@@ -251,6 +251,7 @@ public sealed class LabSimulation
|
||||
// scene registry, original cadence or original collision response.
|
||||
StepPhysics();
|
||||
afterPhysics?.Invoke();
|
||||
if(controlledAfterPhysics!=null)controlled=controlledAfterPhysics();
|
||||
if (controlled && !InputAfterPlayerUpdate) StepInput(input);
|
||||
//42469F..4246DC runs independently of raw ownership.
|
||||
if (Grounded)
|
||||
@@ -288,6 +289,19 @@ public sealed class LabSimulation
|
||||
forceFall=true;CameraEye=sharedEye;
|
||||
}
|
||||
|
||||
public void EnterScooter()
|
||||
{
|
||||
CancelPoweredFlight(); //425120 only cancels mode1 jump/effect.
|
||||
TracksBubbleOrientation=true;
|
||||
}
|
||||
public void ApplyScooterTransform(Vector3 root,Vector3 rotation)
|
||||
{ApplyAuthoredTransform(root,rotation.Y);Pitch=rotation.X;Roll=rotation.Z;targetPitch=Pitch;targetRoll=Roll;targetYaw=Yaw;}
|
||||
public void LeaveScooter(Vector3 root,Vector3 rotation,Vector3 eye)
|
||||
{
|
||||
ApplyScooterTransform(root+Vector3.UnitY*40,rotation);
|
||||
Velocity=Vector3.Zero;extraAirAcceleration=0;CameraEye=eye;
|
||||
}
|
||||
|
||||
public void RocketImpact()
|
||||
{
|
||||
AdjustEnergy(-1);ScoreChanged?.Invoke(-1);CancelPoweredFlight();
|
||||
|
||||
Reference in new issue
Block a user