# SFVehicle.SFWheelComponent

00001 00002 00003 00004 00005 00006 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 00023 00024 00025 00026 00027 00028 00029 00030 00031 00032 |
    //=============================================================================
    // Spatial Fear
    // Name: SFWheelComponent
    // Description: Vehicle component with wheel-like behavior; spins at a given rate depending on the velocity of the vehicle.
    //
    // Author: Gert Jen Peltenburg
    //=============================================================================
    class SFWheelComponent expands SFVehicle;

    var (SpatialFear_WheelComponent) float MaxSteeringAngle;       // Minimum/maximum angle this wheel will rotate
    var (SpatialFear_WheelComponent) float WheelDiameter;       // diameter of the wheel. Circular wheel will travel pi*diameter per revolution.

    simulated function RotationPhysics(float deltatime)
    {
     if(MainSFVehicle!=self) {
      CurrentRotation.yaw=MaxSteeringAngle*MainSFVehicle.ControlInputYaw/MAX(MainSFVehicle.YawRightRate,MainSFVehicle.YawLeftRate);
      CurrentRotation.roll=MainSFVehicle.CurrentSpeed*deltatime/WheelDiameter/pi*65536.0;
     }
    }

    simulated function DoPhysics(float DeltaTime)
    {
    }

    defaultproperties
    {
         MaxSteeringAngle=8192.000000
         WheelDiameter=30.000000
         PhysicalRotationRate=(Pitch=16384,Yaw=16384,Roll=16384)
         bFullTimePhysics=True
    }

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:45 PM
Created with UnCodeX