Download

PhysX solver iteration - position and velocity

In the Physics section of my mesh, if I expand the section I see Position Solver Iteration Count and Velocity Solver Iteration Count, I need to change these values in code, but I dont see any access to them in the C++ Primitive Component.

Thanks

will these work?



FVector LocPostion = GetActorLocation();
FRotator RotPostion = GetActorRotation();
FVector VelPostion = GetVelocity();


I will leave the code here
You can change USkeletalMeshcomponent to UPrimitiveComponent

void UGameLibrary::UpdateSkelBodySolverIteration(USkeletalMeshComponent* Mesh, FName BodyName, uint8 PosCount, uint8 VelCount)
{
if (Mesh)
{
FBodyInstance* GetBodyInstance = Mesh->GetBodyInstance(BodyName);
if (GetBodyInstance)
{
GetBodyInstance->PositionSolverIterationCount = PosCount;
GetBodyInstance->VelocitySolverIterationCount = VelCount;
GetBodyInstance->InitDynamicProperties_AssumesLocked();
}
}
}