-
Posts
4,127 -
Joined
-
Last visited
Content Type
Blogs
Forums
Store
Gallery
Videos
Everything posted by Canardia
-
Yes, you can use the Steam API in Ultra with Lua, with it you can send and receive any data between players or server: https://www.ultraengine.com/learn/Steamworks_CreateLobby?lang=lua
-
#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 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); // Create a framebuffer auto framebuffer = CreateFramebuffer(window); // Create a world auto world = CreateWorld(); // Let there be light and a ship auto camera = CreateCamera(world); camera->Move(0, 20, -20); camera->Turn(30, 0, 0); auto ship = CreateBoxBrush(world, 10, 10, 10); auto light = CreatePointLight(world, 100); light->Move(0, 20, 0); // Slice the dice Plane plane = Plane(0,0,1,0); auto A = CreateBrush(world); auto B = CreateBrush(world); // comment the next line out if you don't want a crash ship->Move(0, 0, 50); // cash me ousside howbow dah ship->Slice(plane, A, B); ship = B->Copy(world, false, false)->As<Brush>(); // Move the sliced result right ship->Move(20, 0, 0); // Main loop while (!window->Closed() and !window->KeyDown(KEY_ESCAPE)) { world->Update(); world->Render(framebuffer); } return 0; }
-
I'm not a cylinder!
-
Ok, problem fixed, but I still wonder why this worked with CopyTo: Factory::Factory(A<World> world) { //world = world; // works only with CopyTo this->world = world; // works } Anyway, case closed.
-
I made an example and now it works. Something wrong in my Factory class must be. #include "UltraEngine.h" #include "ComponentSystem.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 * displays[0]->scale, 720 * displays[0]->scale, displays[0], WINDOW_CENTER | WINDOW_TITLEBAR); // Create a framebuffer auto framebuffer = CreateFramebuffer(window); // Create a world auto world = CreateWorld(); // Let there be light and a ship auto camera = CreateCamera(world); camera->Move(0, 20, -20); camera->Turn(30, 0, 0); auto ship = CreateBoxBrush(world, 10, 10, 10); auto light = CreatePointLight(world, 100); light->Move(0, 20, 0); // Slice the dice auto pivot = CreatePivot(world); pivot->Turn(0, -60, 45); Vec3 normal = pivot->rotation.Normalize(); Plane plane = Plane(normal.x, normal.y, normal.z, 4); auto A = CreateBrush(world); auto B = CreateBrush(world); ship->Slice(plane, A, B); //B->CopyTo(ship, 0); // Works beautifully! ship = B->Copy(world,false,false)->As<Brush>(); // Let's slice again like we did last summer pivot = CreatePivot(world); pivot->Turn(-60, -60, -45); normal = pivot->rotation.Normalize(); plane = Plane(normal.x, normal.y, normal.z, 4); A = CreateBrush(world); B = CreateBrush(world); ship->Slice(plane, A, B); //B->CopyTo(ship, 0); ship = B->Copy(world,false,false)->As<Brush>(); // Now this works too, hmm back to the drawingboard // Move the sliced result right ship->Move(20, 0, 0); // Main loop while (window->Closed() == false and window->KeyDown(KEY_ESCAPE) == false) { world->Update(); world->Render(framebuffer); } return 0; }
-
#include "PreComp.h" #include "Factory.h" Factory::Factory(A<World> world) { world = world; ship = CreateBoxBrush(world, 10, 10, 10); ship->Move(0, 0, 0); } void Factory::Cut(double x, double y, double z) { auto pivot = CreatePivot(world); pivot->Turn(x,y,z); Vec3 normal = pivot->rotation.Normalize(); Plane plane = Plane(normal.x, normal.y, normal.z, 4); A<Brush> A, B; A = CreateBrush(world); B = CreateBrush(world); ship->Slice(plane, A, B); B->CopyTo(ship, 0); //ship = B->Copy(world,false,false)->As<Brush>(); } Then in Application.cpp (main.cpp): Factory factory(world); factory.Cut(0, -60, -45); factory.Cut(-60, -60, -45); ship = factory.ship;
-
The ship vanishes.
-
But this doesn't work: //B->CopyTo(ship, 0); // works ship = B->Copy(world,false,false)->As<Brush>(); // doesn't work
-
This fixed it, thanks! B->CopyTo(ship, 0);
-
I tried B->CopyTo(ship, 0); and it works, but since the documentation is missing, I have no idea what the 0 does.
-
ship = CreateBoxBrush(world, 10, 10, 10); ship->Move(0, 0, 0); auto pivot = CreatePivot(world); pivot->Turn(0, -60, -45); Vec3 normal = pivot->rotation.Normalize(); Plane plane = Plane(normal.x, normal.y, normal.z, 4); auto A = CreateBrush(world); auto B = CreateBrush(world); ship->Slice(plane, A, B); ship = B; pivot->Turn(0, 1, 0); normal = pivot->rotation.Normalize(); plane = Plane(normal.x, normal.y, normal.z, 4); ship->Slice(plane, A, B); // Crash: Assert failed.
-
Undo redo is indeed a paradox
-
auto ball = CreateSphere(world); ball->SetMass(1); ball->SetGravityMode(false); auto ballo = ball->Instantiate(world); ballo->SetGravityMode(false); // workaround: this should inherit from ball like SetMass(1) does.
- 1 reply
-
- 1
-
Package::LoadDir("") returns nothing on large package
Canardia replied to SpiderPig's topic in Bug Reports
7z has 7 different algorithms, hence the name 7z. The most powerful compression is LZMA2 Ultra. -
So we basically have the source code already.
-
I want to focus on game development, not engine development, that's called teamwork.
-
1 million dollars should do it.
-
I added player->SetParent(pivot); but still no local force direction.
-
It only moves in global direction player->AddForce(dx, dy, dz, false);
-
Building a Massive Library of Free Images for Everyone
Canardia replied to Eric Matyas's topic in Game Artwork
Why not use .flac instead of .ogg? -
I would like to have Editor load a .ultra map when it's passed as command-line argument.
-
Thanks, this fixed the issue!
-
I noticed that my game does not run deterministic physics simulations anymore, so each time I start the game, the result is different. In the Newton docs it says you can set the physics threads to 1, so that it will run deterministic. https://newtondynamics.com/wiki/index.php/NewtonInvalidateCache How can we do this in Ultra Engine? void NewtonSetThreadsCount (const NewtonWorld* const newtonWorld, int threads)
-
C/C++ and C# on Windows works fine with /, even outside of Ultra.