Game Development Community

[Resolved][T3D 1.1 Alpha] Bad World Box trying to load Collada model with addMesh in constructor

by Ted Southard · in Torque 3D Professional · 04/19/2010 (2:02 pm) · 7 replies

As the subject says, I'm having a hell of a time trying to load a specific Collada model into T3D 1.1 Alpha. At the tail end of the "Loading Objects" phase, where the object should be getting spawned as the player and set in a specific location in the level, I get the following error:

Quote:SceneObject::resetWorldBox - Bad world box!

The object loads fine otherwise, and while the game won't start as player without it, I don't get the error if I rem out the line I use to add the collision mesh (which has been working just fine) in its onLoad():

%this.addMesh("cube", "bounds", "col-1");

Anyone have any ideas on this?

[UPDATE:] There was a mass setting in the FlyerVehicle datablock set to 0, where it should be a non-zero value.

#1
04/20/2010 (12:15 am)
Hi Ted,

I've seen that error before when the computed bounds is wrong for some reason. Could you check if a fixed size box mesh works? eg.

%this.addMesh("cube", "1 1 3", "col-1");
#2
04/20/2010 (8:09 pm)
@Chris: No joy. Tried that, and even rolled back all the changes I made to the engine in case that was it, with no effect. It seems to be centered around the addMesh() function, since there's no crash unless I place that line in there...
#3
04/21/2010 (2:02 am)
Could you try commenting out the code in TSShape::addMesh that updates the shape bounds?
#4
04/21/2010 (9:10 am)
Still no joy. Of note that I didn't realize before (because I have projects spanning different revisions of the engine, and I was apparently on a crack bender at the time) is that this is on 1.1 Alpha. I made changes to the thread accordingly, and I'm going to port the game over to 1.1 Beta to see if that relieves the issue and update here...
#5
04/23/2010 (1:08 pm)
Ported to T3D1.1 Beta, and still no joy. I also tried using another object being used in the game and it loads fine on its own, just like the last one, but once that addMesh("cube", "bounds", "Col-1"); line is hit, I get that Bad World Box error.

I also tried Chris' addMesh changes to code, with the same result.
#6
04/23/2010 (8:42 pm)
Okay, I've resolved it by copying and pasting several scripts into the project from an earlier and somewhat unrelated project, so the problem is not code related. It is also not related to the model itself, since the vehicle model has not changed.

Right now, it's either some datablock setting somewhere, or possibly some weird line in script (can't believe this hung me up for as long as it has). Once I have it narrowed, I will post.
#7
04/23/2010 (9:14 pm)
Okay, yeah, the FlyingVehicle datablock does need a mass > 0, doesn't it? Set to even 1, it works. Question is (and there's no answer for this), why was it working with this setting before, since I had knowingly set this in experimenting with gravity, and had no issues? Who knows, but there you go folks...