Skip to content

Effects

Jayden Maalouf edited this page Dec 19, 2024 · 3 revisions

This page will detail each effect type and it's (potential) use cases

Constant Force

Applies a steady force in one direction.

  • Usage:

    • Steering resistance: Simulate a car's resistance when turning at high speed.
    • Strong wind effects pushing the car to one side.
  • Parameters:

    • Direction: Specifies the direction of the force (Polar, Cartesian, or Spherical).
    • Level: Magnitude of the constant force. Range: -1 to 1 (negative values reverse direction).
    • Length: Duration in seconds (0 for infinite).
  • Use Case (Steering resistance):

    • Example values:
      • Direction: Towards the center axis.
      • Level: 0.25 for moderate resistance.
      • length: 0.2 for a consistent pull.

Sine Wave (Periodic Effect)

Creates oscillating forces in a sine wave pattern.

  • Usage:

    • Engine vibration: Simulate the car's engine revs with a subtle, constant vibration.
    • Road texture feedback: Convey a slightly rough road surface.
  • Parameters:

    • Magnitude: Peak force. Range: -1 to 1.
    • Offset: Adjusts the wave baseline. Range: -1 to 1.
    • Period: Time in seconds for a full wave cycle (e.g., 0.050 for high-frequency vibrations).
    • Phase: Starting point in the wave. Range: 0 to 360.
    • Length: Duration in seconds (0 for infinite).
  • Use Case (Engine vibrations):

    • Example values:
      • Magnitude: 0.1 for subtle vibrations.
      • Offset: 0 (centered).
      • Period: 0.070 for a low hum.
      • Phase: 0.

Square Wave (Periodic Effect)

Alternates between high and low forces abruptly.

  • Usage:

    • Rumble strips: Simulate the bumpy sensation when driving over track edges.
    • Collision effects: Add sharp feedback for smaller impacts.
  • Parameters: Same as Sine Wave.

  • Use Case: Rumble strips

    • Example values:
      • Magnitude: 0.35 for a strong rumble.
      • Period: 0.1 for distinct bumps.
      • Length: Matches the time spent on rumble strips.

Triangle Wave (Periodic Effect)

Produces a triangular wave pattern with linear transitions.

  • Usage:

    • Gradual road undulations: Simulate smoother, repeating road bumps or slopes.
  • Parameters: Same as Sine Wave.

  • Use Case: Gradual road undulations

    • Example values:
      • Magnitude: 0.15 for medium bumps.
      • Period: 0.3 for gradual transitions.

Sawtooth Up/Down Wave (Periodic Effect)

  • Description:

    • Sawtooth Up: Gradual increase followed by a sudden drop.
    • Sawtooth Down: Sudden increase followed by a gradual drop.
  • Usage:

    • Accelerating up a bumpy hill (Sawtooth Up).
    • Braking downhill with uneven traction (Sawtooth Down).
  • Parameters: Same as Sine Wave.

  • Use Case (Accelerating up a bumpy hill):

    • Example values:
      • Magnitude: 0.2.
      • Period: 0.15 for a repetitive effect.

Ramp Force

A force that gradually increases or decreases.

  • Usage:

    • Acceleration feedback: Gradual force increase as speed builds up.
    • Slowing down: Resistance that decreases as the car comes to a stop.
  • Parameters:

    • Start: Initial force magnitude. Range: -1 to 1.
    • End: Final force magnitude. Range: -1 to 1.
    • Length: Duration in milliseconds.
  • Use Case (Acceleration feedback):

    • Example values:
      • Start: 0 (no force initially).
      • End: 0.35 for strong acceleration.
      • Length: 1 (1 second to ramp up).

Condition Effects

Alters the force dynamically based on axis positions (e.g., friction, spring, or damper).

  • Usage:

    • Steering feedback: Simulate spring-like centering forces when turning the wheel.
    • Traction loss: Reduce steering force when losing grip.
  • Parameters:

    • Direction: Force direction.
    • Center: Dead zone around the center. Range: 0 to 1.
    • Strength: Force magnitude. Range: 0 to 1.
    • RightSat / LeftSat: Maximum force applied on each side. Range: 0 to 1.
  • Use Case: Steering resistance

    • Example values:
      • Center: 0.06 for a slight dead zone.
      • Strength: 0.3 for moderate centering.
      • RightSat: 0.45.
      • LeftSat: 0.45.

Custom Effects

Description: Allows combining or modifying effects for more complex behaviors. Usage:

  • Dynamic collisions: Combine a constant force with a periodic effect for a realistic crash response.
  • Simulating terrain transitions: Blend multiple effects (e.g., sine + condition) for grass or gravel.

Additional Notes

  • Direction Values
    • Polar: Angle in degrees from 0 (up).
    • Cartesian: [x, y] components.

Choosing the Right Effect for Each Scenario

  • Rumble Strips: Square Wave (Periodic Effect) for sharp, rhythmic feedback.
  • Engine Vibrations: Sine Wave for smooth and consistent vibration.
  • Steering Resistance: Condition Effect (Spring or Damper) for realistic steering feedback.
  • Collision Impacts: Square Wave or a short Constant Force burst.
  • Off-road Terrain: Triangle Wave or Sine Wave to mimic varying terrain roughness.