Questions regarding Datablocks and thier use
by \"Robert Jaramillo\" · in Torque Game Engine · 02/17/2010 (7:36 pm) · 1 replies
Hello, everyone
I am a little confused on the general use of data blocks and? My main point of confusion comes from when is the right time to use them? To my understanding they share the same attributes with multiple objects, which makes them similar to a singleton in C++. However I am also getting the impression that they are used to extend classes? which doesn't make sense to me by any means. I would really appreciate anyone who could help clear this up for me a whole thanks you guys and have a nice day. Look forward to hearing from you soon.
I am a little confused on the general use of data blocks and? My main point of confusion comes from when is the right time to use them? To my understanding they share the same attributes with multiple objects, which makes them similar to a singleton in C++. However I am also getting the impression that they are used to extend classes? which doesn't make sense to me by any means. I would really appreciate anyone who could help clear this up for me a whole thanks you guys and have a nice day. Look forward to hearing from you soon.
Torque Owner Daniel Buckmaster
T3D Steering Committee
'When to use them' is basically always, since most objects require a datablock, or they will not be created. This makes sense, since datablocks specify things like which shape file to use - can't create a WheeledVehicle with no body.
See this thread for a little more info on that. Basically, datablock names are used kind of like 'namespaces' for objects. It's a weird system, but I find it makes sense and works well once you get your head around it.