Game Development Community

Shape Editor and Collision Meshs 2

by Malcolm · in Torque 3D Professional · 12/31/2011 (8:26 pm) · 10 replies

Hi guys, I've struck a major problem that I've been on for days with various failures to get my collisions working. In my other thread about a different type of model Steve helped me work out the collisions there and on his advice.

In the old post found here: http://www.garagegames.com/community/forums/viewthread/128481
Steve Mentioned "Ideally you create collision meshes as part of the model, though of course you can also add proxies later using Shape Editor."

With this in mind I've added box meshs into my model call ColA-1 etc... I've read through all the torque import collision documentation over and over and I'm not sure I'm doing the import correctly.

I've tried to use the technique that follows the dts tree and specifying collision meshes because I couldn't get my collision meshes working the any other way.

After creating the internal collision meshs mentioned above as a series of box meshes in the model when I import my shape into t3d there is no collision and I can't seem to get the collision meshes working.

Does anyone have any advice on how to structure my models so they import correctly into t3d with collision meshes working? The documentation on it has confused me as I can't see any clear cut way of naming and setting up my scene other than the limited examples. I might need some advice on how to structure my model and how to make each of the boxes work as a collision.

My current DAE hierarchy is as follows:
base01
+start01
++bounds
++FirstFloor01
++ColA-1
++ColB-1
Etc..

Thanks Mal

#1
12/31/2011 (9:31 pm)
I've finally found a post in the forums to try and find a solution. I've found a post from Steve which may be my problem. I'm modelling in Carrara 8 and exporting to DAE however I don't believe I'm getting the correct heirarchy based on the post here: http://www.garagegames.com/community/forums/viewthread/103331

Anyone dealt with exporting from Carrara successfully before?

It seems that my collision boxes are visible in game so there must be a problem in my heirarchy.

For some reason I read and read the documentation but it just isn't enough information for me to grasp how to layout my heirarchy.

Any advice would be appreciated guys, I'll keep trying and post my heirarchy if I get a successful mesh exported with collision boxes working.
#2
12/31/2011 (11:53 pm)
This link shows the proper setup for your hierarchy. You will need a collision-1 marker and collision-2 marker that are children of the base01 node. Then Col-1 and Col-2 (the collision meshes) must be children of the start01 node. Hope this helps.docs.garagegames.com/artist/official/Overview/Overview.html
#3
01/01/2012 (12:46 am)
Hi Joseph,
I looked into that post and copied the hierarchy however still no collisions. I used the following to keep it simple:

base01
+ collision-1
+ detail2
+ start01
++ Col-1
++ FirstFloor2

bounds

When I import it there are no collision meshs so I have to manual set the Col-1 as a collision object however my character can still walk through the shape even though you can see it in the game.

I tried to open it in ShowToolPro however nothing appears in that so I'm not sure whats going on.

#4
01/01/2012 (8:45 pm)
Okay I found some more information in the destructable objects, wish I read that document earlier however I wasn't considering putting in destructables at the moment.
docs.garagegames.com/torque-3d/official/content/documentation/Artist%20Guide/Tut...

This tutorial helped me change my heirarchy into the following.

Base
|_ start00
| |_FirstFloor200
| |_ col-1
|_ detail200

When I import this in the game I have to setup the col-1 manually as the collision mesh.

The outcome of this is that now I get my collision mesh to be in the versinity of the model shape. The issue is that the z coords are out so the actual collision mesh is about 6 meters below the shape in the game. I'm putting this down to the bounds not being created accurately.

I think I'm getting closer however it may be that I have to script in the setBounds method in order to get my models working which is a real bummer.

Any suggestions would be appreciated.
#5
01/01/2012 (10:24 pm)
Okay, once again I seem to have solved my own question.

I'll post the answers in case anyone else is using Carrara to export models into Torque and has the same problem.

The problem was 2 parts.

1) The first issue was that I had to use the heirarchy in carrara in my last post above. The answer was in the breakable objects Tutorial as it shows the correct heirarchy to use.

2) The second issue in which the collision was 6 meters above the shape was an issue with how Carrara eight exported the Collada model. The answer was to create the model in Carrara and then open the exported Collada file in a different modeller to edit the collision mesh position in the collada shape. It was showing that the shape for collision was 6 meters above the same as Torque.

NOTE: The weird part was that in Carrara 8 the collision mesh was at the same level as the actual visible mesh however when I opened the model in a different modeller I could see it was 6 meters off.

I don't know why modelling in Carrara 8 does this but I will have to put all my models through my other modelling programe to set the collision mesh positioning, before importing into Torque.

In all cases the model wouldn't open in ShowToolPro.

Thanks for your help too Joseph. Hopefully this post helps someone else using T3D and Carrara for their modelling projects.

#6
01/02/2012 (9:30 am)
Does Carrara use world coordinates and object coordinates? I know in Blender that it has world coordinates and object coordinates as well as scaling. So I try to make sure everything is in absolute world coordinates world scaling rather than local object coordinates and scaling. It is possible that the exporter does not take this into account. So maybe this in an offset in the model in local coordinates that is being counteracted by world coordinates. However, I have never used Carrara so I don't know.
#7
01/02/2012 (8:57 pm)
Hi Frank,
I think you are onto something here.

Does Carrara use world coordinates and object coordinates? Yes it does.

I've been working in local coordinates so perhaps when I export the collada it's all out of sync.

Thanks for your advice Frank I'll look at that with my modelling and ensure that in Carrara I'm always working in world coords.
#8
01/03/2012 (11:19 pm)
I've looked into Carrara using the world coords and it looks like I still need to pipeline my art through Carrara -> Daz studio character builder to fix the collisions and line ups then export to Torque.

For some reason Carrara just doesn't export correctly and must have some sort of bug.

Thanks anyway.
#9
01/04/2012 (11:44 am)
Malcolm@ would it be easier to just skip collisions. export your model as DAE and then simply let the Shape Editor auto-create the collision meshes for you ?

I've done that with a number of models from different source -- most/all of them had No collisions built in.

So I used the shape editor to build a collision mesh using the models shape and then save the model to a new file name (.dts) from within the editor ... collisions done.
#10
01/05/2012 (5:16 am)
Yeah probably Jeff, I might give your method a try with future models I'm using where the collision mesh can be based on the model.

The main issue I had was that when the shape editor created my shapes collisions the holes in the wall didn't allow the character to move through them. I got around this by creating my own collision mesh with boxes, thats when I ran into the issue with the export.

I'm also considering performance because I want to introduce some intricate buildings and corridors into my game that allows my character to travel through them.

I'll keep your method in mind though, thanks for that, it would probably improved performance to save the shape into DTS.