Original Post
🔒 Locked
more pointers
Advertisement
There are perfectly valid reasons for it.
Say you have your game objects arranged into systems (e.g., particle or similar systems, in which objects are individual but related). Additionally, though, any object can have child object systems. An example might be a Object "sun" with a child ObjectSystem containing the Objects "mars","venus", and so forth; each planet would have a subsystem containing its moons, and so forth.
It's not the only way to do things, but it's a good one for some purposes (like preserving relationships between objects in a system).
[edit]code tag[/edit]
---
blahpers
[edited by - blahpers on April 11, 2002 11:01:08 PM]
Say you have your game objects arranged into systems (e.g., particle or similar systems, in which objects are individual but related). Additionally, though, any object can have child object systems. An example might be a Object "sun" with a child ObjectSystem containing the Objects "mars","venus", and so forth; each planet would have a subsystem containing its moons, and so forth.
class Object;
class ObjectSystem;
class Object
{
// ...
ObjectSystem* subSystems;
};
class ObjectSystem
{
// ...
Object* objects;
};
It's not the only way to do things, but it's a good one for some purposes (like preserving relationships between objects in a system).
[edit]code tag[/edit]
---
blahpers
[edited by - blahpers on April 11, 2002 11:01:08 PM]
another good example where stuff like this always is needed :
crappymath.h
vector vs matrix (mul = transform etc)
matrix vs vector (mul = scale etc)
matrix vs quaternion ( ''='' = quaternion to matrix etc)
quaternion vs matrix ( ''='' = matrix to quaternion etc)
well just a few examples of that its NOT a hack to do stuff like that.. its really needed in objectoriented programming
crappymath.h
vector vs matrix (mul = transform etc)
matrix vs vector (mul = scale etc)
matrix vs quaternion ( ''='' = quaternion to matrix etc)
quaternion vs matrix ( ''='' = matrix to quaternion etc)
well just a few examples of that its NOT a hack to do stuff like that.. its really needed in objectoriented programming
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement