obj_parser 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/obj_parser/obj.rb +1 -0
- data/lib/obj_parser/version.rb +1 -1
- data/test/obj_parser_spec.rb +1 -1
- data/test/obj_spec.rb +12 -1
- metadata +1 -1
data/lib/obj_parser/obj.rb
CHANGED
data/lib/obj_parser/version.rb
CHANGED
data/test/obj_parser_spec.rb
CHANGED
@@ -11,7 +11,7 @@ describe ObjParser::ObjParser do
|
|
11
11
|
obj.textures.count.must_equal(4)
|
12
12
|
obj.vertice_indexes.count.must_equal(36)
|
13
13
|
obj.normals_indexes.count.must_equal(36)
|
14
|
-
obj.textures_indexes.count.must_equal(36)
|
14
|
+
obj.textures_indexes.count.must_equal(36)
|
15
15
|
end
|
16
16
|
|
17
17
|
private
|
data/test/obj_spec.rb
CHANGED
@@ -22,7 +22,6 @@ describe ObjParser::Obj do
|
|
22
22
|
|
23
23
|
it 'compute tangents' do
|
24
24
|
@obj.compute_tangents
|
25
|
-
puts @obj.tangents.map(&:data)
|
26
25
|
result = @obj.faces.each_with_index.map do |face, index|
|
27
26
|
face.vertice.map do |vertex|
|
28
27
|
("%.2f" % ObjParser::MathUtils::dot(vertex.tangent.data[0..2], vertex.normal.data)).to_f
|
@@ -31,4 +30,16 @@ describe ObjParser::Obj do
|
|
31
30
|
result.must_equal(0)
|
32
31
|
end
|
33
32
|
|
33
|
+
it 'compute tangents does nothing when normals and textures are defined' do
|
34
|
+
t = @obj.textures
|
35
|
+
@obj.textures = []
|
36
|
+
@obj.compute_tangents
|
37
|
+
@obj.tangents.must_equal([])
|
38
|
+
|
39
|
+
@obj.textures = t
|
40
|
+
@obj.normals = []
|
41
|
+
@obj.compute_tangents
|
42
|
+
@obj.tangents.must_equal([])
|
43
|
+
end
|
44
|
+
|
34
45
|
end
|