Game Development Community

What does exampleObjects are for?

by Joao Sousa · in Torque 3D Beginner · 07/06/2013 (9:56 pm) · 4 replies

Hello all,

Anybody knows what does exampleObjects (RenderMesh Example; RenderObjectExample and RenderShapeExample) are for?

They are positioned in the Level tab in the folder exampleObjects in the World Editor.

I am asking because the unique reference I have found in the Internet and GG forums about it was in the official documentation of the Torque 3D, which has only a vague definition ("The ExampleObjects sub-category contains example rendering classes created in C + +."), however, there is no explanation of their function or practical example showing them in action.

What I have learned by myself was that RenderMeshExample and RenderShapeExample both accept material texturing, can change position, be resized, however, do not have any collision with the player character.

The RenderObjectExample is a colorful cube that resembles an old cube spinning in a directx app of the MS Windows called dxdiag.exe. Besides, there is no field in the World Editor concerning to material texturing for it.

I thank you in advance for any clarifications on this subject.

Greetings,

#1
07/06/2013 (10:24 pm)
Those objects are just examples designed to show you how to create your own objects/classes that interface with Torque. The important thing about them isn't that they render or show up in the editor but -how- they do those things (because each object renders itself a little differently to demonstrate the various ways of using Torque's renderer).

RenderObjectExample shows how to have an object handle its own rendering while still utilizing the material system.

RenderMeshExample shows the preferred way of rendering a simple shape. It feeds data into the RenderMeshMgr which handles all of the rendering.

RenderShapeExample shows how to create an object that makes use of Torque's 'TS' (ThreeSpace) system. TS objects provide support for loading and rendering various mesh formats, mesh level-of-detail and animation.

You'll want to check out their C++ code in the engine/T3D/examples/ directory.

#2
07/07/2013 (3:16 pm)
@Chris Haigler,

Thank you so much for your detailed information and explanations on the exampleObjects and point me out where they are located in Torque 3D.

All these stuffs are a bit complicated to understand; I might be wrong, since I'm not a professional programmer in C + +, but from what I could comprehend the exampleObjects are not a type of objects to be placed directly in the game scene, such as clouds, skybox, such as water or meshes, crates or barrels, etc...in a manner that they might be viewed or interact with other objects.

Therefore, in a simplified way, I think they are unlike types of header files with several classes, function declarations, etc....that form three different types of libraries, responsible for the whole rendering system process of the Torque 3D and that are shared by source program of the Torque 3D; however, I'm not completely sure about it though.

Thank you once again for your help.

Regards,
#3
07/07/2013 (5:02 pm)
The example objects are 'real' objects just like any other in the engine. They have the same core functionality as other, more complicated classes (that is, they can render themselves, hook into the console/scripting system, are networked, etc.) but they don't have any specialized functionality so there's no reason to use them in a level.
#4
07/07/2013 (10:52 pm)
@Chris Haigler,

Thank you for your additional information.

Since in the Library tab most or all objects can be added straight in the level I thought the example Objects could also with some usefulness.

Moreover, unless they (example Objects) have some functionality unknown or undisclosed just in case of them be placed directly from the Library Tab into the game level, so I think this subcategory might be removed from the Library Tab in the next updates T3D, unless there are strong reasons to keep them in Library tab, however, just my opinion.

Cheers,