I'm quite happy aesthetically with the way my newest class looks. The new kxLight class is a composition of three elements, a dynamic irrlicht ILightSceneNode that actually lights the scene, an IBillboardSceneNode that renders the white circles, and a btRigidBody with a btSphereShape collision shape. Thus the lights are highly dynamic and interactive. The player can push them around and see how the scene's lighting will change dynamically. I have a number of ideas for creative ways to use this dynamic in gameplay.
Also the class design is a reversion to my original class design, in which they are separate from the irrlicht node hierarchy, i.e. the class does not inherit from an irr::scene::ISceneNode. More like a wrapper. But I'm not sure if this change is going to work out. Feels better and simpler for a number of reasons, but it would mean another major class refactor. Getting tired of doing that. Although I am feeling the need to insert a kxEntity class above all my classes that holds the context reference. All of my classes are calling the singleton kx::getInstance() method to get access to the context. This is code duplication. Wouldn't it be better just to inherit from the kxEntity base class which comes with the context?
No comments:
Post a Comment