Scenebuilder XML tazz 2013/9/4 1 Scenebuilder XML XML 2 XML <?xml version="1.0" encoding="utf-8"?> XML XML <elem attr="value"... >... </elem> 1
elem attr value = "..." Scenebuilder XML <elem attr="value"... /> XML XML Scenebuilder body hinge XML Scenebuilder 4 3 Scenebuilder XML C/C++ bool int real t vec2 t vec3 t vec4 t quat t mat3 t str32 t str256 t string 2 3 4 3 3 32 256 Scenebuilder C/C++ XML XML XML 2
true false 123 1.234e 5 + - * / ˆ, sin cos tan exp log sqrt pi [ ] Scenebuilder m kg s m/s kg m/s 2 XML 12.3mm mm m 0.001 0.0123 45[km/h] 1000/3600 12.5 3
km 1000 hour 3600 N 1 rad 1 m 1 h 3600 mn 0.001 deg pi/180 cm 0.01 min 60 G 9.80665 % 0.01 mm 0.001 second 1 kgf G kg 1 s 1 Nm 1 g 0.001 mnm 0.001 kgfcm 0.01 G [g/cmˆ3] 0.001/0.01 3 1000 / ˆ ˆ [ ] m kg s body mass mass="5.0"mass kg 5.0 unit_length unit_mass unit_time <attr unit_length="mm">body vel vel="0 0 200"vel mm/s 0.0 0.0 0.2 km trn="0.5 0.0-3*2.4" 4 "1 0 0 0" 4 4
@ @ "30deg@1 0 1" [1 0 1] 30 3 x y z "90deg@y" 3 3 * "-45deg@z*120deg@y" * * 3 3 3 9 3 9 3 3 column-major str32_t str256_t 32 256 ascii UTF-8 5
name / <namespace name="robot"> <mesh name="mesh_arm".../ > <namespace name="arm"> <body name="body"> <connector name="c"/> </body> <attach connector="body/c" shape="../mesh_arm"/> </namespace> </namespace> attach attach connector shape attach connector attach body name "body" connector name "c" shape attach mesh name "mesh_arm".. str256_t str256_t 4 name type default P/S (P) (S) dim 6
C/C++ Scenebuilder API XML 7
sceneobject name str256 t "" P unit length str32 t "m" P unit rotation str32 t "rad" P unit mass str32 t "kg" P unit time str32 t "s" P name unit_ 3 8
spatialobject sceneobject trn vec3 t [0 0 0] S L rot quat t [1 0 0 0] S R trn rot spatialobject <namespace name="world"> <namespace name="japan" trn="3 0 0"> <namespace name="nagoya" trn="-2-1 0"> </namespace> </namespace> </namespace> "nagoya" "japan" [ 2 1 0] "world" [1 1 0] 9
namespace spatialobject 10
body spatialobject mass real t 1.0 P M inertia mat3 t P ML 2 center vec3 t [0 0 0] P L dynamical bool true P auto mass bool false P auto tree bool false P vel vec3 t [0 0 0] S L/T angvel vec3 t [0 0 0] S R/T spatialobject trn rot vel angvel spatialobject spatialobject dynamical true 0 auto_mass true mass inertia center auto_tree true auto_tree true 11
connector spatialobject spatialobject trn rot body 12
pmat sceneobject density real t 1.0 P M/L 3 cor real t 0.3 P static friction real t 0.3 P dynamic friction real t 0.3 P spring real t 0.0 P damper real t 0.0 P physical material density body.auto\_mass cor 1 static_friction dynamic_friction spring damper 0 13
vmat sceneobject ambient vec4 t [0.2 0.2 0.2 1] P diffuse vec4 t [0.8 0.8 0.8 1] P specular vec4 t [0 0 0 1] P emissive vec4 t [0 0 0 1] P shininess real t 0.0 P alpha real t 1.0 P colorname str32 t P texture str256 t P visual material alpha 1.0 A colorname colorname diffuse texture vmat XML vmat texture shape auto_texcoord 14
shape sceneobject collision bool true P visual bool true P auto texcoord str32 t P texture scale vec2 t [1 1] P texture offset vec2 t [0 0] P collision true pmat visual true vmat auto texcoord vmat texture auto_texcoord auto_texcoord "box" "sphere" "box" UV "sphere" [ 180deg, 180deg] U [0, 1][ 90deg, 90deg] V [0, 1] texture_scale texture_offset UV texture_scale texture_offset UV 15
box shape size vec3 t [1 1 1] P L size.x size.x size.z x y z 16
sphere shape radius real t 1 P L radius 17
cylinder shape radius real t 1 P L height real t 1 P L z radius height 18
mesh shape filename str256 t P scale real t 0 P prism bool false P prismdir vec3 t [0 0 1] P 3D filename mesh XML scale scale 0 unit length scale mesh collision true prism true prismdir 19
light sceneobject 20
camera sceneobject fov real t 0.3 P z y fov 21
attach sceneobject connector str256 t P shape P vmat P pmat P light P camera P bone P connectorshape collision true pmat visual true vmap connector camera 22
joint sceneobject sock P plug P enabled bool true P sock connector plug connector connector body enabled enabled true false 23
joint1d joint range vec2 t [ ] P R L vrange vec2 t [ ] P R/T L/T flim real t P ML 2 /T 2 ML/T 2 damper real t 0 P ML 2 /(RT ) M/T spring real t 0 P ML 2 /(RT 2 ) M/T 2 pos real t 0 S R L vel real t 0 S R/T L/T targetpos real t 0 S R L targetvel real t 0 S R/T L/T filename str256 t P DLL dim 1 1 1 range vrange flim damper spring pos vel targetpos targetvel = spring (targetpos - pos) + damper (targetvel - vel) flim 24
hinge joint1d 1 z z x x 25
slider joint1d 1 z z 26
balljoint joint 3 27
fixjoint joint 28
gear sceneobject up P down P ratio real t 1 P offset real t 0 P type str32 t P up down joint1d type type "vel" vel = ratio vel type "pos" pos = ratio pos + offset type 29
gravity sceneobject accel vec3 t [0 0 0] P L/T 2 accel 30
contact group sceneobject enable bool true P all bodies bool false P constact_group link body enable true false all_bodies true contact_group body 31
ik spatialobject end P IK ref P IK enable trn bool true P IK enable rot bool false P IK 32
4.1 attr attr <attr mass="3.0"/> <body name="body1"/> <body name="body2"/> <body name="body1" mass="3.0"/> <body name="body2" mass="3.0"/> attr attr <namespace name="parent"> <attr unit_length="mm"/> <namespace name="child"> <attr unit_length="m"/> <sphere name="big_ball" radius="0.03"/> </namespace> <sphere name="small_ball" radius="5.0"/> </namespace> sphere big_ball radius sphere small_ball radius 33
link name str256 t "" P path "" P link <attach shape="body/c1"/> <attach> <link name="shape" path="../body/c1"/> </attach> link link../ 34
module name str256 t true P <module name="wheel"> <body name="body"> <connector name="c"/> </body> </module> <import name="wheel1" path="wheel"/> <import name="wheel2" path="wheel"/> <import name="wheel3" path="wheel"/> <namespace name="wheel1"> <body name="body"> <connector name="c"/> </body> </module> <namespace name="wheel2"> <body name="body"> <connector name="c"/> </body> </module> <namespace name="wheel3"> <body name="body"> <connector name="c"/> </body> </module> module import path Scenebuilder XML import 35
namespace namespace name import module import 36
import path "" P filename str256 t "" P path filename path module module filename filename XML import namespace XML 37