FIX - Delegate could be in header only #52
@ -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()
|
void AMujocoVolumeActor::InitializeMujoco()
|
||||||
{
|
{
|
||||||
InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{});
|
InitializeMujocoScene_WithContactExclusion(TMap<FString, FString>{});
|
||||||
@ -417,7 +410,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());
|
||||||
PostPhysicUpdateDelegate.ExecuteIfBound(MujocoData->time);
|
PostPhysicStepDelegate.ExecuteIfBound(MujocoData->time);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int32 i = 1; i < BodyComponents.Num(); ++i)
|
for (int32 i = 1; i < BodyComponents.Num(); ++i)
|
||||||
|
@ -114,7 +114,7 @@ public:
|
|||||||
// ------- POST UPDATE -------
|
// ------- POST UPDATE -------
|
||||||
// ---------------------------
|
// ---------------------------
|
||||||
private:
|
private:
|
||||||
FPostPhysicUpdate PostPhysicUpdateDelegate;
|
FPostPhysicUpdate PostPhysicStepDelegate;
|
||||||
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,7 +122,10 @@ 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 BindPostPhysicDelegate(UserClass* Object, void (UserClass::*Func)(float));
|
void BindPostPhysicStepDelegate(UserClass* Object, void (UserClass::*Func)(float))
|
||||||
|
{
|
||||||
|
PostPhysicStepDelegate.BindUObject(Object, Func);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
Loading…
x
Reference in New Issue
Block a user