decals
This commit is contained in:
@@ -51,7 +51,7 @@ public partial class WheelPowertrain : PowertrainComponent
|
||||
|
||||
Wheel.AutoSimulate = false;
|
||||
Wheel.StepPhys( Controller, dt );
|
||||
|
||||
|
||||
return Math.Abs( Wheel.CounterTorque );
|
||||
}
|
||||
|
||||
|
||||
@@ -105,15 +105,15 @@ public abstract partial class VeloXBase
|
||||
}
|
||||
private void UpdateInput()
|
||||
{
|
||||
VerticalInput = TotalSpeed < 10 ? Input.AnalogMove.x * 0.5f : Input.AnalogMove.x;
|
||||
Handbrake = Input.Down( "Jump" ) ? 1 : 0;
|
||||
VerticalInput = Input.AnalogMove.x;
|
||||
Handbrake = Input.Down( "Handbrake" ) ? 1 : 0;
|
||||
|
||||
SteeringAngle = Input.AnalogMove.y;
|
||||
|
||||
IsClutching = (Input.Down( "Run" ) || Input.Down( "Jump" )) ? 1 : 0;
|
||||
IsClutching = Input.Down( "Clutch" ) ? 1 : 0;
|
||||
|
||||
IsShiftingUp = Input.Pressed( "Attack1" );
|
||||
IsShiftingDown = Input.Pressed( "Attack2" );
|
||||
IsShiftingUp = Input.Pressed( "Shift Up" );
|
||||
IsShiftingDown = Input.Pressed( "Shift Down" );
|
||||
|
||||
if ( TotalSpeed < 150 && Driver is null )
|
||||
Handbrake = 1;
|
||||
@@ -143,6 +143,13 @@ public abstract partial class VeloXBase
|
||||
Input.TriggerHaptics( leftMotor, rightMotor, leftTrigger, rightTrigger, duration );
|
||||
}
|
||||
}
|
||||
public void TriggerHaptics( HapticEffect effect, float lengthScale = 1, float frequencyScale = 1, float amplitudeScale = 1 )
|
||||
{
|
||||
if ( IsDriverActive )
|
||||
{
|
||||
Input.TriggerHaptics( effect, lengthScale, frequencyScale, amplitudeScale );
|
||||
}
|
||||
}
|
||||
|
||||
public void StopAllHaptics()
|
||||
{
|
||||
|
||||
@@ -52,11 +52,13 @@ public abstract partial class VeloXBase : Component, Component.ICollisionListene
|
||||
{
|
||||
var hardSound = Sound.Play( HardCollisionSound, WorldPosition );
|
||||
hardSound.Volume = volume;
|
||||
TriggerHaptics( HapticEffect.HardImpact );
|
||||
}
|
||||
else if ( surfaceNormal.Dot( -collision.Contact.Speed.Normal ) < 0.5f )
|
||||
{
|
||||
var scrapSound = Sound.Play( VehicleScrapeSound, WorldPosition );
|
||||
scrapSound.Volume = 0.4f;
|
||||
TriggerHaptics( HapticEffect.SoftImpact );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user