12 writeHumanoidNode(binfo, ofs);
17 for (
int i=0;
i<m_indent;
i++) ofs <<
" ";
22 m_use_inline_shape = use_inline;
27 LinkInfo &linfo = links[index];
28 indent(ofs); ofs <<
"DEF " << linfo.name <<
" Joint {" << std::endl;
30 if (linfo.translation[0] || linfo.translation[1] || linfo.translation[2]){
31 indent(ofs); ofs <<
"translation " << linfo.translation[0] <<
" " 32 << linfo.translation[1] <<
" " << linfo.translation[2]
35 if (linfo.rotation[3]){
36 indent(ofs); ofs <<
"rotation " << linfo.rotation[0] <<
" " 37 << linfo.rotation[1] <<
" " << linfo.rotation[2]
38 <<
" " << linfo.rotation[3] << std::endl;
40 if (linfo.jointId != -1){
41 indent(ofs); ofs <<
"jointId " << linfo.jointId << std::endl;
43 indent(ofs); ofs <<
"jointType \"" << linfo.jointType <<
"\"" << std::endl;
44 indent(ofs); ofs <<
"jointAxis " << linfo.jointAxis[0] <<
" " 45 << linfo.jointAxis[1] <<
" " << linfo.jointAxis[2]
47 if (linfo.ulimit.length()){
48 indent(ofs); ofs <<
"ulimit " << linfo.ulimit[0] << std::endl;
50 if (linfo.llimit.length()){
51 indent(ofs); ofs <<
"llimit " << linfo.llimit[0] << std::endl;
53 if (linfo.uvlimit.length()){
54 indent(ofs); ofs <<
"uvlimit " << linfo.uvlimit[0] << std::endl;
56 if (linfo.lvlimit.length()){
57 indent(ofs); ofs <<
"lvlimit " << linfo.lvlimit[0] << std::endl;
59 if (linfo.gearRatio != 1){
60 indent(ofs); ofs <<
"gearRatio " << linfo.gearRatio << std::endl;
62 if (linfo.rotorInertia){
63 indent(ofs); ofs <<
"rotorInertia " << linfo.rotorInertia << std::endl;
65 if (linfo.rotorResistor){
66 indent(ofs); ofs <<
"rotorResistor " << linfo.rotorResistor << std::endl;
68 if (linfo.torqueConst != 1){
69 indent(ofs); ofs <<
"torqueConst " << linfo.torqueConst << std::endl;
71 if (linfo.encoderPulse != 1){
72 indent(ofs); ofs <<
"encoderPulse " << linfo.encoderPulse << std::endl;
74 indent(ofs); ofs <<
"children [" << std::endl;
76 if (linfo.segments.length() > 0) {
77 indent(ofs); ofs <<
"DEF " << linfo.segments[0].name <<
" Segment {" << std::endl;
79 indent(ofs); ofs <<
"DEF " << linfo.name <<
"_s Segment {" << std::endl;
82 indent(ofs); ofs <<
"mass " << linfo.mass << std::endl;
83 indent(ofs); ofs <<
"centerOfMass " << linfo.centerOfMass[0] <<
" " 84 << linfo.centerOfMass[1] <<
" " 85 << linfo.centerOfMass[2] << std::endl;
86 indent(ofs); ofs <<
"momentsOfInertia [";
87 for (
size_t i=0;
i<9;
i++) ofs << linfo.inertia[
i] <<
" ";
88 ofs <<
"]" << std::endl;
89 indent(ofs); ofs <<
"children [" << std::endl;
91 TransformedShapeIndexSequence &tsis = linfo.shapeIndices;
92 if (m_use_inline_shape) {
93 std::string fname ( linfo.segments.length() > 0?linfo.segments[0].name:linfo.name );
95 indent(ofs); ofs <<
"Inline { url \"" << fname <<
"\" }" << std::endl;
96 std::ofstream sofs(fname.c_str());
97 for (
size_t i=0;
i<tsis.length();
i++){
98 writeShape(tsis[
i], sofs);
102 for (
size_t i=0;
i<tsis.length();
i++){
103 writeShape(tsis[
i], ofs);
106 for (
size_t i=0;
i<linfo.sensors.length();
i++){
107 SensorInfo &si = linfo.sensors[
i];
108 std::string
type = (
const char *)si.type;
109 indent(ofs); ofs <<
"DEF " << si.name <<
" ";
110 if (type ==
"Force"){
111 ofs <<
"ForceSensor{" << std::endl;
112 }
else if (type ==
"RateGyro"){
113 ofs <<
"Gyro{" << std::endl;
114 }
else if (type ==
"Acceleration"){
115 ofs <<
"AccelerationSensor{" << std::endl;
116 }
else if (type ==
"Vision"){
117 ofs <<
"VisionSensor{" << std::endl;
118 }
else if (type ==
"Range"){
119 ofs <<
"RangeSensor{" << std::endl;
121 std::cerr <<
"unknown sensor type(" << type <<
")" << std::endl;
124 indent(ofs); ofs <<
"translation " << si.translation[0] <<
" " 125 << si.translation[1] <<
" " << si.translation[2]
127 indent(ofs); ofs <<
"rotation " << si.rotation[0] <<
" " 128 << si.rotation[1] <<
" " << si.rotation[2] <<
" " 129 << si.rotation[3] << std::endl;
130 indent(ofs); ofs <<
"sensorId " << si.id << std::endl;
131 if (si.shapeIndices.length()){
132 indent(ofs); ofs <<
"children[" << std::endl;
134 if (m_use_inline_shape) {
135 std::string fname (si.name);
137 indent(ofs); ofs <<
"inline {url \"" << fname <<
"\" }" << std::endl;
138 std::ofstream sofs( fname.c_str() );
139 for (
size_t j=0;
j<si.shapeIndices.length();
j++){
140 writeShape(si.shapeIndices[
j], sofs);
144 for (
size_t j=0;
j<si.shapeIndices.length();
j++){
145 writeShape(si.shapeIndices[
j], ofs);
149 indent(ofs); ofs <<
"]" << std::endl;
152 indent(ofs); ofs <<
"} #Sensor" << std::endl;
155 indent(ofs); ofs <<
"]" << std::endl;
157 if (linfo.segments.length() > 0) {
158 indent(ofs); ofs <<
"} #Segment " << linfo.segments[0].name << std::endl;
160 indent(ofs); ofs <<
"} #Segment " << linfo.name <<
"_s" << std::endl;
162 for (
size_t i=0;
i<linfo.childIndices.length();
i++){
163 writeLink(linfo.childIndices[
i], ofs);
166 indent(ofs); ofs <<
"]" << std::endl;
168 indent(ofs); ofs <<
"} #Joint " << linfo.name << std::endl;
173 indent(ofs); ofs <<
"Transform {" << std::endl;
175 if (tsi.transformMatrix[3] || tsi.transformMatrix[7] || tsi.transformMatrix[11]){
176 indent(ofs); ofs <<
"translation " << tsi.transformMatrix[3] <<
" " 177 << tsi.transformMatrix[7] <<
" " 178 << tsi.transformMatrix[11] <<
" " << std::endl;
181 xaxis << tsi.transformMatrix[0],tsi.transformMatrix[4],tsi.transformMatrix[8];
182 yaxis << tsi.transformMatrix[1],tsi.transformMatrix[5],tsi.transformMatrix[9];
183 zaxis << tsi.transformMatrix[2],tsi.transformMatrix[6],tsi.transformMatrix[10];
184 indent(ofs); ofs <<
"scale " << xaxis.norm() <<
" " << yaxis.norm() <<
" " << zaxis.norm() << std::endl;
189 R << xaxis[0], yaxis[0], zaxis[0],
190 xaxis[1], yaxis[1], zaxis[1],
191 xaxis[2], yaxis[2], zaxis[2];
193 double th = omega.norm();
196 indent(ofs); ofs <<
"rotation " << axis[0] <<
" " << axis[1] <<
" " 197 << axis[2] <<
" " << th << std::endl;
199 indent(ofs); ofs <<
"children [" << std::endl;
201 indent(ofs); ofs <<
"Shape {" << std::endl;
203 ShapeInfo &si = shapes[tsi.shapeIndex];
204 AppearanceInfo &
app = appearances[si.appearanceIndex];
205 switch(si.primitiveType){
207 indent(ofs); ofs <<
"geometry IndexedFaceSet{" << std::endl;
209 indent(ofs); ofs <<
"coord Coordinate{" << std::endl;
211 indent(ofs); ofs <<
"point[" << std::endl;
212 for (
size_t i=0;
i<si.vertices.length()/3;
i++){
213 indent(ofs); ofs <<
" " << si.vertices[
i*3] <<
" " 214 << si.vertices[
i*3+1] <<
" " << si.vertices[
i*3+2]
217 indent(ofs); ofs <<
"]" << std::endl;
219 indent(ofs); ofs <<
"} #Coordinates" << std::endl;
220 indent(ofs); ofs <<
"coordIndex [" << std::endl;
221 for (
size_t i=0;
i<si.triangles.length()/3;
i++){
222 indent(ofs); ofs <<
" " << si.triangles[
i*3] <<
"," 223 << si.triangles[
i*3+1] <<
"," 224 << si.triangles[
i*3+2] <<
", -1," << std::endl;
226 indent(ofs); ofs <<
"]" << std::endl;
227 indent(ofs); ofs <<
"normal Normal{" << std::endl;
229 indent(ofs); ofs <<
"vector [" << std::endl;
230 for (
size_t i=0;
i<app.normals.length()/3;
i++){
231 indent(ofs); ofs <<
" " << app.normals[
i*3] <<
" " 232 << app.normals[
i*3+1] <<
" " << app.normals[
i*3+2]
235 indent(ofs); ofs <<
"]" << std::endl;
237 indent(ofs); ofs <<
"} #Normal" << std::endl;
238 indent(ofs); ofs <<
"normalIndex [" << std::endl;
239 for (
size_t i=0;
i< app.normalIndices.length()/3;
i++){
240 indent(ofs); ofs <<
" " << app.normalIndices[
i*3] <<
"," 241 << app.normalIndices[
i*3+1] <<
"," 242 << app.normalIndices[
i*3+2] <<
", -1," 245 indent(ofs); ofs <<
"]" << std::endl;
246 indent(ofs); ofs <<
"normalPerVertex " << (app.normalPerVertex ?
"TRUE" :
"FALSE") << std::endl;
247 indent(ofs); ofs <<
"solid " << (app.solid ?
"TRUE" :
"FALSE") << std::endl;
248 if (app.creaseAngle){
249 indent(ofs); ofs <<
"creaseAngle " << app.creaseAngle << std::endl;
251 if (app.colors.length()){
252 indent(ofs); ofs <<
"color Color{" << std::endl;
253 indent(ofs); ofs <<
" color " << app.colors[0] <<
" " << app.colors[1] <<
" " << app.colors[2] << std::endl;;
254 indent(ofs); ofs <<
"}" << std::endl;
256 if (app.colorIndices.length()){
257 indent(ofs); ofs <<
"colorIndex [" << std::endl;
259 for (
size_t j=0;
j<app.colorIndices.length();
j++){
260 ofs << app.colorIndices[
j] <<
",";
264 indent(ofs); ofs <<
"]" << std::endl;
266 indent(ofs); ofs <<
"colorPerVertex " << (app.colorPerVertex ?
"TRUE" :
"FALSE") << std::endl;
267 if (app.textureCoordinate.length()){
268 indent(ofs); ofs <<
"texCoord TextureCoordinate {" << std::endl;
270 indent(ofs); ofs <<
"point [" << std::endl;
272 for (
size_t j=0;
j<app.textureCoordinate.length()/2;
j++){
273 indent(ofs); ofs << app.textureCoordinate[
j*2] <<
" " 274 << app.textureCoordinate[
j*2+1] <<
"," 278 indent(ofs); ofs <<
"]" << std::endl;
280 indent(ofs); ofs <<
"}" << std::endl;
282 if (app.textureCoordIndices.length()){
283 indent(ofs); ofs <<
"texCoordIndex [" << std::endl;
285 for (
size_t j=0;
j<app.textureCoordIndices.length()/3;
j++){
286 indent(ofs); ofs << app.textureCoordIndices[
j*3] <<
"," 287 << app.textureCoordIndices[
j*3+1] <<
"," 288 << app.textureCoordIndices[
j*3+2] <<
",-1," << std::endl;
292 indent(ofs); ofs <<
"]" << std::endl;
296 indent(ofs); ofs <<
"} #IndexedFaceSet" << std::endl;
299 indent(ofs); ofs <<
"geometry Box{" << std::endl;
300 indent(ofs); ofs <<
" size " << si.primitiveParameters[0] <<
" " 301 << si.primitiveParameters[1] <<
" " 302 << si.primitiveParameters[2] << std::endl;
303 indent(ofs); ofs <<
"}" << std::endl;
306 indent(ofs); ofs <<
"geometry Cylinder{" << std::endl;
307 indent(ofs); ofs <<
" radius " << si.primitiveParameters[0] << std::endl;
308 indent(ofs); ofs <<
" height " << si.primitiveParameters[1] << std::endl;
309 indent(ofs); ofs <<
" top " << (si.primitiveParameters[2] ?
"TRUE" :
"FALSE") << std::endl;
310 indent(ofs); ofs <<
" bottom " << (si.primitiveParameters[3] ?
"TRUE" :
"FALSE") << std::endl;
311 indent(ofs); ofs <<
" side " << (si.primitiveParameters[4] ?
"TRUE" :
"FALSE") << std::endl;
312 indent(ofs); ofs <<
"}" << std::endl;
315 indent(ofs); ofs <<
"geometry Cone {" << std::endl;
316 indent(ofs); ofs <<
" bottomRadius " << si.primitiveParameters[0] << std::endl;
317 indent(ofs); ofs <<
" height " << si.primitiveParameters[1] << std::endl;
318 indent(ofs); ofs <<
" bottom " << (si.primitiveParameters[2] ?
"TRUE" :
"FALSE") << std::endl;
319 indent(ofs); ofs <<
" side " << (si.primitiveParameters[3] ?
"TRUE" :
"FALSE") << std::endl;
320 indent(ofs); ofs <<
"}" << std::endl;
323 indent(ofs); ofs <<
"geometry Sphere {" << std::endl;
324 indent(ofs); ofs <<
" radius " << si.primitiveParameters[0] << std::endl;
325 indent(ofs); ofs <<
"}" << std::endl;
328 indent(ofs); ofs <<
"geometry Plane{" << std::endl;
329 indent(ofs); ofs <<
" size " << si.primitiveParameters[0] <<
" " 330 << si.primitiveParameters[1] <<
" " 331 << si.primitiveParameters[2] << std::endl;
332 indent(ofs); ofs <<
"}" << std::endl;
335 std::cerr <<
"unknown primitive type:" << si.primitiveType << std::endl;
337 if (app.materialIndex >= 0){
338 MaterialInfo &mat = materials[app.materialIndex];
339 indent(ofs); ofs <<
"appearance Appearance{" << std::endl;
341 indent(ofs); ofs <<
"material Material{" << std::endl;
343 indent(ofs); ofs <<
"ambientIntensity " << mat.ambientIntensity
345 indent(ofs); ofs <<
"diffuseColor " << mat.diffuseColor[0] <<
" " 346 << mat.diffuseColor[1] <<
" " << mat.diffuseColor[2]
348 indent(ofs); ofs <<
"emissiveColor " << mat.emissiveColor[0] <<
" " 349 << mat.emissiveColor[1] <<
" " 350 << mat.emissiveColor[2] << std::endl;
351 indent(ofs); ofs <<
"shininess " << mat.shininess << std::endl;
352 indent(ofs); ofs <<
"specularColor " << mat.specularColor[0] <<
" " 353 << mat.specularColor[1] <<
" " 354 << mat.specularColor[2] << std::endl;
355 indent(ofs); ofs <<
"transparency " << mat.transparency << std::endl;
357 indent(ofs); ofs <<
"} #Material" << std::endl;
358 if (app.textureIndex >= 0){
359 TextureInfo &ti = textures[app.textureIndex];
360 indent(ofs); ofs <<
"texture ImageTexture{" << std::endl;
361 indent(ofs); ofs <<
" repeatS " << (ti.repeatS ?
"TRUE" :
"FALSE")
363 indent(ofs); ofs <<
" repeatT " << (ti.repeatT ?
"TRUE" :
"FALSE")
365 indent(ofs); ofs <<
" url \"" << ti.url <<
"\"" << std::endl;
366 indent(ofs); ofs <<
"}" << std::endl;
367 indent(ofs); ofs <<
"textureTransform TextureTransform{" << std::endl;
371 indent(ofs); ofs <<
"}" << std::endl;
375 indent(ofs); ofs <<
"} #Appearance" << std::endl;
378 indent(ofs); ofs <<
"} #Shape" << std::endl;
380 indent(ofs); ofs <<
"]" << std::endl;
382 indent(ofs); ofs <<
"} #Transform" << std::endl;
387 ofs <<
"DEF " << binfo->name() <<
" Humanoid {" << std::endl;
388 ofs <<
" humanoidBody [" << std::endl;
389 links = binfo->links();
390 shapes = binfo->shapes();
391 appearances = binfo->appearances();
392 materials = binfo->materials();
393 textures = binfo->textures();
396 ofs <<
" ]" << std::endl;
397 ofs <<
" joints [" << std::endl;
398 for (
size_t i=0;
i<links->length();
i++){
399 ofs <<
" USE " << links[
i].name <<
"," << std::endl;
401 ofs <<
" ]" << std::endl;
402 ofs <<
" segments [" << std::endl;
403 for (
size_t i=0;
i<links->length();
i++){
404 if (links[
i].segments.length() > 0) {
405 ofs <<
" USE " << links[
i].segments[0].name <<
"," << std::endl;
407 ofs <<
" USE " << links[
i].name <<
"_s," << std::endl;
410 ofs <<
" ]" << std::endl;
411 ofs <<
" name \"" << binfo->name() <<
"\"" << std::endl;
412 ofs <<
" info [" << std::endl;
413 StringSequence_var
info = binfo->info();
414 for (
size_t i=0;
i<info->length();
i++){
415 ofs <<
" \"" << info[
i] <<
"\"" << std::endl;
417 ofs <<
" ]" << std::endl;
418 ofs <<
"}" << std::endl;
423 ofs <<
"#VRML V2.0 utf8" << std::endl;
424 ofs <<
"" << std::endl;
425 ofs <<
"PROTO Joint [" << std::endl;
426 ofs <<
" exposedField SFVec3f center 0 0 0" << std::endl;
427 ofs <<
" exposedField MFNode children []" << std::endl;
428 ofs <<
" exposedField MFFloat llimit []" << std::endl;
429 ofs <<
" exposedField MFFloat lvlimit []" << std::endl;
430 ofs <<
" exposedField SFRotation limitOrientation 0 0 1 0" << std::endl;
431 ofs <<
" exposedField SFString name \"\"" << std::endl;
432 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
433 ofs <<
" exposedField SFVec3f scale 1 1 1" << std::endl;
434 ofs <<
" exposedField SFRotation scaleOrientation 0 0 1 0" << std::endl;
435 ofs <<
" exposedField MFFloat stiffness [ 0 0 0 ]" << std::endl;
436 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
437 ofs <<
" exposedField MFFloat ulimit []" << std::endl;
438 ofs <<
" exposedField MFFloat uvlimit []" << std::endl;
439 ofs <<
" exposedField SFString jointType \"\"" << std::endl;
440 ofs <<
" exposedField SFInt32 jointId -1" << std::endl;
441 ofs <<
" exposedField SFVec3f jointAxis 0 0 1" << std::endl;
442 ofs <<
"" << std::endl;
443 ofs <<
" exposedField SFFloat gearRatio 1" << std::endl;
444 ofs <<
" exposedField SFFloat rotorInertia 0" << std::endl;
445 ofs <<
" exposedField SFFloat rotorResistor 0" << std::endl;
446 ofs <<
" exposedField SFFloat torqueConst 1" << std::endl;
447 ofs <<
" exposedField SFFloat encoderPulse 1" << std::endl;
448 ofs <<
"]" << std::endl;
449 ofs <<
"{" << std::endl;
450 ofs <<
" Transform {" << std::endl;
451 ofs <<
" center IS center" << std::endl;
452 ofs <<
" children IS children" << std::endl;
453 ofs <<
" rotation IS rotation" << std::endl;
454 ofs <<
" scale IS scale" << std::endl;
455 ofs <<
" scaleOrientation IS scaleOrientation" << std::endl;
456 ofs <<
" translation IS translation" << std::endl;
457 ofs <<
" }" << std::endl;
458 ofs <<
"}" << std::endl;
459 ofs <<
"" << std::endl;
460 ofs <<
"PROTO Segment [" << std::endl;
461 ofs <<
" field SFVec3f bboxCenter 0 0 0" << std::endl;
462 ofs <<
" field SFVec3f bboxSize -1 -1 -1" << std::endl;
463 ofs <<
" exposedField SFVec3f centerOfMass 0 0 0" << std::endl;
464 ofs <<
" exposedField MFNode children [ ]" << std::endl;
465 ofs <<
" exposedField SFNode coord NULL" << std::endl;
466 ofs <<
" exposedField MFNode displacers [ ]" << std::endl;
467 ofs <<
" exposedField SFFloat mass 0 " << std::endl;
468 ofs <<
" exposedField MFFloat momentsOfInertia [ 0 0 0 0 0 0 0 0 0 ]" << std::endl;
469 ofs <<
" exposedField SFString name \"\"" << std::endl;
470 ofs <<
" eventIn MFNode addChildren" << std::endl;
471 ofs <<
" eventIn MFNode removeChildren" << std::endl;
472 ofs <<
"]" << std::endl;
473 ofs <<
"{" << std::endl;
474 ofs <<
" Group {" << std::endl;
475 ofs <<
" addChildren IS addChildren" << std::endl;
476 ofs <<
" bboxCenter IS bboxCenter" << std::endl;
477 ofs <<
" bboxSize IS bboxSize" << std::endl;
478 ofs <<
" children IS children" << std::endl;
479 ofs <<
" removeChildren IS removeChildren" << std::endl;
480 ofs <<
" }" << std::endl;
481 ofs <<
"}" << std::endl;
482 ofs <<
"" << std::endl;
483 ofs <<
"PROTO Humanoid [" << std::endl;
484 ofs <<
" field SFVec3f bboxCenter 0 0 0" << std::endl;
485 ofs <<
" field SFVec3f bboxSize -1 -1 -1" << std::endl;
486 ofs <<
" exposedField SFVec3f center 0 0 0" << std::endl;
487 ofs <<
" exposedField MFNode humanoidBody [ ]" << std::endl;
488 ofs <<
" exposedField MFString info [ ]" << std::endl;
489 ofs <<
" exposedField MFNode joints [ ]" << std::endl;
490 ofs <<
" exposedField SFString name \"\"" << std::endl;
491 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
492 ofs <<
" exposedField SFVec3f scale 1 1 1" << std::endl;
493 ofs <<
" exposedField SFRotation scaleOrientation 0 0 1 0" << std::endl;
494 ofs <<
" exposedField MFNode segments [ ]" << std::endl;
495 ofs <<
" exposedField MFNode sites [ ]" << std::endl;
496 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
497 ofs <<
" exposedField SFString version \"1.1\"" << std::endl;
498 ofs <<
" exposedField MFNode viewpoints [ ]" << std::endl;
499 ofs <<
"]" << std::endl;
500 ofs <<
"{" << std::endl;
501 ofs <<
" Transform {" << std::endl;
502 ofs <<
" bboxCenter IS bboxCenter" << std::endl;
503 ofs <<
" bboxSize IS bboxSize" << std::endl;
504 ofs <<
" center IS center" << std::endl;
505 ofs <<
" rotation IS rotation" << std::endl;
506 ofs <<
" scale IS scale" << std::endl;
507 ofs <<
" scaleOrientation IS scaleOrientation" << std::endl;
508 ofs <<
" translation IS translation" << std::endl;
509 ofs <<
" children [" << std::endl;
510 ofs <<
" Group {" << std::endl;
511 ofs <<
" children IS viewpoints" << std::endl;
512 ofs <<
" }" << std::endl;
513 ofs <<
" Group {" << std::endl;
514 ofs <<
" children IS humanoidBody " << std::endl;
515 ofs <<
" }" << std::endl;
516 ofs <<
" ]" << std::endl;
517 ofs <<
" }" << std::endl;
518 ofs <<
"}" << std::endl;
519 ofs <<
"" << std::endl;
520 ofs <<
"PROTO VisionSensor [" << std::endl;
521 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
522 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
523 ofs <<
" exposedField MFNode children [ ]" << std::endl;
524 ofs <<
" exposedField SFFloat fieldOfView 0.785398" << std::endl;
525 ofs <<
" exposedField SFString name \"\"" << std::endl;
526 ofs <<
" exposedField SFFloat frontClipDistance 0.01" << std::endl;
527 ofs <<
" exposedField SFFloat backClipDistance 10.0" << std::endl;
528 ofs <<
" exposedField SFString type \"NONE\"" << std::endl;
529 ofs <<
" exposedField SFInt32 sensorId -1" << std::endl;
530 ofs <<
" exposedField SFInt32 width 320" << std::endl;
531 ofs <<
" exposedField SFInt32 height 240" << std::endl;
532 ofs <<
" exposedField SFFloat frameRate 30" << std::endl;
533 ofs <<
"]" << std::endl;
534 ofs <<
"{" << std::endl;
535 ofs <<
" Transform {" << std::endl;
536 ofs <<
" rotation IS rotation" << std::endl;
537 ofs <<
" translation IS translation" << std::endl;
538 ofs <<
" children IS children" << std::endl;
539 ofs <<
" }" << std::endl;
540 ofs <<
"}" << std::endl;
541 ofs <<
"" << std::endl;
542 ofs <<
"" << std::endl;
543 ofs <<
"PROTO ForceSensor [ " << std::endl;
544 ofs <<
" exposedField SFVec3f maxForce -1 -1 -1" << std::endl;
545 ofs <<
" exposedField SFVec3f maxTorque -1 -1 -1" << std::endl;
546 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
547 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
548 ofs <<
" exposedField SFInt32 sensorId -1" << std::endl;
549 ofs <<
"]" << std::endl;
550 ofs <<
"{" << std::endl;
551 ofs <<
" Transform {" << std::endl;
552 ofs <<
" translation IS translation" << std::endl;
553 ofs <<
" rotation IS rotation" << std::endl;
554 ofs <<
" }" << std::endl;
555 ofs <<
"}" << std::endl;
556 ofs <<
"" << std::endl;
557 ofs <<
"PROTO Gyro [" << std::endl;
558 ofs <<
" exposedField SFVec3f maxAngularVelocity -1 -1 -1" << std::endl;
559 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
560 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
561 ofs <<
" exposedField SFInt32 sensorId -1" << std::endl;
562 ofs <<
"]" << std::endl;
563 ofs <<
"{" << std::endl;
564 ofs <<
" Transform {" << std::endl;
565 ofs <<
" translation IS translation" << std::endl;
566 ofs <<
" rotation IS rotation" << std::endl;
567 ofs <<
" }" << std::endl;
568 ofs <<
"}" << std::endl;
569 ofs <<
"" << std::endl;
570 ofs <<
"PROTO AccelerationSensor [" << std::endl;
571 ofs <<
" exposedField SFVec3f maxAcceleration -1 -1 -1" << std::endl;
572 ofs <<
" exposedField SFVec3f translation 0 0 0" << std::endl;
573 ofs <<
" exposedField SFRotation rotation 0 0 1 0" << std::endl;
574 ofs <<
" exposedField SFInt32 sensorId -1" << std::endl;
575 ofs <<
"]" << std::endl;
576 ofs <<
"{" << std::endl;
577 ofs <<
" Transform {" << std::endl;
578 ofs <<
" translation IS translation" << std::endl;
579 ofs <<
" rotation IS rotation" << std::endl;
580 ofs <<
" }" << std::endl;
581 ofs <<
"}" << std::endl;
void writeLink(int index, std::ostream &ofs)
png_infop png_charp png_int_32 png_int_32 int * type
void writeHumanoidNode(OpenHRP::BodyInfo_var binfo, std::ostream &ofs)
def j(str, encoding="cp932")
std::string indent(int index)
void writeProtoNodes(std::ostream &ofs)
void useInlineShape(bool use_inline)
HRP_UTIL_EXPORT Vector3 omegaFromRot(const Matrix33 &r)
void write(OpenHRP::BodyInfo_var binfo, std::ostream &ofs)
void writeShape(OpenHRP::TransformedShapeIndex &tsi, std::ostream &ofs)