module Rotators
{
	vehicle SemiTrailerVan
	{
		template! = Rotators.TrailerBase,

		model
		{
			file = Rotators.TrailerVanBase,
			scale = 1.1500,
			offset = 0.0000 0.7826 -1.3652,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_White,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_Black,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_Red,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_Blue,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_Green,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_Yellow,
		}

		skin
		{
			texture = Vehicles/Trailers_rVan_USMCgreen,
		}

		template = Door/part/DoorRear,

		part DoorRear
		{
			model DoorRear
			{
				file = Rotators.TrailerVanTrunk,
				rotate = 90 0 0,
				scale = 1,
				offset = 0 0 0,
			}

			anim Close
			{
				sound = VehicleTrunkCloseStandard,
				anim = Trunk_closing,
				rate = 1.5,
			}

			anim Open
			{
				sound = VehicleTrunkOpenStandard,
				anim = Trunk_closing,
				reverse = TRUE,
				rate = 0.75,
			}

			anim Closed
			{
				anim = Trunk_closing,
				reverse = TRUE,
				animate = FALSE,
			}

			anim Opened
			{
				anim = Trunk_closing,
				animate = FALSE,
			}

			mechanicRequireKey = false,

			anim ActorOpen
			{
				anim = WindowOpenSuccess,
				rate = 0.15,
				angle = 0.0 0.0 0.0,
			}

			anim ActorClose
			{
				anim = Attack_Shove,
				rate = 0.3,
				angle = 0.0 0.0 0.0,
			}
		}

		physics box
		{
			offset = 0.0000 0.1826 -0.6522,
			extents = 1.7826 0.4870 5.6087,
			rotate = 0.0000 0.0000 0.0000,
		}

		physics box
		{
			offset = 0.0000 -0.0435 2.3478,
			extents = 0.1130 0.8261 0.1565,
			rotate = 0.0000 0.0000 0.0000,
		}

		physics box
		{
			offset = 0.0000 1.1913 -3.0174,
			extents = 0.1130 2.4609 0.9043,
			rotate = 0.0000 0.0000 0.0000,
		}

		physics box
		{
			offset = 0.0000 1.1913 -3.0174,
			extents = 0.1130 2.4609 0.9043,
			rotate = 0.0000 0.0000 0.0000,
		}

		physics box
		{
			offset = 0.0000 1.1913 -3.0174,
			extents = 0.1130 2.4609 0.9043,
			rotate = 0.0000 0.0000 0.0000,
		}

		extents = 1.9130 1.8087 8.1565,
		physicsChassisShape = 1.9130 1.8087 8.1565,
		centerOfMassOffset = 0.0000 1.4609 0.7043,
		shadowExtents = 1.8266 8.9786,
		shadowOffset = 0.0000 0.7123,

		area TireFrontLeft
		{
			xywh = 1.3304 -1.0957 0.4522 0.5043,
		}

		area TireFrontRight
		{
			xywh = -1.3130 -1.0957 0.4522 0.5043,
		}

		area TireRearLeft
		{
			xywh = 1.3304 -2.0957 0.4522 0.5043,
		}

		area TireRearRight
		{
			xywh = -1.3130 -2.0957 0.4522 0.5043,
		}

		area TruckBed
		{
			xywh = 0.0000 -3.5652 3.3565 1.4957,
		}

		area Toolbox
		{
			xywh = -1.1565 0.2174 0.5739 1.0957,
		}

		area SpareTire
		{
			xywh = 1.1565 0.2000 0.5739 1.0957,
		}

		attachment trailerTruck
		{
			offset = 0.0000 -0.4000 5.6435,
			rotate = 0.0000 0.0000 0.0000,
			canAttach = trailerTruck,
		}
	}
	template vehicle TrailerBase
	{
		mechanicType = 2,
		offRoadEfficiency = 2,
		engineRepairLevel = 4,
		playerDamageProtection = 1,
      
      isSmallVehicle = false,

		textureRust = Vehicles/Trailers_rVan_Rust,
		textureMask = Vehicles/Trailers_rVan_Mask,
		textureLights = Vehicles/Trailers_rVan_Lights,
		textureDamage1Overlay = Vehicles/Trailers_rVan_Overlay_Damaged01,
		textureDamage2Overlay = Vehicles/Trailers_rVan_Overlay_Damaged02,
		textureDamage1Shell = Vehicles/Trailers_rVan_Shell_Damaged01,
		textureDamage2Shell = Vehicles/Trailers_rVan_Shell_Damaged02,
		extents = 1.7426 1.4851 5.8020,
		shadowExtents = 1.8266 8.9786,
		shadowOffset = 0.0000 0.0514,
		mass = 310,
		physicsChassisShape = 1.7624 1.4851 5.8020,
		centerOfMassOffset = 0.0000 0.2871 -1.2277,
		brakingForce = 1,
		stoppingMovementForce = 1.0f,
		rollInfluence = 0.15f,
		steeringIncrement = 0.03,
		steeringClamp = 0.3,
		suspensionStiffness = 40,
		suspensionCompression = 4.83,
		suspensionDamping = 3.88,
		maxSuspensionTravelCm = 15,
		suspensionRestLength = 0.16f,
		wheelFriction = 2.0f,
		frontEndHealth = 150,
		rearEndHealth = 150,
		seats = 2,

		wheel FrontLeft
		{
			front = true,
			offset = -0.5941 -0.9010 0.2673,
			radius = 0.40f,
			width = 0.90f,
		}

		wheel FrontRight
		{
			front = true,
			offset = 0.6040 -0.9010 0.2673,
			radius = 0.40f,
			width = 0.90f,
		}

		wheel RearLeft
		{
			front = false,
			offset = -0.5941 -0.9010 -0.7129,
			radius = 0.40f,
			width = 0.90f,
		}

		wheel RearRight
		{
			front = false,
			offset = 0.6040 -0.9010 -0.7129,
			radius = 0.40f,
			width = 0.90f,
		}

		area TruckBed
		{
			xywh = 0.0000 -4.2475 3.3465 1.8020,
		}

		template = Rotators.DoubleTires,

		part TireFrontLeft
		{
			model InflatedTirePlusWheel
			{
				file = Rotators.TrailerVanFrontWheelLeft,
			}
		}

		part TireFrontRight
		{
			model InflatedTirePlusWheel
			{
				file = Rotators.TrailerVanFrontWheelRight,
			}
		}

		part TireRearLeft
		{
			model InflatedTirePlusWheel
			{
				file = Rotators.TrailerVanRearWheelLeft,
			}
		}

		part TireRearRight
		{
			model InflatedTirePlusWheel
			{
				file = Rotators.TrailerVanRearWheelRight,
			}
		}

      template = Battery,
		part Battery
		{
         category = nodisplay,
			lua
			{
				create = Vehicles.Create.Battery,
				update = Vehicles.Update.Battery,
			}
      }

      template = Headlight/part/HeadlightRearLeft,
      template = Headlight/part/HeadlightRearRight,
      
		template = Suspension/part/SuspensionFrontLeft,
		template = Suspension/part/SuspensionFrontRight,
		template = Suspension/part/SuspensionRearLeft,
		template = Suspension/part/SuspensionRearRight,
		template = Trunk/part/TruckBed,

		part TruckBed
		{
			container
			{
				conditionAffectsCapacity = false,
				capacity = 1000,
			}
		}

		template = Rotators.SemiVanSpareTire/part/SpareTire,

		part SpareTire
		{
			model SpareTire
			{
				file = Rotators.TrailerVanSpareTire,
				rotate = 0 0 0,
				scale = 1,
				offset = 0 0 0,
			}
		}

		template = Rotators.SemiVanToolbox/part/TrunkToolbox,
		template = Rotators.SemiVanToolbox/part/ToolboxDoor,

		part ToolboxDoor
		{
			model ToolboxDoor
			{
				file = Rotators.TrailerVanToolbox,
				rotate = 90 0 0,
				scale = 1,
				offset = 0 0 0,
			}
		}

		area Toolbox
		{
			xywh = -1.1584 -0.4455 0.5743 1.0891,
		}

		area SpareTire
		{
			xywh = 1.1584 -0.4455 0.5743 1.0891,
		}
	}
}
