mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Initial creation of the Node Update Callback.
This commit is contained in:
14
Scene.cpp
14
Scene.cpp
@@ -35,6 +35,13 @@ Node::Node() : initialized_(false), visible_(true), refcount_(0)
|
||||
Node::~Node ()
|
||||
{
|
||||
|
||||
std::list<UpdateCallback *>::iterator iter;
|
||||
for (iter=update_callbacks_.begin(); iter != update_callbacks_.end(); )
|
||||
{
|
||||
UpdateCallback *callback = *iter;
|
||||
iter = update_callbacks_.erase(iter);
|
||||
delete callback;
|
||||
}
|
||||
}
|
||||
|
||||
void Node::copyTransform(Node *other)
|
||||
@@ -47,12 +54,13 @@ void Node::copyTransform(Node *other)
|
||||
translation_ = other->translation_;
|
||||
}
|
||||
|
||||
void Node::update( float )
|
||||
void Node::update( float dt)
|
||||
{
|
||||
std::list<Node::NodeUpdateCallback>::iterator iter;
|
||||
std::list<UpdateCallback *>::iterator iter;
|
||||
for (iter=update_callbacks_.begin(); iter != update_callbacks_.end(); iter++)
|
||||
{
|
||||
(*iter)(this);
|
||||
if ((*iter)->enabled())
|
||||
(*iter)->update(this, dt);
|
||||
}
|
||||
|
||||
// update transform matrix from attributes
|
||||
|
||||
Reference in New Issue
Block a user