creative commons attribution-noncommercial-sharealike 2.0
creative commons corporation is not a law firm and does not provide legal services. distribution of this license does not create an attorney-client relationship. creative commons provides this information on an "as-is" basis. creative commons makes no warranties regarding the information provided, and disclaims liability for damages resulting from its use.
license
thisislikelyalicenseheaderplaceholder
the work (as defined below) is provided under the terms of this creative commons public license ("ccpl" or "license"). the work is protected by © and/or other applicable law. any use of the work other than as authorized under this license or © law is prohibited.
by exercising any rights to the work provided here, you accept and agree to be bound by the terms of this license. the licensor grants you the rights contained here in consideration of your acceptance of such terms and conditions.
definitions
"collective work" means a work, such as a periodical issue, anthology or encyclopedia, in which the work in its entirety in unmodified form, along with a number of other contributions, constituting separate and independent works in themselves, are assembled into a collective whole. a work that constitutes a collective work will not be considered a derivative work (as defined below) for the purposes of this license
thisislikelyalicenseheaderplaceholder
"derivative work" means a work based upon the work or upon the work and other pre-existing works, such as a tdyLightBottomFrontRightComp->AttachToComponent(BodyMesh, FAttachmentTransformRules::KeepRelativeTransform, BodyLightBottomFrontRightSocket);
				BodyLightBottomFrontRightComp->RegisterComponent();
			}
			BodyLightBottomFrontRightComp->SetChildActorClass(Model->GetPartMeshes().BodyLightBottomFrontRightClass);
			LightDevices.Add(Cast<AKLightDeviceComp>(BodyLightBottomFrontRightComp->GetChildActor()));
		}
	}
}

void UKTruck3DModelComponent::LoadEngineMeshes(UKCoreTruckModel* Model)
{
	if (UStaticMesh* StMesh = Model->GetEngineInfo().Mesh.LoadSynchronous())
	{
		if (!EngineMesh)
		{
			EngineMesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("EngineMesh"));
			EngineMesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, EngineSocket);
			EngineMesh->RegisterComponent();
		}
		EngineMesh->SetStaticMesh(StMesh);
	}
}

void UKTruck3DModelComponent::LoadWheelsMeshes(UKCoreTruckModel* Model)
{
	// front wheels (axle 1)
	if (UStaticMesh* WheelMesh = Model->GetPartMeshes().WheelFrontMesh.LoadSynchronous())
	{
		if (!WheelLeftAxle1Mesh)
		{
			WheelLeftAxle1Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelLeftAxle1Mesh"));
			WheelLeftAxle1Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisLeft1Socket);
			WheelLeftAxle1Mesh->RegisterComponent();
		}
		WheelLeftAxle1Mesh->SetStaticMesh(WheelMesh);

		if (!WheelRightAxle1Mesh)
		{
			WheelRightAxle1Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelRightAxle1Mesh"));
			WheelRightAxle1Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisRight1Socket);
			WheelRightAxle1Mesh->RegisterComponent();
		}
		WheelRightAxle1Mesh->SetStaticMesh(WheelMesh);
	}

	// rear wheels -  axle 2, 3, 4
	if (UStaticMesh* WheelMesh = Model->GetPartMeshes().WheelRearMesh.LoadSynchronous())
	{
		// axle 2
		if (VehicleChassisMesh->DoesSocketExist(WheelVisLeft2Socket))
		{
			if (!WheelLeftAxle2Mesh)
			{
				WheelLeftAxle2Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelLeftAxle2Mesh"));
				WheelLeftAxle2Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisLeft2Socket);
				WheelLeftAxle2Mesh->RegisterComponent();
			}
			WheelLeftAxle2Mesh->SetStaticMesh(WheelMesh);
		}

		if (VehicleChassisMesh->DoesSocketExist(WheelVisRight2Socket))
		{
			if (!WheelRightAxle2Mesh)
			{
				WheelRightAxle2Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelRightAxle2Mesh"));
				WheelRightAxle2Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisRight2Socket);
				WheelRightAxle2Mesh->RegisterComponent();
			}
			WheelRightAxle2Mesh->SetStaticMesh(WheelMesh);
		}

		// axle 3
		if (VehicleChassisMesh->DoesSocketExist(WheelVisLeft3Socket))
		{
			if (!WheelLeftAxle3Mesh)
			{
				WheelLeftAxle3Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelLeftAxle3Mesh"));
				WheelLeftAxle3Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisLeft3Socket);
				WheelLeftAxle3Mesh->RegisterComponent();
			}
			WheelLeftAxle3Mesh->SetStaticMesh(WheelMesh);
		}

		if (VehicleChassisMesh->DoesSocketExist(WheelVisRight3Socket))
		{
			if (!WheelRightAxle3Mesh)
			{
				WheelRightAxle3Mesh = NewObject<UStaticMeshComponent>(this, UStaticMeshComponent::StaticClass(), TEXT("WheelRightAxle3Mesh"));
				WheelRightAxle3Mesh->AttachToComponent(VehicleChassisMesh, FAttachmentTransformRules::KeepRelativeTransform, WheelVisRight3Socket);
				WheelRightAxle3Mesh->RegisterComponent();
			}
			WheelRightAxle3Mesh->SetStaticMesh(WheelMesh);
		}

		// axle 4
		if (VehicleChassisMesh->DoesSocketExist(WheelVisLeft4Socket))
		{
			if (!WheelLeftAxle4Mesh)
			{
				WheelLeftAxle4Mesh = NewObject<UStaticMeshComponent>(this, UStaticbin Hood
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinHoodMesh;

	// Cabin Turn Light Left
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinTurnLightLeftMesh;

	// Cabin Turn Light Right
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinTurnLightRightMesh;

	// Cabin Light Bottom Front Left Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinLightBottomFrontLeftMesh;

	// Cabin Light Bottom Front Right Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinLightBottomFrontRightMesh;

	// Cabin Light Shield Bottom Front Left Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinLightShieldBottomFrontLeftMesh;

	// Cabin Light Shield Bottom Front Right Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinLightShieldBottomFrontRightMesh;

	// Cabin Light Center Front Middle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> CabinLightCenterFrontMiddleMesh;

	// Cabin Ligth Bottom Front Right Component
	UPROPERTY()
	TObjectPtr<class UChildActorComponent> CabinLightCenterFrontMiddleComp;

	// Engine
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> EngineMesh;

	// Wheel Left 1 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelLeftAxle1Mesh;

	// Wheel Right 1 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelRightAxle1Mesh;

	// Wheel Left 2 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelLeftAxle2Mesh;

	// Wheel Right 2 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelRightAxle2Mesh;

	// Wheel Left 3 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelLeftAxle3Mesh;

	// Wheel Right 3 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelRightAxle3Mesh;

	// Wheel Left 4 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelLeftAxle4Mesh;

	// Wheel Right 4 axle Mesh
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> WheelRightAxle4Mesh;

	// Chassis Spare Wheel 1
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> ChassisSpareWheelMesh1;

	// Chassis Spare Wheel 2
	UPROPERTY()
	TObjectPtr<class UStaticMeshComponent> ChassisSpareWheelMesh2;

	// Spring Arm Back
	UPROPERTY()
	TObjectPtr<class USpringArmComponent> SpringArmBack;

	// Spring Arm Front
	UPROPERTY()
	TObjectPtr<class USpringArmComponent> SpringArmFront;

	// Camera Back
	UPROPERTY()
	TObjectPtr<class UCameraComponent> CameraBack;

	// Camera Front
	UPROPERTY()
	TObjectPtr<class UCameraComponent> CameraFront;

	// Lights
	UPROPERTY()
	TArray<FK3DModelLightCompInfo> SpotLights;

	// Light Devices
	UPROPERTY()
	TArray<TObjectPtr<class AKLightDeviceComp>> LightDevices;
};
