FoxMulder Posted August 8, 2014 Share Posted August 8, 2014 Hello there, I'm working with Leadwerks in these days and I think it's a really good game engine. However - as I've seen in other post here - there are some problems not importing the fbx files but apply them the collision physics. For example, I've created a house in 3ds max, I've exported it in FBX then I imported in Leadwerks in Prefab directory. Then I used collision type Scene and checked Nav obstacle. The problem is that the collision take a great area, more than the real size of the house. In addition, I can't give to the model a selective collision type (e.g. windows vs walls). When I apply the collision it affects the whole model. Anyone can help me ? Thank you and have a nice day ! Quote Link to comment Share on other sites More sharing options...
macklebee Posted August 8, 2014 Share Posted August 8, 2014 I would suggest building your own physics shapes by creating primitives using the inherent 'csg' entities in the editor. That would allow you to have multiple collision types for your one house model. Once done, add the invisible.mat to the primitives to hide them and then make all of them one prefab. 1 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel Link to comment Share on other sites More sharing options...
FoxMulder Posted August 8, 2014 Author Share Posted August 8, 2014 Hi macklebee, thank you for the answer ! I'll try and I'll let you know ! However, when a shape is really complex, I think it's impossible to recreate simply primitive structure... Do you think there're some plugin could be useful in this case ? Thank you again ! Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted August 8, 2014 Share Posted August 8, 2014 When you right click on a model in the editor you can create a phy shape. Convex or polymesh. Polymesh is high detail but also costs more performance. Convex covers the entire model in a simpe primitive, which is cheap. For environments that the player or enemy walks on I would suggest Macklebees method though, since it costs less performance. Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 You could have two versions of your model : the solid and the destructible one. How to make the destructible one : Step 1 : making the destroyed model : - In BLender or other soft, use some cut tool to break your model in several concave pieces ( If there is non concave pieces just make collision shapes - see how import collision workw in LE3) Step 2 : LE3 work - Import all your pieces constituing your destructed model - For each piece add a physic shape and weight - create some empty pivot in LE3 - drag each physic pieces into that pivot as childs - save your pivot and pieces as a Prefab In game when your model get destroyed , just replace the solid one by the new prefab , with physics applied each individual piece will fall down. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Einlander Posted August 8, 2014 Share Posted August 8, 2014 you can also in your model editor, create your model, then create the physics objects by using simple convex meshes (box,cylinder,etc) See Announcement here: http://www.leadwerks.com/werkspace/blog/1/entry-1203-beta-branch-update-tons-of-art-pipeline-enhancements/ Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 @FoxMulder : I made some example i put on tutorials. You can download the zip and test the map to see how it works. (the tutorial is a WIP in the makings) http://www.leadwerks.com/werkspace/page/tutorials/_/artwork/destroyable-physics-r112 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
FoxMulder Posted August 8, 2014 Author Share Posted August 8, 2014 Hello everyone and thank you for the quick replies ! @YouGroove I tried to download the project but I didn't found anything but a .jpg... Is there a complete project or something else ? Thank you ! Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 I modified it, you should be able to download the zip file. It contains a ReadMe to see quickly what to do. Quote Stop toying and make games Link to comment Share on other sites More sharing options...
FoxMulder Posted August 8, 2014 Author Share Posted August 8, 2014 Thank you, you're great ! Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 I posted a new version (needed only one script for the solid column) Quote Stop toying and make games Link to comment Share on other sites More sharing options...
FoxMulder Posted August 8, 2014 Author Share Posted August 8, 2014 Hello again, I tried the project. It's really nice... however - I don't know why - whenever I collide with the columns, two pieces of the column disappear suddenly and I find them behind me, collapsing... Is there something I can adjust in lua script ? Thank you ! Quote Link to comment Share on other sites More sharing options...
YouGroove Posted August 8, 2014 Share Posted August 8, 2014 Perhaps a bug with pivot ? As broken pieces are child of pivot ? I tested with multiple columns and it's like the prefab is loaded and placed at the right place, but the parts with a mass that are not static are moved all to the center absolute position (x=0,y=0) after prefab is loaded. After some tries it seems broken parts are spawned at the position where the original broken column prefab was made than saved before been deleted. Seems a bug with prefab and positions. ------------------ EDIT --------------------------------------- I found a nother solution, it's some more work in script , but at least it works : The solid column will just delete on collision and will spwan the all broken parts ( i added some Y offset parameter for column type objects). The new version is uploaded ready to test. 1 Quote Stop toying and make games Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.