Jump to content

reepblue

Developers
  • Posts

    2,483
  • Joined

  • Last visited

Everything posted by reepblue

  1. A camera that's part of the same world for sure. I've did it before, but it's a cost to do more renders.
  2. reepblue

    Codelite Support

    Did a test from the terminal. Reported it as a bug. I can't test running the app directly as we need to set the Library path first. ? Only fix is to add a bogus flag at the end (ex: -devmode -l)
  3. I've noticed that when using the shell scripts, the argument list doesn't work correctly. The last flag set (ex: -smallwindow) doesn't save correctly. My test snip: //Load command-line parameters System::ParseCommandLine(argc, argv); for (auto& p : System::Arguments) { System::Print("Key: " + p.first + " = " + p.second); } Results: steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode = 1 devmode steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh +devmode 1 Key: devmode = 1 steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode +sw 1800 Key: devmode = 1 Key: sw = 1800 steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh -devmode -smallwindow Key: devmode = 1 = 1 smallwindow
  4. Using the Stock FPS Template. When the application closes, a Segmentation Fault occurs. steven@blackbox:~/Documents/Leadwerks/Projects/CodeLiteTest$ ./CodeLiteTest.sh Initializing Lua... Warning: Lua sandboxing disabled. Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/Error.lua" Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/Main.lua" Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/Menu.lua" Initializing OpenGL graphics driver... OpenGL version 460 GLSL version 460 Device: GeForce GTX 1050/PCIe/SSE2 Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Drawing/drawprimitive.shader"... Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Panel.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Panel.lua" Error: Failed to load font "/usr/share/fonts/truetype/ubuntu-font-family/Ubuntu-L.ttf" Loading font "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Fonts/arial.ttf"... Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Button.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Button.lua" Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Drawing/drawtext.shader"... Deleting script "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Button.lua" Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Button.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Button.lua" Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Tabber.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Tabber.lua" Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Label.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/Label.lua" Loading component "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/ChoiceBox.lua..." Executing file "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Scripts/GUI/ChoiceBox.lua" Loading map "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Maps/start.map"... Loading material "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Developer/orangegrid.mat"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Model/diffuse.shader"... Loading texture "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Developer/orangegrid.tex"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Editor/wireframe.shader"... Loading material "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Concrete/concrete_dirty.mat"... Loading texture "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Concrete/concrete_dirty_diff.tex"... Loading texture "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Concrete/concrete_dirty_dot3.tex"... Loading texture "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Concrete/concrete_dirty_spec.tex"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Model/diffuse+normal+specular.shader"... Loading texture "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Materials/Common/bfn.tex"... Deleting shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Editor/wireframe.shader" Setting breakpad minidump AppID = 480 Steam_SetMinidumpSteamID: Caching Steam ID: 76561197996502882 [API loaded no] Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Misc/occlusionquery.shader"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Model/Shadow/shadow.shader"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Lighting/directionallight.shader"... Loading shader "/home/steven/Documents/Leadwerks/Projects/CodeLiteTest/Shaders/Drawing/drawimage.shader"... Segmentation fault (core dumped)
  5. I don't think this is possible as I believe with Leadwerks, only one world at a time can be rendered.
  6. reepblue

    Codelite Support

    Ok, after that win, we have 2-3 options. Edit the script file to launch the debugger in the debug shell script. The shell script can not be launched alone without a debugger attached, but the editor seems to execute the debug application directly and why would you execute the debug version with no debuggers attached? Figure out a way to pass a value so our script knows we are setting a debugger to the application. Make a new script for the gdb use. I say we go with option 1 to be honest. Also noticed that any arguments being set from CodeLite isn't passing through. export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" gdb ./$PROJECT_NAME.debug "$@"
  7. reepblue

    Codelite Support

    Got it to work. We need to write better launch scripts... export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" gdb ./CodeLiteTest.debug "$@" #exec "./CodeLiteTest.debug" "$@"
  8. reepblue

    Codelite Support

    Ok, turns out, $PROJECT_PATH was fixed in a push earlier which broke my setup. Getting the same results as Josh now which the debugger doesn't stop at the break points. Uploaded update. Linux_CodeLite_updated.zip
  9. reepblue

    Codelite Support

    Here is hl2.sh file. There is debugging information that looks like it might help. #!/bin/bash # figure out the absolute path to the script being run a bit # non-obvious, the ${0%/*} pulls the path out of $0, cd's into the # specified directory, then uses $PWD to figure out where that # directory lives - and all this in a subshell, so we don't affect # $PWD GAMEROOT=$(cd "${0%/*}" && echo $PWD) #determine platform UNAME=`uname` if [ "$UNAME" == "Darwin" ]; then # prepend our lib path to LD_LIBRARY_PATH export DYLD_LIBRARY_PATH="${GAMEROOT}"/bin:$DYLD_LIBRARY_PATH elif [ "$UNAME" == "Linux" ]; then # prepend our lib path to LD_LIBRARY_PATH export LD_LIBRARY_PATH="${GAMEROOT}"/bin:$LD_LIBRARY_PATH fi if [ -z $GAMEEXE ]; then if [ "$UNAME" == "Darwin" ]; then GAMEEXE=hl2_osx elif [ "$UNAME" == "Linux" ]; then GAMEEXE=hl2_linux fi fi ulimit -n 2048 # enable nVidia threaded optimizations export __GL_THREADED_OPTIMIZATIONS=1 # and launch the game cd "$GAMEROOT" # Enable path match if we are running with loose files if [ -f pathmatch.inf ]; then export ENABLE_PATHMATCH=1 fi # Do the following for strace: # GAME_DEBUGGER="strace -f -o strace.log" # Do the following for tcmalloc # LD_PRELOAD=../src/thirdparty/gperftools-2.0/.libs/libtcmalloc_debug.so:$LD_PRELOAD STATUS=42 while [ $STATUS -eq 42 ]; do if [ "${GAME_DEBUGGER}" == "gdb" ] || [ "${GAME_DEBUGGER}" == "cgdb" ]; then ARGSFILE=$(mktemp $USER.hl2.gdb.XXXX) echo b main > "$ARGSFILE" # Set the LD_PRELOAD varname in the debugger, and unset the global version. This makes it so that # gameoverlayrenderer.so and the other preload objects aren't loaded in our debugger's process. echo set env LD_PRELOAD=$LD_PRELOAD >> "$ARGSFILE" echo show env LD_PRELOAD >> "$ARGSFILE" unset LD_PRELOAD echo run $@ >> "$ARGSFILE" echo show args >> "$ARGSFILE" ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} -x "$ARGSFILE" rm "$ARGSFILE" else ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@" fi STATUS=$? done exit $STATUS I need to fix LAUNCHING the game from the IDE first, but I still think this holds the key.
  10. reepblue

    Codelite Support

    Really weird. Now I can't launch the application from CodeLite at all. I can the scripts run it from the terminal just fine. ?
  11. reepblue

    Codelite Support

    I'm attaching the files here if anyone wishes to experiment with it. Install within your "/home/username/.steam/steam/steamapps/common/Leadwerks/Templates/Common/Projects" directory. "Linux_CodeLite should sit with the Existing Windows and Linux folders. Looks like we just need to get the debugger system configured. If anyone has any insight, let us know! On my end, I'm getting this. Not sure it's because we are launching a shell script instead of the actual application or not. Linux_CodeLite_Test.zip
  12. Tested this for a few minutes and it seems to be working as it should. I can't say if picks with a radius were effected or not. If there are any issues, I'll let you know as always.
  13. Awesome. Again, I'll continue to bug hunt and test compiling on Linux this weekend. Maybe sooner depending on things. ?
  14. I will play with it this weekend. By any chance was this fixed in this build? Did any depenences change now building with 18.04?
  15. Very cool. Hopefully there will be no limit on how many can join. I'll be there unless my dentist appointment takes longer than usual.
  16. Many other games support this. It's probably more apparent in my case since I only have a Rift with two senors.
  17. I've requested this before somewhere, but putting it here again. It would be nice to allow the rotation of the player's camera for more limited VR space. (Ex: Oculus Rift - 2 sensors.)
  18. The camera pick is done in CycloneCameraPlacement.Lua. This is the pick that causes the object (Cyclone) to be placed in walls. function Script:UpdateTrace() local pickinfo=PickInfo() local p0 = self.entity:GetPosition(true) local p1 = Transform:Point(0, 0, 999, self.entity, nil) if self.entity.world:Pick(p0, p1, pickinfo, 0, true, Collision.LineOfSight) then self.target:SetPosition(pickinfo.position) self.target:AlignToVector(pickinfo.normal) self.box:SetColor(1,0,0) self.box:Show() local hit = window:MouseHit(1) local hitPos = pickinfo.position if Game:TestCyclonePlacement(pickinfo, self.box)==true then self.box:SetColor(0,1,0) if hit==true then self:PlaceCyclone(pickinfo) end end hit = false end end Here is Game:TestCyclone located in Game.cpp for the correction placement. (To move the position away from corners) bool Game::TestCyclonePlacement(PickInfo* pPickInfo, Entity* pTargetEntity) { if (!gamerules) InstallGameRules(); // If there is no entity, return; if (pPickInfo->entity == nullptr) { return false; } // Check for surface if (pPickInfo->surface == nullptr) { return false; } //Check for a shape... if (pPickInfo->entity->GetShape() == nullptr) { return false; } // Check to see if it's CSG. if (pPickInfo->entity->GetClass() != Object::ModelClass) { return false; } else if (pPickInfo->entity->GetClass() == Object::ModelClass) { auto cast = static_cast<Model*>(pPickInfo->entity); if (cast->collapsedfrombrushes == false) return false; } // Test the material. if (CanPlaceOnSurface(pPickInfo->surface->GetMaterial()) == false) { return false; } // The target entity should be a pivot or something. // Basicly, the pivot position is where the cyclone is actually going to spawn at. if (pTargetEntity != NULL) { pTargetEntity->SetPosition(pPickInfo->position + pPickInfo->normal * 0.1); pTargetEntity->SetRotation(0, 0, 0); pTargetEntity->AlignToVector(pPickInfo->normal); float x = 0; float y = 0; PickInfo Pickinfo; auto world = World::GetCurrent(); float distance = 0.64; float radius = 0; Vec3 tracetest; tracetest = Transform::Point(0, distance, 0, pTargetEntity, nullptr); if (world->Pick(pTargetEntity->GetPosition(false), tracetest, Pickinfo, radius, true, COLLISION_CYCLONEBUMPER)) { y = -distance + MakePositve(pTargetEntity->GetPosition(false).DistanceToPoint(Pickinfo.position)); } tracetest = Transform::Point(0, -distance, 0, pTargetEntity, nullptr); if (world->Pick(pTargetEntity->GetPosition(false), tracetest, Pickinfo, radius, true, COLLISION_CYCLONEBUMPER)) { y = distance - MakePositve(pTargetEntity->GetPosition(false).DistanceToPoint(Pickinfo.position)); } tracetest = Transform::Point(-distance, 0, 0, pTargetEntity, nullptr); if (world->Pick(pTargetEntity->GetPosition(false), tracetest, Pickinfo, radius, true, COLLISION_CYCLONEBUMPER)) { x = distance - MakePositve(pTargetEntity->GetPosition(false).DistanceToPoint(Pickinfo.position)); } tracetest = Transform::Point(distance, 0, 0, pTargetEntity, nullptr); if (world->Pick(pTargetEntity->GetPosition(false), tracetest, Pickinfo, radius, true, COLLISION_CYCLONEBUMPER)) { x = -distance + MakePositve(pTargetEntity->GetPosition(false).DistanceToPoint(Pickinfo.position)); } pTargetEntity->Move(x, y, 0); //pTargetEntity->AlignToVector(pPickInfo->normal); tracetest = Transform::Point(0, 0, -0.5, pTargetEntity, nullptr); if (world->Pick(pTargetEntity->GetPosition(false), tracetest, Pickinfo, 0, true, COLLISION_CYCLONEBUMPER) == false) { return false; } }
  19. Ok, I think I got it down now. Create the actor, set the entity to it, and then null the pointer. You probably don't need to null the actor pointer after asignment, the memory address carries over and gets assigned to entity->actor. #include "Leadwerks.h" using namespace Leadwerks; class MyActor : public Actor { public: virtual void UpdateWorld() { if (Window::GetCurrent()->KeyHit(Key::T)) { System::Print("Actor still in memory..."); } entity->Turn(0, Time::GetSpeed(), 0); } }; void SetActor(Entity* p) { MyActor* actor = new MyActor(); p->SetActor(actor); actor = nullptr; } int main() { Leadwerks::Window* window = Window::Create(); Leadwerks::Context* context = Context::Create(window); World* world = World::Create(); Camera* camera = Camera::Create(); camera->SetRotation(35, 0, 0); camera->Move(0, 0, -6); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); light->SetShadowMode(0); Model* model = Model::Box(); model->SetColor(1.0, 0.0, 0.0); model->SetPosition(0, 0, 0); model->SetShadowMode(0); SetActor(model); while (window->Closed() == false) { if (window->KeyHit(Key::Space)) { if (model != nullptr) { model->Release(); model = nullptr; } } Leadwerks::Time::Update(); world->Update(); world->Render(); context->DrawStats(0, 0, false); context->Sync(true); } return 0; }
  20. Deleting the actor will cause a crash because it's derived off of the engine's Object class.
  21. Hello, After updating my project to 4.6, I've noticed that the picking system seems to be not as accurate as the 4.5 release. I've uploaded my project in full. Launch the player.map and look around near the edges of walls and floors. The axis crosshair will vanish. Pressing Mouse one will spawn an object at the calculated pick. Compile this with 4.5, and it works as expected. The picking operations are under Game.cpp while the rest of the game is in Lua. This may have to do with a previous update from December. Cyclone.zip
  22. Hello, I've noticed when using the C++ actor system that the actor class doesn't automatically get released with the entity. I've tried releasing it before the entity, but it's still in memory after the entity has been released. Below is example code to demonstrate this behavior. Is this a bug or am I not creating the actor class correctly and it's not working with the engine's reference system? I expect that after the entity is released, it would take the actor with it making the actor pointer null. Please provide insight on how to clear actors properly. #include "Leadwerks.h" using namespace Leadwerks; class MyActor : public Actor { public: virtual void UpdateWorld() { entity->Turn(0, Time::GetSpeed(), 0); } void Test() { System::Print("Actor still in memory..."); } }; int main() { Leadwerks::Window* window = Window::Create(); Leadwerks::Context* context = Context::Create(window); World* world = World::Create(); Camera* camera = Camera::Create(); camera->SetRotation(35, 0, 0); camera->Move(0, 0, -6); Light* light = DirectionalLight::Create(); light->SetRotation(35, 35, 0); light->SetShadowMode(0); Model* model = Model::Box(); model->SetColor(1.0, 0.0, 0.0); model->SetPosition(0, 0, 0); model->SetShadowMode(0); MyActor* actor = new MyActor(); model->SetActor(actor); while (window->Closed() == false) { if (window->KeyHit(Key::T)) { if (actor != nullptr) { actor->Test(); } } if (window->KeyHit(Key::Space)) { if (model != nullptr) { model->GetActor()->Release(); model->Release(); //delete actor; <- This line crashes because Actor is off of Object. model = nullptr; } } Leadwerks::Time::Update(); world->Update(); world->Render(); context->DrawStats(0, 0, false); context->Sync(true); } return 0; }
  23. Josh, It'll be nice to see this kind of stuff on the API reference under the C++ examples.
  24. I don't know why it's unsupported since it's been implented since 3.0 and the editor uses it. ?
  25. Nice find, hopefully it'll get fixed.
×
×
  • Create New...