Here is the code I wrote to get of the transformed vertex positions using the Body Instance and PhysX code!
I am doing many safety checks to ensure the Body Instance data is valid before utilizing it, and the result is that now you can get accurate vertex locations in packaged games!
//~~~ PhysX ~~~
#include "PhysXIncludes.h"
#include "PhysicsPublic.h" //For the ptou conversions
//~~~~~~~~~~~
//Get Transformed Vertex positions of any static mesh! -
bool UVictoryBPFunctionLibrary::GetStaticMeshVertexLocations(UStaticMeshComponent* Comp, TArray<FVector>& VertexPositions)
{
if(!Comp || !Comp->IsValidLowLevel())
{
return false;
}
//~~~~~~~~~~~~~~~~~~~~~~~
//Component Transform
FTransform RV_Transform = Comp->GetComponentTransform();
//Body Setup valid?
UBodySetup* BodySetup = Comp->GetBodySetup();
if(!BodySetup || !BodySetup->IsValidLowLevel())
{
return false;
}
//Get the Px Mesh!
PxTriangleMesh* TriMesh = BodySetup->TriMesh;
if(!TriMesh)
{
return false;
}
//~~~~~~~~~~~~~~~~
//Number of vertices
PxU32 VertexCount = TriMesh->getNbVertices();
//Vertex array
const PxVec3* Vertices = TriMesh->getVertices();
//For each vertex, transform the position to match the component Transform
for(PxU32 v = 0; v < VertexCount; v++)
{
VertexPositions.Add(RV_Transform.TransformPosition(P2UVector(Vertices[v])));
}
return true;
}
thanks for awesome work. I just downloaded your plugin.
But somehow is the BP GetRenderedActors not working. I thought I could use that one to detect the actors my player can see. But even if the objects are clearly out of the players field of view, they are still listed as visible.
Am I missunderstanding something here?
Youâre understanding is correct, I have now fixed my BP nodes, Get Rendered Actors, and Get Not Rendered Actors, to work correctly in 4.6.1!
Get my latest download and enjoy!
Iâve tested these node as now working correctly.
They will indeed tell you when actors are not being rendered by the engine, such as when you are facing the other way while in-game
You can use my Get Rendered Actors node to find out the entire set of actors that have components that are currently being rendered by the engine!
**MinRecentTime**
You can use MinRecentTime to adjust what qualifies as "Recent enough"
So if you use MinRecentTime = 2, my nodes will return actors that were rendered within the past 2 seconds.
The default is really small because you generally just want to know which actors are currently being rendered, with no margin for "relatively recent."
I have a simple mind. What is the proper way to use Get Rendered Actors or Get Not Renders Actors to cause an event on Character dropping from the screen. Should I use the ForEachLoop into a Contains Item to do boolean logic off my Character being found in Get Not Rendered? Do I need the ForEachLoop?
Iâll play around with it tonight, just doing some reading now.
**Known**
Undo/Redo in my Vertex Snap Editor is not working correctly in 4.7, if someone investigates and fixes it let me know!
I will get to it as soon as I can. Rest of Vertex Snap Editor works great in 4.7 !
PS:
[QUOTE=KitatusStudios;228687]
Woo! Let us know what you get from the store :P
[/QUOTE]
It was too cold out, so I did the 4.7 upgrade instead !
:)
, when I try build my project with your plugin for I received below error during compilation 's Plugin:
[1/3] clang++.exe VictoryBPFunctionLibrary.cpp [armv7-es2]
LogPlayLevel: UnrealBuildTool: In file included from E:/Biblioteka/Dokumenty/Unreal Projects/gameDNAstudio/ChasingRobbers/Plugins/VictoryPlugin/Source/VictoryBPLibrary/Private/VictoryBPFunctionLibrary.cpp:12:
LogPlayLevel: UnrealBuildTool: In file included from Runtime/Engine/Public\PhysXIncludes.h:19:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\PxPhysicsAPI.h:49:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include/foundation/PxBounds3.h:38:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\foundation/PxTransform.h:37:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\foundation/PxQuat.h:39:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\foundation/PxVec3.h:38:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\foundation/PxMath.h:50:
LogPlayLevel: UnrealBuildTool: In file included from ThirdParty/PhysX/PhysX-3.3/include\foundation/PxIntrinsics.h:42:
LogPlayLevel: UnrealBuildTool: D:\Epic Games\4.7\Engine\Source\ThirdParty\PhysX\PhysX-3.3\include\foundation\unix\PxUnixIntrinsics.h(92,9) : error: use of undeclared identifier 'isfinite'; did you mean 'isFinite'?
LogPlayLevel: UnrealBuildTool: return isfinite(a);
LogPlayLevel: UnrealBuildTool: ^~~~~~~~
LogPlayLevel: UnrealBuildTool: isFinite
LogPlayLevel: UnrealBuildTool: D:\Epic Games\4.7\Engine\Source\ThirdParty\PhysX\PhysX-3.3\include\foundation\unix\PxUnixIntrinsics.h(90,22) : note: 'isFinite' declared here
LogPlayLevel: UnrealBuildTool: PX_FORCE_INLINE bool isFinite(float a)
LogPlayLevel: UnrealBuildTool: ^
LogPlayLevel: UnrealBuildTool: D:\Epic Games\4.7\Engine\Source\ThirdParty\PhysX\PhysX-3.3\include\foundation\unix\PxUnixIntrinsics.h(98,9) : error: use of undeclared identifier 'isfinite'; did you mean 'isFinite'?
LogPlayLevel: UnrealBuildTool: return isfinite(a);
LogPlayLevel: UnrealBuildTool: ^~~~~~~~
LogPlayLevel: UnrealBuildTool: isFinite
LogPlayLevel: UnrealBuildTool: D:\Epic Games\4.7\Engine\Source\ThirdParty\PhysX\PhysX-3.3\include\foundation\unix\PxUnixIntrinsics.h(90,22) : note: 'isFinite' declared here
LogPlayLevel: UnrealBuildTool: PX_FORCE_INLINE bool isFinite(float a)
LogPlayLevel: UnrealBuildTool: ^
LogPlayLevel: UnrealBuildTool: 2 errors generated.
LogPlayLevel: UnrealBuildTool: -------- End Detailed Actions Stats -----------------------------------------------------------
Just downloaded to play with in 4.7. Seems ok. But when I do a developmental build and run the program it tells me it can not find the victory plugin and then the game crashes.
Thanks for your hard work on the plugin ! I really enjoy it.
For some reason the plugin does not work on my project in a 4.6.1 to 4.7 upgrade.
It says could not be compiled from source. When I remove the plugin it works without issues. I tried the last three versions of the plugin. Any ideas?
Edit: Iâm checking Visual Studio right now.
âSetClassVolumeâ : is not a member of âFAudioDeviceâ
âULocalPlayer::ControllerIdâ : cannot access private member declared in class âULocalPlayerâ
âIgnoreActorsâ : is not a member of âFCollisionQueryParamsâ
error C2228: left of â.Emptyâ must have class/struct/union
If you review thread, in a few posts back, someone else figured out that you need to include stuff in your .build.cs in order to compile my plugin for android
Here is that quote
If ed or someone else could provide their modified build.cs that would be great!
check your primate messages when you get a . I canât figure out how to make Rendered Actor see my pawn. In the editor I call it , why cant it see (or not see) ?
Thanks ! I had the wrong date. Silly me. I thought I tried the first one too. I tried the first three but I must have mixed them around. The date mismatch threw me.
Hello - thanks again for these nodes - iâve just been using the texure loader which is really handy for me.
Is there a default path location set for the node? Iâd like to have a folder within my build folder which contains several end-user replacable images which are loaded at runtime. Do I need to somehow find the path to the build folder (which can obviously be different for any install) or if I leave the path blank will it default to the same location as the exe?
Cheers !
If you have any free iâd love to buy some of your again for a camera based tweak.
Hi !
I was wondering if you could add to the wiki a version of the plugin without the Editor module? When updating I always remove the editor part of the plugin because I donât use it so I think would be nice to have a zip with those already splitted on different files as well.