|
|
@@ -140,7 +140,8 @@ class ColladaParser {
|
|
|
visualScenes: {},
|
|
|
kinematicsModels: {},
|
|
|
physicsModels: {},
|
|
|
- kinematicsScenes: {}
|
|
|
+ kinematicsScenes: {},
|
|
|
+ joints: {}
|
|
|
};
|
|
|
|
|
|
this.library = library;
|
|
|
@@ -157,6 +158,7 @@ class ColladaParser {
|
|
|
this.parseLibrary( collada, 'library_geometries', 'geometry', this.parseGeometry.bind( this ) );
|
|
|
this.parseLibrary( collada, 'library_nodes', 'node', this.parseNode.bind( this ) );
|
|
|
this.parseLibrary( collada, 'library_visual_scenes', 'visual_scene', this.parseVisualScene.bind( this ) );
|
|
|
+ this.parseLibrary( collada, 'library_joints', 'joint', this.parseLibraryJoint.bind( this ) );
|
|
|
this.parseLibrary( collada, 'library_kinematics_models', 'kinematics_model', this.parseKinematicsModel.bind( this ) );
|
|
|
this.parseLibrary( collada, 'library_physics_models', 'physics_model', this.parsePhysicsModel.bind( this ) );
|
|
|
this.parseLibrary( collada, 'scene', 'instance_kinematics_scene', this.parseKinematicsScene.bind( this ) );
|
|
|
@@ -1362,6 +1364,12 @@ class ColladaParser {
|
|
|
|
|
|
// kinematics
|
|
|
|
|
|
+ parseLibraryJoint( xml ) {
|
|
|
+
|
|
|
+ this.library.joints[ xml.getAttribute( 'id' ) ] = this.parseKinematicsJoint( xml );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
parseKinematicsModel( xml ) {
|
|
|
|
|
|
const data = {
|
|
|
@@ -1404,6 +1412,10 @@ class ColladaParser {
|
|
|
data.joints[ child.getAttribute( 'sid' ) ] = this.parseKinematicsJoint( child );
|
|
|
break;
|
|
|
|
|
|
+ case 'instance_joint':
|
|
|
+ data.joints[ child.getAttribute( 'sid' ) ] = this.library.joints[ parseId( child.getAttribute( 'url' ) ) ];
|
|
|
+ break;
|
|
|
+
|
|
|
case 'link':
|
|
|
data.links.push( this.parseKinematicsLink( child ) );
|
|
|
break;
|