goat3d

annotate src/node.cc @ 66:3751aabbc5b3

igame animation api is weird...
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 19 Apr 2014 07:56:43 +0300
parents 498ca7ac7047
children 99715321ad6d
rev   line source
nuclear@0 1 #include <algorithm>
nuclear@0 2 #include <string.h>
nuclear@0 3 #include "node.h"
nuclear@0 4
nuclear@47 5 using namespace g3dimpl;
nuclear@47 6
nuclear@0 7 Node::Node()
nuclear@0 8 {
nuclear@8 9 obj = 0;
nuclear@0 10 }
nuclear@0 11
nuclear@8 12 void Node::set_object(Object *obj)
nuclear@0 13 {
nuclear@8 14 this->obj = obj;
nuclear@0 15 }
nuclear@0 16
nuclear@8 17 Object *Node::get_object()
nuclear@0 18 {
nuclear@8 19 return obj;
nuclear@0 20 }
nuclear@0 21
nuclear@8 22 const Object *Node::get_object() const
nuclear@0 23 {
nuclear@8 24 return obj;
nuclear@0 25 }
nuclear@0 26
nuclear@47 27 void g3dimpl::delete_node_tree(Node *n)
nuclear@0 28 {
nuclear@56 29 if(!n) return;
nuclear@56 30
nuclear@8 31 for(int i=0; i<n->get_children_count(); i++) {
nuclear@8 32 delete_node_tree((Node*)n->get_child(i));
nuclear@0 33 }
nuclear@8 34 delete n;
nuclear@0 35 }