Game Development Community

Adding a 3D cube

by Mike Couture · in · 10/08/2008 (8:55 pm) · 3 replies

Hi

I have been working in Chapter 13 and I am at the point where I want to add a 3D prim into my level. I don't know if this is stated anywhere else, but there is no T3DBox component. I tried to explicity define it by using:

GarageGames.Torque.T3D.T3DBox boxComponent = new GarageGames.Torque.T3D.T3DBox();

but I get an error saying:

'GarageGames.Torque.T3D.T3DBox' is inaccessible due to its protection level'


Also, in the same method, the component SimpleMaterial does not exist. I get this error when trying to use it:

SimpleMaterial material = new SimpleMaterial();

'The type or namespace name 'SimpleMaterial' could not be found (are you missing a using directive or an assembly reference?)'


But I changed it to:

GarageGames.Torque.Materials.SimpleMaterial material = new GarageGames.Torque.Materials.SimpleMaterial();

and it works just fine.

My question is why it doesn't work for the T3DBox, and why it is saying it is because of it's protection level.

Thanks

Mike C.

#1
10/09/2008 (12:28 pm)
And what is even more interesting is that the 3D Builder can access the T3DBox and place into XML just fine.

Oops!
#2
10/10/2008 (9:20 am)
In the next version of the Torque X engine, these classes are public and exposed, along with a few other new primitive classes. That release is coming really soon. The 3D Builder is based on that version of the engine, so that's why it's able to create those objects and expose them. So, as far as using cube/sphere/plane in the 3D Builder goes, that code will only work with the new engine.

John K.
#3
10/10/2008 (9:34 am)
Thanks for the Update, John.

I just recently bought the Torque X Pro engine. Existing customers recieve this updated engine for free, right?

Thanks.

Alex T.