Solar System - demo scence
Transforms

Functions

void operations_push_transform_attributes (tinyxml2::XMLElement *transform, std::vector< float > *operations)
 
void operations_push_transforms (tinyxml2::XMLElement *transforms, std::vector< float > *operations)
 

Detailed Description

Function Documentation

◆ operations_push_transform_attributes()

void operations_push_transform_attributes ( tinyxml2::XMLElement *  transform,
std::vector< float > *  operations 
)
45 {
46 if (!transform) return;
47
48 float angle = transform->FloatAttribute("angle");
49 if ((int) angle)
50 operations->push_back(angle);
51
52 operations->push_back(transform->FloatAttribute("x"));
53 operations->push_back(transform->FloatAttribute("y"));
54 operations->push_back(transform->FloatAttribute("z"));
55}

Referenced by operations_load_xml(), and operations_push_transforms().

◆ operations_push_transforms()

void operations_push_transforms ( tinyxml2::XMLElement *  transforms,
std::vector< float > *  operations 
)
57 {
58 tinyxml2::XMLElement *transform = transforms->FirstChildElement();
59
60 do {
61 const char *transformValue = transform->Value();
62
63 if (!strcmp("translate", transformValue))
64 operations->push_back(TRANSLATE);
65 else if (!strcmp("rotate", transformValue))
66 operations->push_back(ROTATE);
67 else if (!strcmp("scale", transformValue))
68 operations->push_back(SCALE);
69 else {
70 fprintf(stderr, "Unknown transform: \"%s\"", transformValue);
71 exit(1);
72 }
73
74 operations_push_transform_attributes(transform, operations);
75
76 } while ((transform = transform->NextSiblingElement()));
77}
void operations_push_transform_attributes(tinyxml2::XMLElement *transform, std::vector< float > *operations)
Definition: parsing.cpp:45
static const int TRANSLATE
Definition: parsing.cpp:7
static const int SCALE
Definition: parsing.cpp:9
static const int ROTATE
Definition: parsing.cpp:8

References operations_push_transform_attributes(), ROTATE, SCALE, and TRANSLATE.

Referenced by operations_push_groups().