Jump to content

TheConceptBoy

Members
  • Posts

    159
  • Joined

  • Last visited

Everything posted by TheConceptBoy

  1. Brilliant, I'll take a look. In my case, perhaps I did something wrob because I had a Revolver rig (Trigger, Hammer, Drum) and a hand Rig. And Leadwerks only showed both when they all shared a common parent. It's like a tree, all branches must at some point lead back to a single root joint
  2. Naa, that's quite alright, I've figured it out. One thing is that Leadwerks only support one bone structure per FBX file so if I need to make sure that all objects are skin bount to a joint and all joints run down in hierarchy to share a single parent joint. Otherwise everything is great. Even supports multiple Materials, which is amazing.
  3. I figured as much, pretty standard for game engines. I also noticed that it only supports one Bone rig per model, I originally rigged my weapon to be one Bone Rig and the hands to be a 2nd rig but Leadwerks only detected the weapon rig upon Import. So all the meshes have to be a part of one bone rig I take it? PS: nice upvote rating. https://imgur.com/a/S2vpT7i
  4. Good day, everyone. I'm looking into rigging options for a pair of hands and wanted to see how Leadwerks takes it's hand rigs. In maya you "bind skin" to a bone and also you can parent ab object to a bone, which works great for mechanical objects. Which one does Leadwerks work with? Thanks!
  5. Ah, I see so there's already a player class in existance that I can use. Just followed this and got the right idea:
  6. Ah, I see what needs to be done. Each object needs to have physics enabled: // create player dummy object (CHANGE TO SPHERE LATER) player_box = Model::Sphere(); player_box->SetPhysicsMode(Entity::CharacterPhysics.); player_box->SetMass(1); //player_box->SetFriction(0, 0 The only issues is that with these collisions, it seems that the player object is dragging along the floor, the interaction is slowing the player down, making it hard to move. I figured I might have to be using Entity::RigidBodyPhysics instead of Entity::CharacterPhysics but that just makes the object not interact with the floor shapes I've put in the map via the Leadwerks Level Editor. EDIT: Well I had to play around with some properties but in the end I got the object to move without grinding on the floor using Entity::CharacterPhysics. What is the difference between the two? The docs for the function don't mention it? Also is there anything I'm missing to get the character movement to be more resembling of a walk and strafe and less like a deer on ice?
  7. Good day, everyone. I was out, looking for another engine to add to my option and saw the Leadwerks was on sale on Humble. Ended up picking up the core engine and since I come from App Game Kit C++ programming experience, I also picked up Pro Edition to start out with C++ right away. My first question is does Leadwerks simply interpret Lua with C++ namespace commands or does it drive the engine directly? Just a side inquiry. My main question right now is figuring out how to create a player class (or for now just the movement code, i'll move it into a class later). Correct me if I get any theory wrong, from what I've learned so far. When you create an object (like the player object) this way, Model* player_box; bool App::Start(){ player_box = Model::Box(); } Then this player_box model class now uses Leadwerks engine physics? In App Game Kit, we have to usually core our own player collisions using projection or ray casting or using sphere collisions. In Leadwerks documentation, there was a pre-made first person player class already in the game, where you can set up the properties like mass, movement, mouse speed, step height etc. Can this class till. be used via c++? As in, use the base player class that you're setting up in Leadwerks but add things like hands, weapons, etc, via C++ in visual studio? Now the main issue is that, as I'm testing, I can't get the player_box to move using physics. I can make it move using SetPosition or Move no problem, however that voids collisions and use of physics which, I assume are built into the engine physics solver. So here's my set up code. There's no player control affecting or causing the movement, I just need to see the box move and collide, for the first time. Perhaps I need to enable physics on the object before I can use it that way? Maybe because I created the box in code, there is more setup that needs to be done on it? #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } float mouse_x; float mouse_y; float cam_x = 0; float cam_y = 0; float player_x = 0; float player_y = 0; float player_z = 0; Model* player_box; bool App::Start(){ // Create window window = Window::Create("testgame", 100, 100, 1280, 720, Window::Titlebar); //Create context context = Context::Create(window); // Create world world = World::Create(); // create camera main_cam = Camera::Create(); main_cam->SetRotation(cam_y, 0, 0); // create player dummy object (CHANGE TO SPHERE LATER) player_box = Model::Box(); // set default cursor position window->SetMousePosition(window->GetWidth() / 2, window->GetHeight() / 2); // load test map made in Level Editor std::string map = "Maps/start_map.map"; if (!Map::Load(map)) return false; return true; } bool App::Loop(){ // Camera movement with mouse. Vec3 mouse_pos = window->GetMousePosition(); mouse_speed = 0.6; movement_speed = 2; // reset mouse values mouse_x = 0; mouse_y = 0; mouse_x = mouse_pos[0] - window->GetWidth() / 2; mouse_y = mouse_pos[1] - window->GetHeight() / 2; // add to camera movement cam_x += mouse_x* mouse_speed; cam_y += mouse_y* mouse_speed; //Add force to move player object (player_box) if (window->KeyDown(Key::W)) { player_box->AddForce(0, 0, 10, true); } if (window->KeyDown(Key::S)) {player_box->AddForce(0, 0, -10, true);} if (window->KeyDown(Key::A)) {player_box->AddForce(10, 0, 0, true);} if (window->KeyDown(Key::D)) {player_box->AddForce(-10, 0, 0, true);} // rotate box to face forward motion. player_box->SetRotation(0, cam_x, 0, true); // Rotate and Position camera based on player_box; main_cam->SetRotation(cam_y, 0, 0); main_cam->SetPosition(player_box->GetPosition(true)[0], player_box->GetPosition(true)[1], player_box->GetPosition(true)[2], true); // debug stuff Print("cam_x: " + to_string(cam_x) + " cam_y:" + to_string(cam_y)); Print("mouse_x: " + to_string(mouse_x) + " mouse_y:" + to_string(mouse_y)); //reset mouse to center of screen window->SetMousePosition(window->GetWidth() / 2, window->GetHeight() / 2); Time::Update(); // update keyframe world->Update(); world->Render(); context->Sync(false); if (window->Closed() || window->KeyHit(Key::Escape)) { return false; } return true; }
×
×
  • Create New...