Jump to content

Search the Community

Showing results for tags 'Collision'.

  • 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

Categories

  • Components
  • Effects
  • Extensions
  • Materials
    • Asphalt
    • Brick
    • Concrete
    • Effects
    • Fabric
    • Ground
    • Marble
    • Metal
    • Organic
    • Plaster
    • Rock
    • Roof
    • Sand
    • Snow
    • Surface Imperfections
    • Tile
    • Wood
  • Models
    • Animals & Creatures
    • Architecture
    • Food
    • Machinery
    • Plants and Vegetation
    • Props
    • Vehicles
  • Scenes
  • Skyboxes
  • Tools

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. 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; }
  2. 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
  3. When using the lua script to load a prefab made from csg's the collision does not load.
  4. If set collision hook to a prop, and add into it "Set collision - none" it will be get forse without collision
  5. I create a collision patch for my terrain on the fly with the following code which increases the memory usage over time. Commenting out creating the shape seams to stop it. #include "App.h" using namespace Leadwerks; App::App() : window(NULL), context(NULL), world(NULL), camera(NULL) {} App::~App() { delete world; delete window; } Model* box; Camera* camera; bool wireframe = false; bool App::Start() { window = Window::Create("PolyMesh",50,50, 1024, 768); window->Show(); context = Context::Create(window); world = World::Create(); DirectionalLight* light = DirectionalLight::Create(); light->SetRotation(35, 35, 35); camera = Camera::Create(); box = Model::Box(); box->Move(0, 0, 2); return true; } bool App::Loop() { if (window->KeyHit(Key::Escape) == true) { return false; } if (window->KeyHit(Key::F1) == true) { camera->GetDebugPhysicsMode() == true ? camera->SetDebugPhysicsMode(false) : camera->SetDebugPhysicsMode(true); } if (window->KeyHit(Key::F2) == true) { if (wireframe == true) { camera->SetDrawMode(0); wireframe = false; } else { camera->SetDrawMode(2); wireframe = true; } } Vec3 rot = box->GetRotation(); rot.x += 0.2f; rot.y += 0.2f; rot.z += 0.2f; box->SetRotation(rot); //Make a collsion surface on the fly for terrain/////////////////// int xGrid = 3; int zGrid = 3; int vertIndex = 0; Surface* surface = Surface::Create(); for (int z = 0; z < zGrid; z++) { for (int x = 0; x < xGrid; x++) { surface->AddVertex(x, 0.0f, z); if (z != 0 && x != 0) { surface->AddTriangle(vertIndex, vertIndex - xGrid, vertIndex - 1); surface->AddTriangle(vertIndex - xGrid, vertIndex - xGrid - 1, vertIndex - 1); } vertIndex++; } } Shape* shape = Shape::PolyMesh(surface);//memory leak here? //box->SetShape(shape); shape->Release(); surface->Release(); ////////////////////////////////////////////////////////////////////// Time::Update(); world->Update(); world->Render(); context->SetBlendMode(Blend::Alpha); context->DrawStats(10.0f, 10.0f, true); context->Sync(true); return true; }
  6. Hi, I have some switches and doors (SwingingDoors) that have Use function and calls to open or light up the rooms. But now I want that when my VR controller collide with the door or the light, first detect that I can "interact" with it (atm painting a Sphere...) and when I click on controller trigger, call to "Use" function of the collided entity (door or switch). Now, I replicated the code from FPSPlayer to interact with the E Key, and is "working" but is very awful I'm trying to write what I'm doing (very very very bad) on VRPlayer function Script:UpdateWorld() local pickInfo = PickInfo() --Usable object with Trigger Button: DANI if VR:GetControllerButtonDown(VR.Right,VR.TriggerButton)==true then local p0 = controller:GetPosition(true) local p1 = Transform:Point(0,0,self.useDistance,controller,nil) if self.entity.world:Pick(p0,p1, pickInfo, self.pickradius, true) then --Looks for any entity in the hierarchy that has a "Use" function local usableentity = self:FindUsableEntity(pickInfo.entity) if usableentity~=nil then --Use the object, whatever it may be usableentity.script:Use(self) end end end self.canUse = false pickInfo = PickInfo() local p0 = controller:GetPosition() local p1 = Transform:Point(self.useDistance,self.useDistance,self.useDistance,controller,nil) if self.entity.world:Pick(p0,p1, pickInfo, self.pickradius, true) then if self:FindUsableEntity(pickInfo.entity)~=nil then self.picksphere:SetPosition(pickInfo.position); self.canUse=true else local mass = pickInfo.entity:GetMass() if mass>0 and mass<=self.maxcarryweight then self.canUse = true end end else self.picksphere:SetPosition(0,0,0) end
  7. hey guys, got a high fast one thrown at me today, it involves collisions, which i have not been able to fully immerse myself into. We are learning to use leadwerks over here and we have set up a collision test. It involves a rotating box, with a "laser pointer" shooting a ray out of it. there are 3 other boxes on the floor, each sitting pretty, doing nothing. When the laser pointer spins, the laser eventually contacts the surface of the box. This causes the API to change the color of the collided-with box, to red. This is what we wanted. The second the laser touches the box, it changes color to red, but after the laser pointer is no longer in contact with the box, the box stays red. We want the box to change back to iits original color. Its as if the collision system needs to be reset? Is that the case? Standby, my co-worker will send me the code he has been working on .
  8. Hi everyone, it might be a stupid question but i just startet working with Leadwerks and LUA. So i am doing the tutorial series available here -> youtube and i have the problem that the player doesn't die when he falls from a high position. Everything else from the tutorial is working but maybe i missed something at the beginning? I remember that something didn't work at the beginning regarding the "name" value of the player. In the tutorial it was just "player" but in my version the value was "FPSPlayer". So i had to rename it to "player" to make the tutorial work on LW 4.5. Perhaps that's the problem? I attached my project and it would be really helpful if someone could have a look at it or just point me into the right direction. tutorial.7z
  9. Is a PolyMesh() trigger suposed to work? I set one up but every time objects fly straight through without invoking the collision hook. Using a sphere or box though works fine.
  10. Hi, I have made a large sphere shape which is set up as a trigger and I have attached a collision hook to a cube which I fire from the camera at the sphere. The hook is called upon collision but also seems to be called when the cube is inside the sphere. Even if it has been created in the sphere on start-up. Is there a way to only detect a collision with a face? Not the volume as well? I thought of just removing the hook upon first collision, but I'd like it there for collisions that may happen later. Any ideas?
  11. Hello. I am super new to Leadwerks, Lua script, and OOP languages in general. I am just trying to put together a simple game where the player can move a character around a room and dodge a bouncing ball-of-death; but the collisions are giving me a hard time. At this point, the script attached to my player character model simply contains the following code: Script.moveRate = 0.05 --float "Movement Rate" function Script:UpdatePhysics() if window:KeyDown(Key.W) then self.entity:Translate(0, 0, self.moveRate) end if window:KeyDown(Key.S) then self.entity:Translate(0, 0, -self.moveRate) end if window:KeyDown(Key.A) then self.entity:Translate(-self.moveRate, 0, 0) end if window:KeyDown(Key.D) then self.entity:Translate(self.moveRate, 0, 0) end end I have tried using Leadwerk's built-in physics to handle collisions, but they yield unwanted results. If the Physics Mode is set to Rigid Body, then the character model gets knocked over upon making contact with a wall brush; and if the Physics mode is set to Character Physics, the model sinks halfway into the floor brush and bounces when it collides with a wall, sometimes being launched away from the wall when the button is released. I have tried various setting combinations of Physics Mode and Physics Types, but none have yielded better results. In light of this, I thought I might try writing my own code to handle the collision behavior, but I can't seem to find any commands in the API reference that deal with collisions, aside from the CollisionHook command, which I am completely baffled by. (I have no idea what a "hook" is, and there is no example code given.) Apparently, I am missing something, somewhere. Can anyone point me in the right direction? Thanks!
  12. I am trying to create a platformer game where you can run, jump and shoot projectiles (lemons like in megaman). I am using 3-D models restricted to a 2-D plane. I already have my character running and jumping, however I am having a very difficult time trying to get shooting. I am not sure how to start. Should I have the chatterer controller script generate the projectiles? Can I make a global trigger that follows the character and emit the bullets? I am not sure where/how to generate the projectiles and where/how to do collision detection. can I have it shot a .pfb that I have made, or will it have to be a basic shape, or sprite? Thanks!
  13. I have the Cottages package from the Workshop and try to add a Poly Mesh collider to Cottage 1 or Cottage 2. This appears to work fine: But when I run the game, the outside walls have no collision. Reopening the MDL I find that it is clear they are lacking that part of the collision mesh somehow: Is there any way I can fix this or is it just a bug?
  14. So I have tried everything I dont know if its the object or what but the generetor(the base one that comes with leadwerks) cannot have collision set upon it. am I missing something?
  15. I am developping a small Foosball game. I set the ball object physics to Rigid Body, Prop, and with a mass of 5. The foosmen on a rod are attached to a pivot which controls their rotation. Each foosman physics is set to Rigid Body, Scene, Nav Obstacle = true. When the ball is moving, it can react to the foosmen rotating. If the ball is stopped, the foosmen pass through the ball. I suspect the way I set the physics is responsable for this. Does someone have a suggestion on how to set physics setting correctly so the foosmen can hit the ball when they are rotating. Thanks. E.
  16. Well this is my second post in a row on here. I have falling barrels set up and I want them to have collision with the player. If I turn Swept Collision on on the barrel, when it hits the player it automatically kills them. I want a collision where it will knock my player off the tiny cylinder platform, and onto the death trigger so he gets reset to the spawn point. How do I do this? Edit: I got it to work. Just didn't save it after I changed the collision type.
  17. This is my code: DeathTrigger.lua (attached to a box) Script.respawnPoint = "" --Entity "respawn point" function Script:Collision(entity, position, normal, speed) if(entity:GetKeyValue("name") == "Player") then spawnPos = self.respawnPoint:GetPosition() --entity:SetPosition(spawnPos) entity:Respawn(spawnPos) end end and FPSPlayer.lua (attached to the player) function Script:Respawn(spawnPos) self.entity:SetPosition(spawnPos) end When they collision I get this error: I have a Pivot indicating the respawn point: Line 65 is this from DeathTrigger.lua: entity:Respawn(spawnPos) From my point of view it should work. Any help? Edit: I just found it out. Turns out that this works: entity.script:Respawn(spawnPos) A little explanation would be welcome
  18. If you now, fast objekts skip collision check and move through other objekts. Have engine any standart methods preventing it?
  19. Hi. How to check collision whith trigger and other objects and return this objects adress? In C++
  20. Hi, I'm a total beginner in Leadwerks so my question will probably be an easy one I create a new scene. I put a big box (BOX1) in it for the floor, a little box (BOX2) with a mass of 1.0 and a barrel (from "models") with a mass of 1.0. BOX2 and barrel are put above BOX1. When I "run" the scene, BOX2 goes down and collide with BOX1 and stays on it but the barrel goes down and continue to go down through BOX1 and dissapear. I don't understand why the collision is not detected for barrel because all parameters seems identical between BOX2 and barrel. I tried different collision type (prop, scene, debris...) and result is the same in all cases. What did I miss for barrel? Is it because it is not a simple shape as a box or sphere and so the collision must be managed differently (with a script for instance)? Thanks for your help!
  21. So, I want the player to enter a collision trigger and that trigger makes it shows a picture, kind of like this script for text but instead of text, it shows a picture. How can I do this? Script.ObjectDescription = "" --String "Object Description" Script.DisplayTimeMax = 5000 --Int "Display time" Script.Used = "0" Script.DisplayTime = 0 Script.DisplayEnabled = false local font1 = Font:Load("Fonts/True Lies.ttf", 20) function Script:Use(context) self.Used = "1" self.CurrentTime = Time:GetCurrent() self.DisplayTime = Time:GetCurrent() + self.DisplayTimeMax end function Script:PostRender(context) if self.Used == "1" then App.context:SetBlendMode(Blend.Alpha) App.context:SetFont(font1) self.DisplayEnabled = true if self.DisplayEnabled == true then if self.DisplayTime > Time:GetCurrent() then App.context:SetColor(255,255,255) context:DrawText(self.ObjectDescription, 100, 600) else self.DisplayEnabled = false self.Used = "0" end end App.context:SetBlendMode(Blend.Solid) end end
  22. I have made a simple collision based melee combat system, it seems to work fine, you can take it if you want. But I also have a question about it. As you can see on the video below, weapon collider moves with a small latency, can I do anything to make it follow weapon model faster? Or is it the best result I can get? (Sorry for the video quality) Here is the main code: The idea is very simple: when player equips sword the sword prefab is being loaded and attached to the hand bone. The sword prefab has a sword model and an extra object with collider (WeaponTrigger). Also there is a blood point in the prefab to create blood particles in it's coordinates, but that doesn't matter. In WeaponTrigger start function this entity is being separated from the sword model and in UpdatePhysics it's being moved to the sword model position. Obviously, when this trigger collides with something we can hurt it and stop attack animation.
  23. today i build a house. i have a front wall with a door (hole). i set the collision to polymesh. this works awhile. now it does not work anymore!? arrrgg. i remember i put the ground floor a littlebit down only. before i can walk inside only there where the door is. someone know a trick? today also i change to beta of leadwerks engine.
  24. I'm trying to make a trigger that will detect collisions with characters, scene and props, but it seems like trigger response type works only for characters. Collision:SetResponse(10, Collision.Scene, 2) Collision:SetResponse(10, Collision.Prop, 2) Collision:SetResponse(10, Collision.Character, 2) self.entity:SetCollisionType(10) This makes my entity work as trigger for characters, but it collides with props and scene. Using 1 as a third parameter makes it collide with everything, using 0 makes it collide with nothing. Is it a bug or intended? Or am I doing something wrong?
  25. So I have been working for a few weeks on making and fixing up this code, and am at an impasse. I have the weapon equipping and swinging, but nothing is happening to the monsters. I have the code broken into 2 parts, 1 for the swinging and equip, and 1 (attached to a collision entity on the weapons blade) that when it collides with an enemy ai it is supposed to remove health from them. The second code I also plan on tweaking to include everyone who touches it (for traps) but have no clue. The code that isn't working is here. import "Scripts/Objects/Player/FPSWeapon.lua" Script.damage=10 function Script:Start() self.enabled=true end function Script:Collision(entity, position, normal, speed) if self.enabled then self.component:CallOutputs("Collision") end end function Script:Fire() local enemy = self:FindScriptedParent(Collision.entity,"Hurt") if enemy.script.health>0 then enemy.script:Hurt(self.damage,self.player) end --Blood emitter e = self.emitter[2]:Instance() e = tolua.cast(e,"Emitter") e:Show() e:SetLoopMode(false,true) e:SetPosition(pickinfo.position+pickinfo.normal*0.1) e:SetVelocity(0,0,0) end I brought in collision code directly into it so it would know what it was looking for, and imported the script for fps weapon to get the damage system working. It is showing no errors but at the same time doesn't do anything. Any Ideas? I just want to get it working, so I can tweak it for each weapon and trap.
×
×
  • Create New...