Jump to content
FoxMulder

FBX import and physics

Recommended Posts

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 !

Share this post


Link to post

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.

Share this post


Link to post

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 !

Share this post


Link to post

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.

Share this post


Link to post

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.

Share this post


Link to post

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 !

Share this post


Link to post

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 !

Share this post


Link to post

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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...