reepblue Posted November 12, 2023 Share Posted November 12, 2023 As first mentioned here. Normals don't return the right value with GetWorld()->Pick() on brushes. It's fine with models. auto end = LoadModel(GetEntity()->GetWorld(),"Models/Developer/Widgets/normal.gltf"); auto p0 = GetEntity()->GetPosition(true); auto p1 = TransformPoint(0, 0, viewdistance, GetEntity(), NULL); pickinfo = GetEntity()->GetWorld()->Pick(p0, p1, radius, true); bool lookingatvoid = !pickinfo.success; if (!lookingatvoid) { // Set the end point to the position. end->SetPosition(pickinfo.position); end->SetRotation(0, GetEntity()->GetRotation(true).y, 0); end->AlignToVector(pickinfo.normal); } Wanted to make this it's own thread so it doesn't get forgotten. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted November 13, 2023 Share Posted November 13, 2023 Thank you I did not see this. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted December 5, 2023 Author Share Posted December 5, 2023 Sorry for the bump, but I was wondering the status of this fix. I can't really get started what I want to work on until this is fixed. Quote Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Solution Josh Posted December 14, 2023 Solution Share Posted December 14, 2023 Fixed on dev branch: #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto world = CreateWorld(); auto brush = CreateBoxBrush(world, 1, 1, 1); auto pick = world->Pick(Vec3(-2), Vec3(1, 1.5, 2)); Print(String(pick.normal.x) + ", " + String(pick.normal.y) + ", " + String(pick.normal.z)); return 0; } 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.