Compare commits

..

No commits in common. "main" and "ft-pre-post-substep-delegates" have entirely different histories.

3 changed files with 10 additions and 38 deletions

View File

@ -109,6 +109,13 @@ template <typename ComponentType> void AMujocoVolumeActor::AssignComponentsToArr
}
}
template <typename UserClass>
void AMujocoVolumeActor::BindPostPhysicDelegate(UserClass* Object, void(UserClass::* Func)(float))
{
PostPhysicUpdateDelegate.BindUObject(Object, Func);
}
void AMujocoVolumeActor::InitializeMujoco()
{
InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{});
@ -410,7 +417,7 @@ void AMujocoVolumeActor::Tick(float DeltaTime)
for (int32 SimStep = 0; SimStep < SimStepsPerGameFrame; ++SimStep)
{
mj_step(MujocoModel.Get(), MujocoData.Get());
PostPhysicStepDelegate.ExecuteIfBound(MujocoData->time);
PostPhysicUpdateDelegate.ExecuteIfBound(MujocoData->time);
}
for (int32 i = 1; i < BodyComponents.Num(); ++i)

View File

@ -114,7 +114,7 @@ public:
// ------- POST UPDATE -------
// ---------------------------
private:
FPostPhysicUpdate PostPhysicStepDelegate;
FPostPhysicUpdate PostPhysicUpdateDelegate;
public:
/**
* Register a delegate to be executed after mj_step, useful to fine control actuators
@ -122,10 +122,7 @@ public:
* @param Func - The Function to call - takes a float as parameter which is the current simulation timestamp
*/
template<typename UserClass>
void BindPostPhysicStepDelegate(UserClass* Object, void (UserClass::*Func)(float))
{
PostPhysicStepDelegate.BindUObject(Object, Func);
}
void BindPostPhysicDelegate(UserClass* Object, void (UserClass::*Func)(float));
// -------------------------

View File

@ -6,38 +6,6 @@ set "UE_PATH=C:\Program Files\UE_5.5"
set "PROJECT_PATH=%~dp0"
set "UAT_PATH=%UE_PATH%\Engine\Build\BatchFiles\RunUAT.bat"
:: Check if MuJoCo DLL exists in bin directory
if not exist "%MUJOCO_BIN_PATH%\mujoco.dll" (
echo Error: MuJoCo DLL not found at %MUJOCO_BIN_PATH%\mujoco.dll
echo Please ensure the MuJoCo DLL is properly built and placed in the correct location.
pause
exit /b 1
)
:: Copy MuJoCo DLL to the plugin binaries directory if it doesn't exist there
if not exist "%MUJOCO_DLL_PATH%\mujoco.dll" (
echo Copying MuJoCo DLL to plugin binaries directory...
copy "%MUJOCO_BIN_PATH%\mujoco.dll" "%MUJOCO_DLL_PATH%\"
if errorlevel 1 (
echo Failed to copy MuJoCo DLL
pause
exit /b 1
)
)
:: Add UE and MuJoCo paths to PATH environment variable
set "PATH=%UE_PATH%\Engine\Binaries\Win64;%MUJOCO_DLL_PATH%;%MUJOCO_BIN_PATH%;%PATH%"
:: Set the DLL search path for the current process
set "PATH=%PATH%;%MUJOCO_DLL_PATH%;%MUJOCO_BIN_PATH%"
:: Run the Unreal Editor
:: echo Starting Unreal Editor...
:: start "" "%UE_PATH%\Engine\Binaries\Win64\UnrealEditor.exe" "%PROJECT_PATH%LuckyWorldV2.uproject"
endlocal
:: Build and package command
"%UAT_PATH%" ^
-ScriptsForProject="%PROJECT_PATH%LuckyWorldV2.uproject" ^