FIX - Delegate could be in header only #52

Merged
jb-briant merged 1 commits from fix-physic-post-step-delegate into main 2025-04-30 14:43:27 +00:00
2 changed files with 6 additions and 10 deletions
Showing only changes of commit 7148f14b0d - Show all commits

View File

@ -109,13 +109,6 @@ 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>{});
@ -417,7 +410,7 @@ void AMujocoVolumeActor::Tick(float DeltaTime)
for (int32 SimStep = 0; SimStep < SimStepsPerGameFrame; ++SimStep)
{
mj_step(MujocoModel.Get(), MujocoData.Get());
PostPhysicUpdateDelegate.ExecuteIfBound(MujocoData->time);
PostPhysicStepDelegate.ExecuteIfBound(MujocoData->time);
}
for (int32 i = 1; i < BodyComponents.Num(); ++i)

View File

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