/*
 * Copyright (C) 2012-2026 MotionSystems
 *
 * This file is part of ForceSeatMI SDK.
 *
 * www.motionsystems.eu
 *
 */

#pragma once

// Disable PhysX deprecation related warnings (check ChaosVehiclePhysics Plugin)
#pragma warning(disable : 4996)

#include "WheeledVehicle.h"

#include "IForceSeatMI_API.h"
#include "IForceSeatMIPhysXVehicle_ControllerCore.h"
#include "ForceSeatMI_TelemetryACE.h"

class ForceSeatMIPhysXVehicle_ControllerCore : public IForceSeatMIPhysXVehicle_ControllerCore
{
	explicit ForceSeatMIPhysXVehicle_ControllerCore(const ForceSeatMIPhysXVehicle_ControllerCore& other) = delete;
	explicit ForceSeatMIPhysXVehicle_ControllerCore(const ForceSeatMIPhysXVehicle_ControllerCore&& other) = delete;

	ForceSeatMIPhysXVehicle_ControllerCore& operator=(const ForceSeatMIPhysXVehicle_ControllerCore& other) = delete;
	ForceSeatMIPhysXVehicle_ControllerCore& operator=(const ForceSeatMIPhysXVehicle_ControllerCore&& other) = delete;

public:
	explicit ForceSeatMIPhysXVehicle_ControllerCore(AWheeledVehicle* vehicle);
	virtual ~ForceSeatMIPhysXVehicle_ControllerCore();

public:
	virtual void Begin() override;
	virtual void End() override;
	virtual void Update(float deltaTime) override;
	virtual void Pause(bool paused) override;
	virtual void AddExtraTransformation(const ExtraTransformation& transformation) override;
	virtual void SetAdditionalProperties(float sideSlip, float roadHarshness, float g) override;
	virtual void SetUserAux(float aux1, float aux2, float aux3, float aux4, float aux5, float aux6, float aux7, float aux8) override;

private:
	AWheeledVehicle*  m_vehicle;
	IForceSeatMI_API* m_api;
	bool              m_firstCall;
	FSMI_TelemetryACE m_telemetry;
	FTransform        m_prevTransform;
	float             m_prevSurgeSpeed;
	float             m_prevSwaySpeed;
	float             m_prevHeaveSpeed;
};
