Compare commits

..

No commits in common. "507fb88756bf561f8031e782bab7d4f8358383ed" and "7d383871b848f1eb25a134b8edfcedac02321f0f" have entirely different histories.

2 changed files with 10 additions and 6 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() void AMujocoVolumeActor::InitializeMujoco()
{ {
InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{}); InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{});
@ -410,7 +417,7 @@ void AMujocoVolumeActor::Tick(float DeltaTime)
for (int32 SimStep = 0; SimStep < SimStepsPerGameFrame; ++SimStep) for (int32 SimStep = 0; SimStep < SimStepsPerGameFrame; ++SimStep)
{ {
mj_step(MujocoModel.Get(), MujocoData.Get()); mj_step(MujocoModel.Get(), MujocoData.Get());
PostPhysicStepDelegate.ExecuteIfBound(MujocoData->time); PostPhysicUpdateDelegate.ExecuteIfBound(MujocoData->time);
} }
for (int32 i = 1; i < BodyComponents.Num(); ++i) for (int32 i = 1; i < BodyComponents.Num(); ++i)

View File

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