The only limit I think you’ll have is the fact that the value being returned from the engine is a single precision float, here’s a reference on what sort of accuracy you can expect:
"
If you want an accuracy of +/-0.0005 (about 2^-11), the maximum size that the number can be is 2^13 (8192). Any larger than and the distance between floating point numbers is greater than 0.0005.
"
UE4 is using the PhysX engine under the hood to do the distance calculation:
```
PxGeometryQuery::pointDistance
```
So I do think your only limit is the accuracy of a single precision float.
Summary:
If you have two surface points to check the distance between that are more than 8192 units apart, your accuracy is limited to 0.00005 and gets smaller as the distance between the points gets bigger.
If your planets or the bodies you want to measure collision for are more than 10,000,000 unreal world units apart, you can expect the accuracy to be dropping in terms of precision down to 0.001 (1 mile you are saying).
If you need measurements more accurate than 1 mile, you’ll need to measure bodies that are more like 5,000,000 or 1,000,000 unreal in-game units apart.
How far apart are the planets or the bodies you want to measure in your UE4 Galaxy?
Hi again , I very much enjoy your plugin now that it is working in the NVIDIA branch, I was wondering if it would be possible to extend the vertex snap to include snapping blueprint actors in the level as well? As I understand, the vertex snap is for static meshes only right? Would it be hard to make the vertex snap work in the blueprint editor, since positioning components in the blueprint editor is a pain. Thanks again for the plugin.
“Would it be hard to make the vertex snap work in the blueprint editor, since positioning components in the blueprint editor is a pain.”
Yes that would be quite a challenge since the code for blueprint editor viewport is on the Editor side.
I implemented my Vertex Snap editor by creating my own editor mode for the level viewport, a functionality and method that Epic encouraged and has provided a code path for.
Modifying the existing code of the blueprint editor viewport to receive new keyboard and mouse inputs would probably be hard to do without a custom engine build, which then prevents me from offering the vertex snap as a plugin.
It’s quite doable of course, question is whether it can be without requiring a custom engine build
If I get and find anyway to modify the blueprint editor viewport code in a plugin fashion I’ll let you know!
I am glad you are enjoying my Victory plugin!
PS:
My Latest Node Release ~ Get Distance Between Two Collision Surfaces!
**My C++ Code For You**
Here's the C++ magic that I used to get the character's animated vertex positions to line up even while moving, jumping, and falling!
Please note node can also be used with non-pawns / non-characters, any SkeletalMeshComponent will work!
```
bool UVictoryBPFunctionLibrary::AnimatedVertex__GetAnimatedVertexLocations(
USkeletalMeshComponent* Mesh,
TArray<FVector>& Locations,
bool PerformPawnVelocityCorrection
){
if(!Mesh || !Mesh->SkeletalMesh)
{
return false;
}
//~~~~~~~~~~~~~
Locations.Empty();
//~~~~~~~~~~~~~
Mesh->ComputeSkinnedPositions(Locations);
FTransform ToWorld = Mesh->GetComponentTransform();
FVector WorldLocation = ToWorld.GetLocation();
**//Pawn Velocity Correction**
UPawnMovementComponent* MovementComp = nullptr;
if(PerformPawnVelocityCorrection)
{
APawn* Pawn = Cast<APawn>(Mesh->GetOwner());
MovementComp = (Pawn) ? Pawn->GetMovementComponent() : NULL;
}
bool DoVelocityCorrection = PerformPawnVelocityCorrection && MovementComp;
**//Pawn Velocity Correction**
for(FVector& Each : Locations)
{
Each = WorldLocation + ToWorld.TransformVector(Each);
if(DoVelocityCorrection)
{
**Each += MovementComp->Velocity * FApp::GetDeltaTime();**
}
}
return true;
}
```
**Latest plugin download on the UE4 Wiki: (7.99 mb) **
**Victory Plugin on Media Fire**
If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!
Please note clicking link will not start a download instantly, it will just take you to the Media Fire file description.
https://www.mediafire.com/?g6uf9kt5ueb2upj
Enjoy!
:)
Thanks for the suggestion, . I tried that but it still crashes. Ah well, it’s not so important. It isn’t part of the gameplay, it’s just for me to make some icons.
In the meantime, anyone can send me a donation via my lighting fitness website!
**Victory BP Library Donations Page**
If my plugin has benefitted you and you'd like to send me a donation, you can do so via the link below:
**Victory BP Library Donations**
http://lightningfitness.org/donate/
:)
Victory Absolute Paths! Live as of March 3rd 2015 build
Get the File Path to your project .exe, your project root directory, and more!
These paths are dynamically updated even if you move the entire project to a new location on your computer!
** these nodes are fully compatible with packaged builds and return absolute paths!**
These nodes also work in Development/Editor builds!
**More Power For You in BP**
Now you can easily create your own folders/files, relative to the project root directory or your project's .exe!
Please note that in editor builds, the .exe returns your UE4Editor.exe location, but in packaged games it returns your game's .exe
![ca6e47c3de4ce0fc029accc855a97ab3b66c7f0f.jpeg|1260x774](upload://sSMIRl140vUkZisnTkYGaDdAz4X.jpeg)
Recommendation:
I recommend using the Project Game directory for most of your relative path needs! works the same in Editor and packaged builds!
You can also get your Saved and Logs folders for your project in both packaged and editor builds!
**Download**
**Latest plugin download on the UE4 Wiki: (7.99 mb) **
https://wiki.unrealengine.com/File:VictoryPlugin.zip
Victory Plugin on Media Fire
If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!
Please note clicking link will not start a download instantly, it will just take you to the Media Fire file description.
**C++ Source Code For You**
Here is the C++ source code I wrote just earlier today!
```
/** node relies on http://api.ipify.org, so if node ever stops working, check out http://api.ipify.org. Returns false if the operation could not occur because HTTP module was not loaded or unable to process request. */
UFUNCTION(BlueprintCallable, Category="Victory PC")
bool VictoryPC_GetMyIP_SendRequest();
/** Implement event to receive your IP once the request is processed! requires that your computer has a live internet connection */
UFUNCTION(BlueprintImplementableEvent, Category = "Victory PC", meta = (DisplayName = "Victory PC ~ GetMyIP ~ Data Received!"))
void VictoryPC_GetMyIP_DataReceived(const FString& YourIP);
void HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful);
```
```
bool AVictoryPC::VictoryPC_GetMyIP_SendRequest()
{
FHttpModule* Http = &FHttpModule::Get();
if(!Http)
{
return false;
}
if(!Http->IsHttpEnabled())
{
return false;
}
//~~~~~~~~~~~~~~~~~~~
FString TargetHost = "http://api.ipify.org";
TSharedRef < IHttpRequest > Request = Http->CreateRequest();
Request->SetVerb("GET");
Request->SetURL(TargetHost);
Request->SetHeader("User-Agent", "VictoryBPLibrary/1.0");
Request->SetHeader("Content-Type" ,"text/html");
Request->OnProcessRequestComplete().BindUObject(, &AVictoryPC::HTTPOnResponseReceived);
if (!Request->ProcessRequest())
{
return false;
}
return true;
}
void AVictoryPC::HTTPOnResponseReceived(FHttpRequestPtr Request, FHttpResponsePtr Response, bool bWasSuccessful)
{
->VictoryPC_GetMyIP_DataReceived(Response->GetContentAsString());
}
```
**Latest plugin download on the UE4 Wiki: (8 mb) **
**Victory Plugin on Media Fire**
If your browser is not updating the Wiki download page to the most recent version, you can use my alternative Media Fire download link!
Please note clicking link will not start a download instantly, it will just take you to the Media Fire file description.
https://www.mediafire.com/?g6uf9kt5ueb2upj
Enjoy!
:)
I had to make a fix to get it building under Linux - the diff follows.
Have you considered putting your code on Github so people can send you pull requests for fixes/additions that you can easily decide to accept or not? If you are wlling, I offer to help set it up for you.
Now I need to see how to deal with the Dedicated Server build failing because VictoryBPLibrary depends on UElibPNG - the build error:
Building DescentServer...
Using clang version '3.5.0' (string), 3 (major), 5 (minor), 0 (patch)
Linux dedicated server is made to depend on UElibPNG. We want to avoid , please correct module dependencies.
ERROR: Exception thrown while processing dependent modules of VictoryBPLibrary
Exception thrown while processing dependent modules of ImageWrapper
ERROR: Unable to instantiate instance of 'UElibPNG' type from compiled assembly 'DescentServerModuleRules'. Unreal Build Tool creates an instance of your module's 'Rules' in order to find out about your module's requirements. The CLR exception details may provide more information: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> ERROR: Linux dedicated server is made to depend on UElibPNG. We want to avoid , please correct module dependencies.
Edit: I had to remove ImageWrapper as a dependency and ifdef out code using it in the plugin to get DedicatedServer to build.