Jump to content

Search the Community

Showing results for tags 'ultra'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Blogs

  • Development Blog
  • Canardian's Blog
  • Beyond Civilization Blog Ext
  • Tyler's Blog
  • macklebee's Blog
  • B-Byrnes' Blog
  • Marleys Ghost's Blog
  • omid3098's Blog
  • Richardsimpo123456's Blog
  • DJDD's Blog
  • Rick's Blog
  • --
  • xtreampb's Blog
  • Economically Disadvantaged
  • klepto2's Blog
  • Old Blog
  • Chris Paulson's Blog
  • Davaris' Blog
  • nil
  • Rekindled Phoenix's Blog
  • Flexman's Blog
  • Kattemaksu Online
  • Marcousik's Creations Blog
  • EVE LBS Studio
  • Rendering puzzles
  • Screen Size Utility
  • Niosop's Blog
  • 1299 RTS Game Project
  • Blitzbat's Blog
  • gordonramp's Blog
  • Andy Gilbert's Blog
  • Marcus' Blog
  • JornAggror Blog
  • diedir's Blog
  • wayneg's Blog
  • Masterxilo's Blog
  • Dave Lee's Blog
  • peubuy's blog
  • OD Arts -Leadwerks Blog
  • The progression......
  • Ultra Software Company Blog
  • The Progression
  • Pancake's Blog
  • Test Blog
  • BLaBZ Blog
  • Pure³d's Blog
  • dreamhead Blog
  • RVL's Blog
  • DB's Blog
  • Toxin Games Development Blog
  • CombatHelo Blog (RSS Import)
  • Foolish's Blog
  • ZioRed's Corner
  • Toxin Games Twitter
  • Shard - Third Initiative
  • Shard's Blog
  • Soamp's Blog
  • Soamp's Blog
  • Laurens' Blog
  • JT`s warehouse district
  • Kennar's Blog
  • KiteFuchs' Blog
  • KiteFuchs' Blog
  • Rachel's Dev-Blog
  • Eagle's Blog
  • zaphos' Blog
  • please delete this blog
  • Afke's Blog
  • Richard Simpson
  • knowledgegranted's Blog
  • EdzUp(GD)'s Blog
  • aGameLife's Kelasel MMORPG Blog
  • tournamentdan's Blog
  • Beyond Civilization Blog
  • smashthewindow
  • AnniXa's Blog
  • AnniXa's Blog
  • Elemental Development
  • DigitalHax Blog
  • Aria's Blog
  • Strogg76's Blog
  • Clackdor's Blog
  • Leadwerks Project Status
  • simpleprogrammer's Blog
  • Pathfinding in LE.2.x
  • Naughty Alien's Blog
  • smashthewindow's Blog
  • Ali Salehi's Blog
  • Jardar's Blog
  • Chris Vossen's Development Blog
  • Scarlet Thread Studios' Blog
  • Kronos' Blog
  • Benton's Blog
  • ChrisV's Blog
  • tjheldna's Blog
  • shadmar's Blog
  • 3D Masons, LLC
  • Andy Gilbert's Enviro Models
  • ParaToxic's Blog
  • NarkLord's Blog
  • ChrisMAN's Blog
  • ChrisMAN's Blog
  • CGMan's Blog
  • The Game
  • Chris Tutorials
  • Leadwerks 3 Experience
  • An Alien Saga
  • klepto2 & Leadwerks 3
  • Inside the mind of eternal insomniac
  • josk's Blog
  • Shader Development in Leadwerks 3.1
  • 3D Coat : Column game making of
  • Einlander's Blog
  • Ginger George's Blog
  • I have a problem
  • Michael_J's Blog
  • nasamydifol's Blog
  • Digman's Blog
  • noesisGUI
  • SavageDogg38's Blog
  • Built from Ruins
  • Remaining Days
  • test_external_blog
  • The Hunt For Food Blog
  • Crazy Minnow Studio
  • CrazyMinnowStudio
  • Guppy's Blog
  • Playing Online
  • Evayr's Blog
  • DerRidda's Blog
  • Karl's Blog
  • whiterabbit's Blog
  • Tinyboss Games
  • abendkleider's Blog
  • sacguccireplica's Blog
  • Arena
  • Imchasinyou's Blog
  • xtom's Blog
  • Lua is better than you think.
  • mdgunn's Blog
  • Crime Closer
  • lxFirebal69xl's Blog
  • Wedmer's Blog
  • Lockdown, going forward.
  • Pump-Action Captain
  • Igor's Blog
  • Dead Anyway
  • Runenrise and more
  • reepblue's Blog
  • Slippy's Corner
  • LUA Musings
  • severjack's Blog
  • mikeporter's Blog
  • miko93's Blog
  • Megalocerous' Blog
  • lxFirebal69xl's Blog
  • aiaf's Blog
  • Lostghbear's Blog
  • echo $BLOG_NAME > blog_title.tmpl
  • johnadam111's Blog
  • Dwarf Beard
  • burgelkat's Blog
  • Charrua's Blog
  • peterpaul's Blog
  • joshmathews' Blog
  • Martin Kearl's Blog
  • Brutile's blog
  • tipforeveryone's Blog
  • Glushchenko Blog
  • Express Lab Games Blog
  • Blueapples' Blog
  • DooMAGE's Blog
  • Structura devblog
  • UltraEngine - Experiences, add-ons and other Stuff
  • martyj's Blog
  • Dragonfreak's Blog
  • Brutile's Blog
  • assigmenthelp
  • Case Study Assignment Help
  • How to deal with bad grade ?
  • How to deal with bad grade ?
  • GameDev Blog
  • devcjohnson's Blog
  • devcjohnson's Blog
  • THE WHAT? Blog
  • The Demurian Scribe
  • GUI Editor
  • GUI Tutorial
  • noob_shaders
  • The Seventh World
  • Phodex Games Blog
  • Leadwerks VS Source 2
  • Work in Progress - Scifi PBR Media
  • [C++] First Player game start
  • The Blog of Yue
  • Snowboarding Development Blog
  • Ocean: Rendering in Leadwerks 4
  • Game Ready Maps
  • Ultra App Kit (Advanced Custom Widgets)
  • Poking around
  • Blender tutorials
  • Usefull Scripts & Components
  • Thirsty Panther
  • Ultimate Action Game Controller

Forums

  • Software
    • General Discussion
    • Programming
    • Game Artwork
    • Showcase
    • Suggestion Box
    • Bug Reports
  • Addons
    • Extensions & Plugins
    • Components
    • Addon Development
  • Platforms
    • Windows
    • Linux
    • macOS

Categories

  • Streams and Events
  • Tutorials
  • Games
  • Work in Progress

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location

  1. Would be nice to have missing brushes creation functions like: CreateCylinderBrush(), CreateConeBrush(), CreateWedgeBrush()... Only CreateBoxBrush() is currently available even if there is the CreateBrush() function that let us create custom brushes, it could be handy nonetheless.
  2. Now that this works - should it be that physics bodies in two separate worlds can still collide? Or is it up to the user to disable those collisions themselves?
  3. I want to be able have physics working on various different platforms that each have there own velocity and rotations happening. (In this example I'm just turning the floor object, so that might be the wrong way to do that.) On each platform I'd want to have physics working normally as though each platform is it's own little physics world, oblivious to the fact that it's platform is moving about. Just like we can walk on Earth and not feel like were hurtling around the sun and around the Earths axis. I guess this is similar to parenting a player controller to an elevator that moves left and right so the player doesn't slide off the platform as it moves. As the GIF shows, simply parenting the box to the floor breaks the physics sim I think. But the concept is what I'm trying to achieve. The same goes for parenting the player controller to the floor. It looks like it wants to work the way I intend, it just keeps bouncing back and forth. Any one know if this might be possible? #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; bool enable_camera = 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, 10, -5); auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f); floor->SetPosition(0.0f, -3.0f, 0.0f); floor->SetMaterial(LoadMaterial("Materials\\Developer\\bluegrid.mat")); auto box = CreateBox(world); box->SetMass(1.0f); box->SetPosition(2.0f, 2.0f, 0.0f); box->SetParent(floor); auto player = CreateCylinder(world); player->SetPhysicsMode(PHYSICS_PLAYER); player->SetPosition(0.0f, 5.0f, 0.0f); player->SetMass(1.0f); auto cam_pivot = CreatePivot(world); cam_pivot->SetParent(player); cam_pivot->SetPosition(0.0f, 1.8f, 0.0f); camera->SetParent(cam_pivot); camera->SetPosition(0.0f, 0.0f, -3.0f); camera->SetDebugPhysicsMode(true); bool stage = 0; while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } if (window->KeyHit(KEY_F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(KEY_F4) == true) { enable_camera = !enable_camera; } if (enable_camera) { auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = cam_pivot->GetRotation(); camrot.x += dy; camrot.y += dx; cam_pivot->SetRotation(camrot); mousepos = mpos; } floor->Turn(0.0f, 0.1f, 0.0f); auto y_angle = cam_pivot->GetRotation().y; auto move = 0.0f, strafe = 0.0f; if (window->KeyDown(KEY_W)) { move = 1.0f; } else if (window->KeyDown(KEY_S)) { move = -1.0f; } if (window->KeyDown(KEY_A)) { strafe = -1.0f; } else if (window->KeyDown(KEY_D)) { strafe = 1.0f; } player->SetInput(y_angle, move, strafe); world->Update(); world->Render(framebuffer); } return 0; }
  4. I'm getting random crashes with this code. Physics in two worlds not supported? #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; bool enable_camera = 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, 10, -5); auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f); floor->SetPosition(0.0f, -3.0f, 0.0f); floor->SetMaterial(LoadMaterial("Materials\\Developer\\bluegrid.mat")); auto box = CreateBox(world); box->SetCollider(nullptr); box->SetPosition(2.0f, 2.0f, 0.0f); auto player = CreateCylinder(world); player->SetPhysicsMode(PHYSICS_PLAYER); player->SetPosition(0.0f, 5.0f, 0.0f); player->SetMass(1.0f); auto cam_pivot = CreatePivot(world); cam_pivot->SetParent(player); cam_pivot->SetPosition(0.0f, 1.8f, 0.0f); camera->SetParent(cam_pivot); camera->SetPosition(0.0f, 0.0f, -3.0f); camera->SetDebugPhysicsMode(true); auto world_2 = CreateWorld(); auto f2 = CreateBox(world_2, 10.0f, 0.1f, 10.0f); auto b2 = CreateBox(world_2); b2->SetMass(1.0f); b2->SetPosition(2.0f, 10.0f, 0.0f); bool stage = 0; while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } if (window->KeyHit(KEY_F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(KEY_F4) == true) { enable_camera = !enable_camera; } if (enable_camera) { auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = cam_pivot->GetRotation(); camrot.x += dy; camrot.y += dx; cam_pivot->SetRotation(camrot); mousepos = mpos; } world_2->Update(); world->Update(); world->Render(framebuffer); } return 0; }
  5. For some reason usual widgets don't change icon at all so had to create little custom widget with AddBlock(); #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> panel; shared_ptr<Widget> btn; bool isFirst = true; class TestWidget : public Widget { protected: virtual void Draw(const int x, const int y, const int width, const int height) { blocks.clear(); int blockId = AddBlock(pixmap, iVec2(0), Vec4(1)); } public: static shared_ptr<TestWidget> create(const int x, const int y, const int width, const int height, shared_ptr<Widget> parent, const int style = 0) { struct Struct : public TestWidget { }; auto instance = std::make_shared<Struct>(); instance->Initialize("", x, y, width, height, parent, style); return instance; } }; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); panel = TestWidget::create(10, 50, 64, 64, ui->root); auto icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); panel->SetIcon(icon); btn = CreateButton("Change an icon", 10, 10, 150, 20, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 200, 200, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { isFirst = !isFirst; if (isFirst) { auto icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); //panel->SetPixmap(icon->Rasterize(1)); panel->SetIcon(icon); } else { auto icon2 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/new.svg"); //panel->SetPixmap(icon2->Rasterize(1)); panel->SetIcon(icon2); } } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  6. Now I think this is a bug... the cylinder falls and lands half way up. It moves around fine. I get it there's an offset of 0.5 but in this case I do not know how to fix it. Modify the vertices? Will that update the collider model too? What shape is the player controller? Is it not using the collider of the model I set PHYSICS_PLAYER on? #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; bool enable_camera = 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, 10, -5); auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); auto floor = CreateBox(world, 10.0f, 0.1f, 10.0f); floor->SetPosition(0.0f, -3.0f, 0.0f); floor->SetMaterial(LoadMaterial("Materials\\Developer\\bluegrid.mat")); auto box = CreateBox(world); box->SetMass(1.0f); box->SetPosition(2.0f, 2.0f, 0.0f); auto player = CreateCylinder(world); player->SetPhysicsMode(PHYSICS_PLAYER); player->SetPosition(0.0f, 5.0f, 0.0f); player->SetMass(10.0f); auto cam_pivot = CreatePivot(world); cam_pivot->SetParent(player); cam_pivot->SetPosition(0.0f, 1.8f, 0.0f); camera->SetParent(cam_pivot); camera->SetPosition(0.0f, 0.0f, -3.0f); camera->SetDebugPhysicsMode(true); bool stage = 0; while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } if (window->KeyHit(KEY_F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(KEY_F4) == true) { enable_camera = !enable_camera; } if (enable_camera) { auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = cam_pivot->GetRotation(); camrot.x += dy; camrot.y += dx; cam_pivot->SetRotation(camrot); mousepos = mpos; } auto y_angle = cam_pivot->GetRotation().y; auto move = 0.0f, strafe = 0.0f; if (window->KeyDown(KEY_W)) { move = 1.0f; } else if (window->KeyDown(KEY_S)) { move = -1.0f; } if (window->KeyDown(KEY_A)) { strafe = -1.0f; } else if (window->KeyDown(KEY_D)) { strafe = 1.0f; } player->SetInput(y_angle, move, strafe); world->Update(); world->Render(framebuffer); } return 0; }
  7. Initially i tried to reproduced bug when while changing an icon it was blinking with purple but in test example first icons stays. #include "UltraEngine.h" using namespace UltraEngine; shared_ptr<Window> window; shared_ptr<Framebuffer> framebuffer; shared_ptr<World> menuWold; shared_ptr<Interface> ui; shared_ptr<Camera> uiCamera; shared_ptr<Widget> panel; shared_ptr<Widget> btn; bool isFirst = true; void initGui() { auto default_font = LoadFont("Fonts\\arial.ttf"); ui = CreateInterface(menuWold, default_font, framebuffer->GetSize()); ui->SetRenderLayers(2); ui->root->SetColor(0.0f, 0.0f, 0.0f, 0.0f); uiCamera = CreateCamera(menuWold, PROJECTION_ORTHOGRAPHIC); uiCamera->SetPosition((float)framebuffer->GetSize().x * 0.5f, (float)framebuffer->GetSize().y * 0.5f, 0); uiCamera->SetRenderLayers(2); uiCamera->SetClearMode(CLEAR_DEPTH); panel = CreatePanel(10, 50, 64, 64, ui->root, PANEL_DEFAULT); auto icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); panel->SetIcon(icon); btn = CreateButton("Change an icon", 10, 10, 150, 20, ui->root); } int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window window = CreateWindow("Ultra Engine", 0, 0, 200, 200, displays[0], WINDOW_DEFAULT); //Create a world menuWold = CreateWorld(); //Create a framebuffer framebuffer = CreateFramebuffer(window); //Create light auto light = CreateBoxLight(menuWold); light->SetRange(-10, 10); light->SetRotation(15, 15, 0); light->SetColor(2); //Create camera auto camera = CreateCamera(menuWold); camera->SetClearColor(0.125); camera->SetPosition(0, 0, -3); camera->SetFov(70); initGui(); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { while (PeekEvent()) { const Event ev = WaitEvent(); if (ev.source == btn && ev.id == EVENT_WIDGETACTION) { isFirst = !isFirst; if (isFirst) { auto icon = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/help.svg"); panel->SetIcon(icon); } else { auto icon2 = LoadIcon("https://raw.githubusercontent.com/UltraEngine/Documentation/master/Assets/Icons/new.svg"); panel->SetIcon(icon2); } } ui->ProcessEvent(ev); } menuWold->Update(); menuWold->Render(framebuffer); } return 0; }
  8. I'm not sure how to go about this. I think what I need is one of the transform functions. This is a simplified example of my voxel terrain where each box represents a component of the terrain. Holding 'space' will replace random boxes. While all the boxes in this example exist, in the voxel terrain not all components exist at once, they can be created for the first time when the player edits the terrain, so I can't just grab the existing boxes rotation and use that for the new box. I only have the pivots position and rotation to decided what the new boxes position and rotation should be relative to the pivot. The position of the new box is okay if I set it's position to be local. I wonder if the rotation should be the same? #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; bool enable_camera = false; 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, 10, -5); auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); auto floor = CreateBox(world, 100.0f, 0.1f, 100.0f); floor->SetPosition(0.0f, -3.0f, 0.0f); const int grid_size = 3; const int total_cubes = grid_size * grid_size * grid_size; shared_ptr<Entity> rubix_cube[total_cubes]; auto material = CreateMaterial(); material->SetShaderFamily(LoadShaderFamily("Shaders\\Unlit.fam")); auto pivot = CreatePivot(world); pivot->SetShadows(true); int id = 0; for (int z = 0; z < grid_size; z++) { for (int y = 0; y < grid_size; y++) { for (int x = 0; x < grid_size; x++) { rubix_cube[id] = CreateBox(world); rubix_cube[id]->SetColor(Random(), Random(), Random()); rubix_cube[id]->SetParent(pivot); rubix_cube[id]->SetPosition(x - 1, y - 1, z - 1); id++; } } } //Main loop bool stage = 0; while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } if (window->KeyHit(KEY_F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(KEY_F4) == true) { enable_camera = !enable_camera; } //Rotate the pivot auto pos = pivot->GetPosition(true); pivot->Turn(0.025f, 0.025f, 0.025f); switch (stage) { case 0: if (pos.x < 5.0f) { pivot->Move(0.01f, 0.0f, 0.0f); } else { stage = 1; } break; case 1: if (pos.x > 0.0f) { pivot->Move(-0.01f, 0.0f, 0.0f); } else { stage = 0; } break; } //Randomly Replace a Box if (window->KeyDown(KEY_SPACE) == true) { auto x = Floor(Random(2.5f)); auto y = Floor(Random(2.5f)); auto z = Floor(Random(2.5f)); id = (z * (grid_size * grid_size)) + (y * grid_size) + x; rubix_cube[id]->SetParent(nullptr);//Should this be needed? rubix_cube[id] = CreateBox(world); rubix_cube[id]->SetColor(Random(), Random(), Random()); rubix_cube[id]->SetParent(pivot); rubix_cube[id]->SetPosition(x - 1, y - 1, z - 1); //How to transform to keep the rotation and position. //Can't use current rotation and position of box //In my game there is not allways a model present at that location //Nope //auto new_r = TransformRotation(Vec3(0.0f) , Mat4(), pivot->GetMatrix()); //rubix_cube[id]->SetRotation(new_r); } if (enable_camera) { auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = camera->GetRotation(); camrot.x += dy; camrot.y += dx; camera->SetRotation(camrot); mousepos = mpos; auto speed = 0.1f; if (window->KeyDown(KEY_SHIFT) == true) { speed = speed * 10.0f; } if (window->KeyDown(KEY_W) == true) { camera->Move(0, 0, speed); } else if (window->KeyDown(KEY_S) == true) { camera->Move(0, 0, -speed); } if (window->KeyDown(KEY_A) == true) { camera->Move(-speed, 0, 0); } else if (window->KeyDown(KEY_D) == true) { camera->Move(speed, 0, 0); } } world->Update(); world->Render(framebuffer); } return 0; }
  9. I was seeing issues with setting my player controllers position in game so I tried replicating it the best I could here. With the setup below, setting the mass causes the height to be offset and the player no longer falls. I thought I was creating the pivot at a different location from the cylinder but if you hit F5 it shows they are at the same location. I tried giving the pivot it's own collider, but that did nothing. I assume PHYSICS_PLAYER has it's own collider anyway. I also tried removing the floor plane. EDIT : I solved why it wasn't falling. Stupid me didn't disable the collider on the 'player' model. There is still the issue of starting with an offset though. This is what I was seeing in my larger project. The position reads as 10 units high however it starts lower than that. In game I've had to add an arbitrary offset to the players height but that won't do forever. #include "UltraEngine.h" using namespace UltraEngine; Vec3 mousepos = Vec3(0.0f); float move_adjustment = 0.1f; float move_speed = 1.0f; float lookspeed = 0.1f; float looksmoothing = 0.5f; bool enable_camera = false; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a world auto world = CreateWorld(); world->SetGravity(0.0f, -0.1f, 0.0f); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 9, -5); //Create a light auto light = CreateDirectionalLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto floor = CreatePlane(world, 100.0f, 100.0f); auto thing = CreateCylinder(world); thing->SetColor(1, 0, 0); thing->SetPosition(-2.0f, 10.0f, 0.0f); auto controller = CreatePivot(world); controller->SetPhysicsMode(PHYSICS_PLAYER); controller->SetCollisionType(COLLISION_PLAYER); auto player = CreateCylinder(world); player->SetParent(controller); player->SetColor(0, 1, 0); player->SetCollider(nullptr); controller->SetPosition(2.0f, 10.0f, 0.0f); controller->SetMass(1.0f); camera->SetParent(controller); //Reads as the set position above, but appears to start at a lower position. Gravity has been slowed to better see it at startup. auto c_pos = controller->GetPosition(true); auto p_pos = player->GetPosition(true); Print("Controller Position : " + String(c_pos.x) + ", " + String(c_pos.y) + ", " + String(c_pos.z)); Print("Player Position : " + String(p_pos.x) + ", " + String(p_pos.y) + ", " + String(p_pos.z)); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { if (window->KeyHit(KEY_F2) == true) { camera->SetWireframe(!camera->GetWireframe()); } if (window->KeyHit(KEY_F3) == true) { camera->SetDebugPhysicsMode(!camera->GetDebugPhysicsMode()); } if (window->KeyHit(KEY_F4) == true) { enable_camera = !enable_camera; } if (window->KeyHit(KEY_F5) == true) { auto c_pos = controller->GetPosition(true); auto p_pos = player->GetPosition(true); Print("Controller Position : " + String(c_pos.x) + ", " + String(c_pos.y) + ", " + String(c_pos.z)); Print("Player Position : " + String(p_pos.x) + ", " + String(p_pos.y) + ", " + String(p_pos.z)); } if (enable_camera) { auto _displaySize = window->GetSize(); float cx = Round((float)_displaySize.x / 2.0f); float cy = Round((float)_displaySize.y / 2.0f); auto mpos = Vec3(window->GetMousePosition().x, window->GetMousePosition().y, window->GetMousePosition().z); window->SetMousePosition(cx, cy); mpos = mpos * looksmoothing + mousepos * (1 - looksmoothing); auto dx = (mpos.x - cx) * lookspeed; auto dy = (mpos.y - cy) * lookspeed; auto camrot = camera->GetRotation(); camrot.x += dy; camrot.y += dx; camera->SetRotation(camrot); mousepos = mpos; auto speed = 0.1f; if (window->KeyDown(KEY_SHIFT) == true) { speed = speed * 10.0f; } if (window->KeyDown(KEY_W) == true) { camera->Move(0, 0, speed); } else if (window->KeyDown(KEY_S) == true) { camera->Move(0, 0, -speed); } if (window->KeyDown(KEY_A) == true) { camera->Move(-speed, 0, 0); } else if (window->KeyDown(KEY_D) == true) { camera->Move(speed, 0, 0); } } world->Update(); world->Render(framebuffer); } return 0; }
  10. Debug mode has no such problem but TransformPoint in same code in release mode don't returns true when it should. A model becomes yellow when it goes through a box in debug( i.e. TransformPoint() returns true). #include "UltraEngine.h" #include "Components/Mover.hpp" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.8); camera->Turn(35, 0, 0); camera->Move(0, 0, -2); camera->SetDebugPhysicsMode(true); //Create light auto light = CreateBoxLight(world); light->SetRange(-20, 20); light->SetArea(20, 20); light->SetRotation(35, 35, 0); auto unlitMaterial = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.json"); unlitMaterial->SetShaderFamily(unlitShader); int width = 2, height = 1, length = 3; auto model = CreateModel(world); auto mesh = model->AddMesh(); mesh->AddVertex(0, 0, 0); //S mesh->AddVertex(-width * 0.5, -height * 0.5, length);//NW mesh->AddVertex(width * 0.5, -height * 0.5, length);//NE mesh->AddPrimitive(2, 1, 0);//S , NW, NE mesh->AddVertex(-width * 0.5, height * 0.5, length);//NW h mesh->AddVertex(width * 0.5, height * 0.5, length);//NE h mesh->AddPrimitive(0, 3, 4);//S , NW h, NE h mesh->AddPrimitive(0, 1, 3);//left mesh->AddPrimitive(4, 3, 1); //"face" mesh->AddPrimitive(2, 4, 1); //"face" mesh->AddPrimitive(0, 4, 2); //"right" auto& mat = unlitMaterial; mat->SetTransparent(true); model->SetMaterial(mat); model->SetColor(0.5f, 0.8f, 0, 0.25f); model->SetPosition(0, 0, 0); auto collider = CreateConvexHullCollider(mesh); model->SetCollider(collider); Vec3 targetPos(2, 0, 0); auto box = CreateBox(world, 0.1f); box->SetPosition(targetPos); auto component = model->AddComponent<Mover>(); component->rotationspeed.y = 45; //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { auto newTargetPos = TransformPoint(targetPos, Mat4(), model->GetMatrix()); bool isInside = model->GetCollider()->IntersectsPoint(newTargetPos); if (isInside) { model->SetColor(1, 1, 0, 1); } else { model->SetColor(1, 0, 0, 1); } world->Update(); world->Render(framebuffer); } return 0; }
  11. I have now tried the leadwerks engine for a while now and wanted to test it again to Ultra Motor and the editor . But the editor does not open does only get a loading screen. I can compile the project with visual Studio and there is no problem.
  12. Is it possible in Ultra to draw every entities AABB for debugging purposes? I'm sure I could make it myself but thought it worth checking first.
  13. Is that possible to use Quake font from Quake pak in Ultra? Found "conchars" file without format in gfx.wad but have no idea what can i do with that, I have a strong feeling of seeing something like that long time ago but can't find it. Currently i'm using quake-like font from the internet but in game it looks much better and supports few languages in rerelease version. I think it's the only Quake thing left that i'm not using from the Quake pak archive.
  14. There's an old discussion on this here. To re-iterate, if you check KeyHit() inside an unreachable if statement, press the key, and then later that if statement evaluates to true, the KeyHit() check will also return true. No matter the period of time since hitting that key. I know FlushKeys() can fix that but I believe it also resets the key down stats and makes KeyDown() unusable. Is there a common work around for this is can FlushKeys have an option to just resit the hit stats and not the down states? Maybe an enum flag? FLUSH_HIT_STATE, FLUSH_DOWN_STATE, FLUSH_BOTH_STATES?
  15. Haven't had time to put together an example yet, but here's a video of the issue and the collider I'm using is attached as well as the .obj it was generated from. This has been happening since the fix for Mesh Colliders. Before then this shape didn't work at all. The video is just a player controller getting stuck inside this collider and when it does collide, it jitters a lot. Physics.zip
  16. So, I've been thinking. I have about 10 different pine tree models in GLTF format. Different sizes and styles etc. They all use the same base textures, DIFFUSE and NORMAL maps. My question is if I load all 10 pine trees are 10 unique materials being created? One for each tree?
  17. I forgot how to make the black parts of a texture be transparent. How to set this in a material? I tried "alphamask":true but not sure if that's even right.
  18. I printed to the console the texture format of my pixmap and it said it was 133 but I couldn't find it in the struct - I may be blind... is it a combo of compression and RGBA or something? enum TextureFormat { TEXTURE_FORMAT_UNDEFINED = 0,//VK_FORMAT_UNDEFINED, TEXTURE_RGBA_UINT = 41,//VK_FORMAT_R8G8B8A8_UINT, TEXTURE_RED = 9,//VK_FORMAT_R8_UNORM, TEXTURE_RED_UINT = 13,//VK_FORMAT_R8_UINT, TEXTURE_RG = 16,//VK_FORMAT_R8G8_UNORM, TEXTURE_RGB = 23,//VK_FORMAT_R8G8B8_UNORM, TEXTURE_RGBA = 37,// VK_FORMAT_R8G8B8A8_UNORM, TEXTURE_BGR = 30,//VK_FORMAT_B8G8R8_UNORM, TEXTURE_BGRA = 44,//VK_FORMAT_B8G8R8A8_UNORM, TEXTURE_RGB8 = 23,//TEXTURE_RGB, TEXTURE_RGBA8 = 37,//TEXTURE_RGBA, TEXTURE_BGR8 = 30,//TEXTURE_BGR, TEXTURE_BGRA8 = 44,//TEXTURE_BGRA, TEXTURE_RED16 = 76, //VK_FORMAT_R16_SFLOAT, TEXTURE_R16 = TEXTURE_RED16,//VK_FORMAT_R16_UNORM??????, TEXTURE_RGBA16 = 97,// VK_FORMAT_R16G16B16A16_SFLOAT, TEXTURE_RGBA32 = 109,//VK_FORMAT_R32G32B32A32_SFLOAT, TEXTURE_BC1 = 131,//VK_FORMAT_BC1_RGB_UNORM_BLOCK, TEXTURE_DXT1 = TEXTURE_BC1, TEXTURE_BC3 = 137,//VK_FORMAT_BC3_UNORM_BLOCK, TEXTURE_DXT5 = TEXTURE_BC3, TEXTURE_BC5 = 141,//VK_FORMAT_BC5_UNORM_BLOCK, TEXTURE_BC6H = 143,//VK_FORMAT_BC6H_UFLOAT_BLOCK TEXTURE_BC7 = 145,//VK_FORMAT_BC7_UNORM_BLOCK, TEXTURE_BC4 = 139,//VK_FORMAT_BC4_UNORM_BLOCK TEXTURE_COLOR = -1001, TEXTURE_DEPTH = -1002, TEXTURE_HDR = -1003 };
  19. GetCollider()->IntersectsPoint() seems to ignore changes of position and rotation of model with collider #include "UltraEngine.h" using namespace UltraEngine; int main(int argc, const char* argv[]) { //Get the displays auto displays = GetDisplays(); //Create a window auto window = CreateWindow("Ultra Engine", 0, 0, 1280, 720, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a world auto world = CreateWorld(); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.8); camera->Turn(35, 0, 0); camera->Move(0, 0, -2); camera->SetDebugPhysicsMode(true); //Create light auto light = CreateBoxLight(world); light->SetRange(-20, 20); light->SetArea(20, 20); light->SetRotation(35, 35, 0); auto unlitMaterial = CreateMaterial(); auto unlitShader = LoadShaderFamily("Shaders/Unlit.json"); unlitMaterial->SetShaderFamily(unlitShader); int width = 2, height = 1, length = 3; auto model = CreateModel(world); auto mesh = model->AddMesh(); mesh->AddVertex(0, 0, 0); //S mesh->AddVertex(-width * 0.5, -height * 0.5, length);//NW mesh->AddVertex(width * 0.5, -height * 0.5, length);//NE mesh->AddPrimitive(2, 1, 0);//S , NW, NE mesh->AddVertex(-width * 0.5, height * 0.5, length);//NW h mesh->AddVertex(width * 0.5, height * 0.5, length);//NE h mesh->AddPrimitive(0, 3, 4);//S , NW h, NE h mesh->AddPrimitive(0, 1, 3);//left mesh->AddPrimitive(4, 3, 1); //"face" mesh->AddPrimitive(2, 4, 1); //"face" mesh->AddPrimitive(0, 4, 2); //"right" auto& mat = unlitMaterial; mat->SetTransparent(true); model->SetMaterial(mat); model->SetColor(0.5f, 0.8f, 0, 0.25f); auto collider = CreateConvexHullCollider(mesh); model->SetCollider(collider); Vec3 targetPos(3, 0.5f, 0); model->Point(targetPos, 2, 1, 0); bool isInside = model->GetCollider()->IntersectsPoint(0, 0.5f, 3); Print(isInside);//should be false for this old position isInside = model->GetCollider()->IntersectsPoint(targetPos); Print(isInside);//should be true for this new position //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
  20. Here's a quick program and shader to test this out. The shader works with inTexCoords.xy but not with inTexCoords.zw. #include "UltraEngine.h" #include "Components/Mover.hpp" 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 world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 0, -3); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto box = CreatePlane(world); box->SetRotation(-90.0f, 0.0f, 0.0f); auto material = LoadMaterial("Materials\\Test.mat"); box->SetMaterial(material); auto mesh = box->lods[0]->meshes[0]; mesh->SetVertexTexCoords(0, 0.0f, 0.0f, 1); mesh->SetVertexTexCoords(1, 1.0f, 0.0f, 1); mesh->SetVertexTexCoords(2, 0.0f, 1.0f, 1); mesh->SetVertexTexCoords(3, 1.0f, 1.0f, 1); //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } Shader : #version 450 #extension GL_GOOGLE_include_directive : enable #extension GL_ARB_separate_shader_objects : enable #extension GL_EXT_multiview : enable #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/TextureArrays.glsl" #include "../../../../../../../../UltraEngine/Templates/Common/Shaders/Base/Materials.glsl" layout(location = 5 ) in flat uint inMaterialIndex; layout(location = 2 ) in vec4 inTexCoords; layout(location = 0) out vec4 color[8]; void main() { color[0] = texture( texture2DSampler[ GetMaterialTextureHandle( materials[ inMaterialIndex ] , 0 ) ] , inTexCoords.zw ); } Files : Shaders.zip
  21. I can't figure this one out. I was playing around with exporting from Blender and it displays on screen but only shows 1 LOD and no meshes for that LOD. It's worth mentioning it has no materials or images, not sure why that'd make a difference though. EDIT : It might be the newer GLTF export in blender. The files that work are with "Khronos glTF Blender I/O v1.4.40" and the ones I've uploaded that don't work are "Khronos glTF Blender I/O v3.6.27". #include "UltraEngine.h" #include "Components/Mover.hpp" 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 world = CreateWorld(); //Create a framebuffer auto framebuffer = CreateFramebuffer(window); //Create a camera auto camera = CreateCamera(world); camera->SetClearColor(0.125); camera->SetFov(70); camera->SetPosition(0, 5, -8); //Create a light auto light = CreateBoxLight(world); light->SetRotation(35, 45, 0); light->SetRange(-10, 10); auto model = LoadModel(world, "Models\\PineLarge_001.gltf"); //Only one LOD and no meshes. //Output says LOD_1 was loaded but then deleted int l = 0; for (auto lod : model->lods) { auto m = 0; for (auto mesh : lod->meshes) { Notify("lod : " + String(l) + ", mesh : " + String(m), ""); m++; } l++; } //Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; } PineLarge.zip
  22. Just want to get a clear idea on what are some of the limits for these things so I can be sure to not exceed them. As I understand it only so many materials, textures, entities and maybe other things can be passed to the shaders. What are the max: Entities Materials Textures Any thing else?
  23. Similar to what I mentioned here for materials. If I can get the index of an entity I can store extra data in a texture per entity. Unless there's already a way to do this?
  24. I can do it in C++ but how to set it in the JSON material? { "material": { "version": 100, "color": [ 1.0, 1.0, 1.0, 1.0 ], "emission": [ 0.0, 0.0, 0.0 ], "metallic": 0.0, "roughness": 0.0, "transparent": false, "occlusionInfo": true, "occlusionScale": 1.0, "normalScale": 1.0, "shaderFamily": "PBR" } }
  25. I think what I need is to disable depth testing but it didn't do what I expected. The models that this material is applied to are small and are sometimes inside other objects, I just want them to be always onto of everything. debug_point_material = CreateMaterial(); debug_point_material->SetShaderFamily(LoadShaderFamily("Shaders\\Unlit.json")); debug_point_material->SetShadow(false); debug_point_material->SetDepthMask(false); debug_point_material->SetDepthTest(false);
×
×
  • Create New...