Jump to content

All Activity

This stream auto-updates

  1. Today
  2. There is no need to set those variables to nil at all. -- drop old weps self.weplefthand = NewWepToHold1 self.weprighthand = NewWepToHold2 collectgarbage() If the old objects are not being deleted, you must have the same objects referenced somewhere else. You can call SetHidden() to hide them, if nothing else works. In Leadwerks, stuff like this could cause invalid pointer errors, which are impossible to detect and cause random memory overwrite. This was the #1 issue I saw causing problems in games made by the community.
  3. Managed to fix it in the game in Pivot's component Start() method by: auto entity = GetEntity(); if (entity) { entity->SetRotation(entity->GetRotation(true), true); } But resetting rotation does not work for this example O_o
  4. If brush was SetParented to a pivot World::Pick() starts ignoring it. How it should be: How it is: #include "UltraEngine.h" using namespace UltraEngine; bool PickFilter(std::shared_ptr<Entity> entity, std::shared_ptr<Object> extra) { if (entity->GetCollider() == nullptr) { return false; } return true; } int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto world = CreateWorld(); auto framebuffer = CreateFramebuffer(window); auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 2, -3); camera->SetRotation(25, 0, 0); camera->SetDebugPhysicsMode(true); auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); light->SetColor(1); auto floor = CreatePlane(world, 100, 100); floor->Move(0, -1, 0); auto b1 = CreateBox(world, 2.0f); b1->SetPosition(-3.0f, 0.0f, 0.0f); b1->SetColor(1, 0, 0); auto pivotParent = CreatePivot(world);//added a parent here b1->SetParent(pivotParent); auto b2 = CreateBox(world, 2.0f); b2->SetColor(0.0f, 0.0f, 1.0f); b2->SetPosition(3.0f, 0.0f, 2.0f); b2->SetRotation(0.0f, 45.0f, 0.0f); auto pivot = CreatePivot(world); auto rod_scale = 5.0f; auto rod = CreateCylinder(world, 0.05f); rod->SetCollider(nullptr); rod->SetParent(pivot); rod->SetRotation(90.0f, 0.0f, 0.0f); rod->SetPosition(0.0f, 0.0f, rod_scale / 2.0f); rod->SetScale(1.0f, rod_scale, 1.0f); auto sphere = CreateSphere(world, 0.25f); sphere->SetCollider(nullptr); sphere->SetParent(pivot); sphere->SetColor(0, 1, 0); sphere->SetPosition(0.0f, 0.0f, rod_scale); auto spin_speed = 0.5f; while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { pivot->Turn(0.0f, spin_speed, 0.0f); auto target_pos = Vec3(0.0f, 0.0f, rod_scale); target_pos = TransformPoint(target_pos, Mat4(), pivot->GetMatrix(true).Inverse()); // Perform a ray cast auto pick_info = world->Pick(pivot->GetPosition(true), target_pos, 0.25f, true, PickFilter); if (pick_info.success) { sphere->SetPosition(pick_info.position, true); } else { sphere->SetPosition(target_pos, true); } world->Update(); world->Render(framebuffer); } return 0; }
  5. Yesterday
  6. Do i need the Ultra Engine Pro subscriptions instead of 3 months fee i like to do monthly of fee of $9 or less and can i sign up for the subscription with my Steam Games account since they have my pay info already? thank you for all these answers Also can i use these material in Leadwerk v4.6 also as the ultra engine becoming published fully working copy?
  7. Greetings Fellow Creatives, If you happen to be using my free music tracks in your projects, please don't forget about my Ogg music packs. These packs enable you to download all of my tracks at once from various genres. Here's a link: https://soundimage.org/ogg-music-packs-2/ That said, I've uploaded some cool new seamless abstract texture images...perfect for tiling. You'll find them here: https://soundimage.org/txr-abstract/ Have a good weekend and keep being creative! :-)
  8. Still need getters for ParticleEmitter (GetParticleVelocity, GetParticleTurbulence etc.)
  9. Last week
  10. Per-vertex and per-edge displacement settings allow you to fine-tune displacement for tricky situations. In this case we have two beveled faces with aligned textures, so we can enable displacement on the edge to make a nice rounded corner where the material wraps around seamlessly.
  11. I've had my fair share of dealings with Object Pool creation over the years. I'm glad to announce that I have created the Ultimate Object Pooler , for Ultra Engine. This component can handle 10k entities per cycle, it can pool decals, emitters, models, brushes, sound and more ! prebuilt cache, or cache as-you-go or a combination of both. It will soon be available for download once I've got a home for it. Only three functions, it is well optimized. function Checkout(fname, OptionalTimer) function Checkin(ent) function Monitor_oPool()
  12. If you do "box->SetParent(pivot);" before loop there will be no shadow at all. In this example there is a shadow, but with Space box became child of rotating pivot and shadow is stay still static. #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { auto displays = GetDisplays(); auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); auto framebuffer = CreateFramebuffer(window); auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->Move(-1, 2, -6); //Create light auto light = CreatePointLight(world); light->SetPosition(0, 1, 0); light->SetColor(2); //Create ground auto ground = CreateBox(world, 20, 1, 20); ground->SetPosition(0, -0.5, 0); ground->SetColor(0, 0.4f, 0); auto pivot = CreatePivot(world); pivot->SetPosition(0, 0.5, -1); auto box = CreateBox(world, 1, 1, 1); box->SetPosition(0, 0.5, -1); while (window->Closed() == false and window->KeyHit(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_SPACE)) { box->SetParent(pivot); } pivot->Turn(2); world->Update(); world->Render(framebuffer); } return 0; }
  13. Awesome, had no idea that was in there. Thanks !
  14. It should not prevent it at all. Are you sure there are no other pointers exist to those weapons? Example how same reusing of var deletes prev entity without other references to it: local displays = GetDisplays() local window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[1], WINDOW_CENTER | WINDOW_TITLEBAR) local framebuffer = CreateFramebuffer(window) local world = CreateWorld() -- Create a camera local camera = CreateCamera(world) camera:SetClearColor(0.125) camera:SetFov(70) camera:Move(0, 2, -8) -- Create light local light = CreateBoxLight(world) light:SetRotation(45, 35, 0) light:SetRange(-10, 10) local box = CreateBox(world) box:SetPosition(1, 1, 1) -- Main loop while window:Closed() == false and window:KeyHit(KEY_ESCAPE) == false do collectgarbage() world:Update() world:Render(framebuffer) if (window:KeyHit(KEY_SPACE)) then box = CreateBox(world) end end
  15. But it does exist Docs does not have it tho You can add "hat:Detach()" to test https://www.ultraengine.com/learn/Entity_Attach?lang=lua
  16. How to completely remove an entity that uses the same variable in the same routine. I have two variables that hold references to two weapon entities the player uses. Scenario: Player changes weapons but nulling the variable holders for the previous weapons dont work because the new weapons fill in the varaible preventing it from being deleted. -- drop old weps self.weplefthand = nil self.weprighthand = nil collectgarbage() self.weplefthand = NewWepToHold1 self.weprighthand = NewWepToHold2
  17. We have Entity::Attach to parent an entity to a bone, but in cases of weapons, say I want to swap out weapons - how do I detach an entity attach to a bone? I see no Entity::Detach() or equivalent. I do not wish to simple destroy the attached entity but rather drop it back upon the terrain.
  18. Basically he wants a copy and paste button near the scene browsers rotation, position and scale settings. It does prove useful in some cases, I used that feature in Unity all the time. I believe Unity has a hotkey shortcut to copy the cameras position and rotation of the editors camera and paste it to the selected object in viewport.
  19. Just found this! Amazing to read and ref the Leadwerks documentation to understand and improve my experience. Wish there was more of this stuff shared. Thanks so much! Will use this and rather than copy and paste, will read line by line, ref the documentation and ensure I understand it all and gain knowledge. GREAT!
  20. This page has code for executing Lua scripts from C++: https://www.ultraengine.com/learn/Scripting?lang=cpp
  21. can you still mix scripts c++ and LUA on a project or does the project only work all C++ or Lua Script. Thank you for answer in advance i do write Script C# C++ and LUA depending which format i am thinking of when writing code.
  22. 0.9.8 Added new menu item in model editor menu Tools > Seal Cracks (for tessellation)
  23. Its still freezing. I face the issue again
  24. Josh

    Seal Mesh Cracks

    Algorithm to eliminate cracks from seams in tessellated meshes.
  25. Its been a while but then I have been learning some new techniques... The following images are of models that I have built myself both in engine with the use of CSGs and the more complicated models are from Blender. This is the first time I've created a map entirely from my own models and I am rather pleased with the outcome. Other's feedback would be greatly appreciated as well .
  1. Load more activity
×
×
  • Create New...