| Les exemples présentés dans ce document et le plugin ont été réalisés dans Unreal Engine 4.14, 4.15, 4.18 et 4.20+. Ils peuvent ne pas fonctionner correctement avec d’autres versions d’Unreal Engine. |
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "ForceSeatMI" });
| Le plugin ForceSeatMI utilise une DLL installée dans le cadre du logiciel ForceSeatPM. Assure-toi d’avoir ForceSeatPM installé sur ton ordinateur. |
IForceSeatMI_API* m_api;
m_api(&IForceSeatMI::Get().GetAPI())
m_api->BeginMotionControl();
m_api->SendTopTablePosLog(...); m_api->SendTopTablePosPhy(...); m_api->SendTopTableMatrixPhy(...);
m_api->EndMotionControl();

ATableLogPos_UnrealPawn::ATableLogPos_UnrealPawn() : CurrentDrawingHeave(0) , CurrentDrawingPitch(0) , CurrentDrawingRoll(0) { // ... code UE4 généré supprimé pour plus de clarté // ForceSeatMI - DÉBUT memset(&PlatformPosition, 0, sizeof(PlatformPosition)); PlatformPosition.structSize = sizeof(PlatformPosition); // Le programme de démonstration peut fournir la pause, la position et la limite de vitesse PlatformPosition.maxSpeed = PLATFORM_MAX_SPEED; PlatformPosition.mask = FSMI_POS_BIT_STATE | FSMI_POS_BIT_POSITION | FSMI_POS_BIT_MAX_SPEED; // ForceSeatMI - FIN } void ATableLogPos_UnrealPawn::Tick(float DeltaTime) { Super::Tick(DeltaTime); // ... code UE4 généré supprimé pour plus de clarté // ForceSeatMI - DÉBUT SendCoordinatesToPlatform(); // ForceSeatMI - FIN } void ATableLogPos_UnrealPawn::BeginPlay() { Super::BeginPlay(); // ForceSeatMI - DÉBUT if (FSMI_True == IForceSeatMI::Get().GetAPI().BeginMotionControl()) { SendCoordinatesToPlatform(); } // ForceSeatMI - FIN // ... code UE4 généré supprimé pour plus de clarté } void ATableLogPos_UnrealPawn::EndPlay(const EEndPlayReason::Type EndPlayReason) { Super::EndPlay(EndPlayReason); // ForceSeatMI - DÉBUT IForceSeatMI::Get().GetAPI().EndMotionControl(); // ForceSeatMI - FIN } void ATableLogPos_UnrealPawn::SendCoordinatesToPlatform() { // ForceSeatMI - DÉBUT PlatformPosition.state = FSMI_STATE_NO_PAUSE; PlatformPosition.roll = static_cast(FMath::Clamp(CurrentDrawingRoll / DRAWING_ROLL_MAX * PLATFORM_POSITION_LOGIC_MAX, PLATFORM_POSITION_LOGIC_MIN, PLATFORM_POSITION_LOGIC_MAX)); PlatformPosition.pitch = static_cast(FMath::Clamp(CurrentDrawingPitch / DRAWING_PITCH_MAX * PLATFORM_POSITION_LOGIC_MAX, PLATFORM_POSITION_LOGIC_MIN, PLATFORM_POSITION_LOGIC_MAX)); PlatformPosition.heave = static_cast(FMath::Clamp(CurrentDrawingHeave / DRAWING_HEAVE_MAX * PLATFORM_POSITION_LOGIC_MAX, PLATFORM_POSITION_LOGIC_MIN, PLATFORM_POSITION_LOGIC_MAX)); IForceSeatMI::Get().GetAPI().SendTopTablePosLog(&PlatformPosition); // ForceSeatMI - FIN }
IForceSeatMI_VehicleTelemetry* m_veh;
m_veh(&IForceSeatMI::Get().GetVehicleTelemetry())
m_veh->Begin();();
m_veh->Tick(...);
m_veh->End();

void ATelemetry_Veh_UnrealPawn::Tick(float Delta) { Super::Tick(Delta); // ... code UE4 généré supprimé pour plus de clarté // ForceSeatMI - DÉBUT IForceSeatMI::Get().GetVehicleTelemetry().Tick(*this, *GetVehicleMovement(), Delta, false/* pas de pause */); // ForceSeatMI - FIN } void ATelemetry_Veh_UnrealPawn::BeginPlay() { Super::BeginPlay(); // ForceSeatMI - DÉBUT IForceSeatMI::Get().GetVehicleTelemetry().Begin(); // ForceSeatMI - FIN }
IForceSeatMI_PlaneTelemetry* m_fly;
m_fly(&IForceSeatMI::Get().GetPlaneTelemetry())
m_fly->Begin();();
m_fly->Tick(...);
m_fly->End();

void ATelemetry_Fly_UnrealPawn::Tick(float DeltaSeconds) { // ... code UE4 généré supprimé pour plus de clarté / Appelle toute implémentation class Tick parente Super::Tick(DeltaSeconds); // ForceSeatMI - DÉBUT IForceSeatMI::Get().GetPlaneTelemetry().Tick(*this, DeltaSeconds, false/* pas de pause */); // ForceSeatMI - FIN } void ATelemetry_Fly_UnrealPawn::BeginPlay() { Super::BeginPlay(); // ForceSeatMI - DÉBUT IForceSeatMI::Get().GetPlaneTelemetry().Begin(); // ForceSeatMI - FIN }
