MCPcopy Create free account
hub / github.com/SoarGroup/Soar / get_vec3

Method get_vec3

Core/SVS/src/soar_interface.cpp:112–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110
111
112bool soar_interface::get_vec3(Symbol* id, const string& attr, vec3& val)
113{
114 vec3 res;
115
116 // First find the vec3 wme
117 wme* vec3_wme;
118 if (!find_child_wme(id, attr.c_str(), vec3_wme))
119 {
120 return false;
121 }
122 Symbol* vec3_root = get_wme_val(vec3_wme);
123
124 // Then find each dimension to make up the vec3
125 const char* dims[] = { "x", "y", "z" };
126 for (int d = 0; d < 3; d++)
127 {
128 wme* dim_wme;
129 double dim_val = 0.0;
130 if (!find_child_wme(vec3_root, dims[d], dim_wme)
131 || !get_symbol_value(get_wme_val(dim_wme), dim_val))
132 {
133 return false;
134 }
135 res[d] = dim_val;
136 }
137 val = res;
138 return true;
139}
140
141
142bool soar_interface::find_child_wme(Symbol* id, const string& attr, wme*& w)

Callers 3

parseMethod · 0.80
parseMethod · 0.80
parseMethod · 0.80

Calls 1

get_symbol_valueFunction · 0.85

Tested by

no test coverage detected