Game Development Community

using a c++ sceneobject class to draw multiple objects

by Junior b · in Torque Game Engine · 02/19/2009 (11:30 am) · 2 replies

Hi,

I have a class that draws a cube, i've made another class to draw multiple cubes. How do i get a class (c++) to draw multiple cubes but under a single object so when in the World Editor and i select it, it selects 5 individual cubes under a single object and possible be able to modify each cube individually.

for easier understanding --->, A singleCube class (draws a single cube). A multipleCube class, draws 5 singleCubes..... so selecting a multipleCube object should show/select 5 singleCube objects and possibly select each individual singleCube objects for modifications
i cant seem to get the multipleCube class to draw 5 singleCubes in that fashion :(

ALL IN C++ PLEASE, if this just requires some sort of attention towards the matrixes then that may be enough as i can get multiple cubes drawn but they are not registered as actual singleCubes, just as NULL.

#1
06/16/2010 (2:57 pm)
i've done this. you will not easily be able to do it w/ world editor integration, but you can certainly add console methods to manipulate all of the shapeinstances within your scene object. i throw all meshes in the scene as tsstatics, manipulate them until looks good, then save out the transforms and apply to the shapeinstances in my hierarchical sceneobject
#2
06/16/2010 (4:51 pm)
I would have used the multipleCube class to actually create five singleCube objects - separate scene objects in their own right. Then add some selection logic so that when you select one of the cubes, they're all selected, or something like that. But of course, you'd need some way to allow individuals to be selected so they can be manipulated separately.