Jump to content

FBX import and physics


FoxMulder
 Share

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 !

Link to comment
Share on other sites

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.

  • Upvote 1

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

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 !

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Stop toying and make games

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

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.

  • Upvote 1

Stop toying and make games

Link to comment
Share on other sites

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.

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.

 Share

×
×
  • Create New...