collada 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTJlZDlkNTNiNmRjYTYxZGE3OGNmZjFiODhmNjA2YmM2OTIzMjdmMw==
4
+ OGExZjQyN2E3YzQzOTIzZmY5YWUyYTEyZTE3YWMzOGY3ZjMzMzBhZQ==
5
5
  data.tar.gz: !binary |-
6
- YmUzNjhjY2UxMGZkYmNjYzhjM2ZkZWMxNTIyMTU4NjhiZWRkNjI0Mg==
6
+ MWE5Nzc1NTQ1MWY0OGY2MjlkMzZmZDgzYTUxYzI5MTNlNWJkMzAyMw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- ZDdhYmU5NjdhYTQyZWQxYmE5NTVhYTJiNzIzYjJlNDFlZmFiNWNjNThlMDEz
10
- ZDRkMmE3MTcyMGViZGYxMWZjYWQ3MTc2MjA0NjNiMTU0OWRhZWQxOTk5OGQ3
11
- ZDNmOGY5NGZiMmNjOTk1NWQ1MTA1YjBmMGRmODhlNmY2MmE0NmM=
9
+ MWJiMWU2MDM5M2RmYTYwNTBkN2U0MTYwNjdjNWQwMjE1MmIxODk4MjE4NTdl
10
+ OTljZjNjNTVkMWMxZDIwNzI1MWMyYjUyY2EwNzlkZDA3M2ZlMDQ5MzBlN2M2
11
+ ZjZmMDc3MTBmODVhYmJmNjkzNGNlMjBkNGMyM2U2OWE2MmU0ZjQ=
12
12
  data.tar.gz: !binary |-
13
- OTg3OTAzNGRkNmM3NmZiZmNkMzcyYTRiMWViMTRmNjBkZTdlZjNhZWFkMjg3
14
- NjVkNjhlYjQyODE3NzJmZTNiMzkzYTYzMDE3NjkxMDA2OTQ3YzM5ODAyZjM1
15
- ZjY2YmJhZmI5ZmRkYzUwZDA2ZjVjNzcwY2I1ZWFhODQ2ODllYjU=
13
+ NTJmYmU1OGUyM2Q0ZDY4YWI2OGZhY2QyOGFiNTU0MTZlY2IxN2FiYTU2Y2Yy
14
+ NTA4NjRlYzkyMzU1YThjNDAyMWNhYWE1MTEyNDhhZjgyNWU1ZDJmNTdmYmU5
15
+ MTY4MjJmMTdkYTJjZDU4YTIyYWMxZGI5YTk2MjBkN2VjY2YxNWU=
@@ -66,14 +66,14 @@ module Collada
66
66
 
67
67
  def extract_skeleton(top)
68
68
  @bones = [[0, top]]
69
- @indexed = {top.id => 0}
69
+ @indexed = {top.sid => 0}
70
70
 
71
71
  @scene.traverse(top.children) do |node|
72
72
  next unless node.type == :joint
73
73
 
74
- bone_index = indexed[node.parents(:joint).first.id]
74
+ bone_index = indexed[node.parents(:joint).first.sid]
75
75
 
76
- @indexed[node.id] = bones.size
76
+ @indexed[node.sid] = bones.size
77
77
  @bones << [bone_index, node]
78
78
  end
79
79
 
@@ -125,7 +125,7 @@ module Collada
125
125
  @output.puts " default: skeleton-animation #{start_time} #{end_time}"
126
126
  @output.puts " key-frames: array skeleton-animation-key-frame"
127
127
  skeleton.bones.each do |(parent, bone)|
128
- channel = channels["#{bone.id}/transform"]
128
+ channel = channels["#{bone.id}/transform"] || channels["#{bone.id}/matrix"]
129
129
 
130
130
  next unless channel
131
131
 
@@ -67,8 +67,9 @@ module Collada
67
67
  ]
68
68
 
69
69
  class Node
70
- def initialize(id, name, type, transforms, instances, children, attributes = {})
70
+ def initialize(id, sid, name, type, transforms, instances, children, attributes = {})
71
71
  @id = id
72
+ @sid = sid
72
73
  @name = name
73
74
  @type = type
74
75
 
@@ -89,6 +90,8 @@ module Collada
89
90
  attr :parent
90
91
 
91
92
  attr :id
93
+ attr :sid
94
+
92
95
  attr :name
93
96
  attr :type
94
97
 
@@ -160,6 +163,8 @@ module Collada
160
163
 
161
164
  def self.parse(doc, element)
162
165
  id = element.attributes['id']
166
+ sid = element.attributes['sid']
167
+
163
168
  name = element.attributes['name']
164
169
  type = (element.attributes['type'] || 'node').downcase.to_sym
165
170
 
@@ -167,7 +172,7 @@ module Collada
167
172
  instances = parse_instances(doc, element)
168
173
  children = parse_children(doc, element)
169
174
 
170
- self.new(id, name, type, transforms, instances, children, element.attributes)
175
+ self.new(id, sid, name, type, transforms, instances, children, element.attributes)
171
176
  end
172
177
  end
173
178
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Collada
22
- VERSION = "0.2.1"
22
+ VERSION = "0.2.2"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: collada
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-29 00:00:00.000000000 Z
11
+ date: 2013-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow