Re: [gluon] GluonGraphics and physics

[ Thread Index | Date Index | More lists.tuxfamily.org/gluon Archives ]


On Sunday 10 January 2010 04:43:06 idk wrote:
> So, what do you plan for physics api ?
> 

The plan was to have it component-based only. I think we may still need some 
glue-code but that is something to look into for whoever will work on the 
components.

> So, I have done some work on gluon qt only. Currently we have some class
> like :
> 
> GluonGraphics::GLWidget , and GluonGraphics::Engine
> 
> It works like this :
> 
> GluonGraphics::Item * item ...
> engine->addItem(item);
> view->setEngine(engine);
> 

Hmm, no offense, but why?

If Engine is a singleton (like we discussed on the meeting) then you can 
remove the last two lines as both Item and Widget, because those can be 
handled internally.

So instead of:

GluonGraphics::Item * item ...
engine->addItem(item);

You get:

GluonGraphics::Item *item

Item::Item() // Item ctor
{
	... init code ...
 	Engine::instance()->addItem(this);
}	

Making the actual usage API cleaner.

Also, might it be an idea to remove the "GL" from GLWidget"? Library users 
really shouldn't care too much about such implementation details.

> So, now how do you want to use physics ? Would you like to give me a shema
> about it ?

Basically, we need some components like PhysicsBodyComponent, 
CircleCollisionComponent and others. 

---
+----------------------------------------------+
Gluon is a high-level game development library for the KDE desktop enviornment.
http://gluon.tuxfamily.org/
http://gitorious.org/gluon



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/