nvtristrip-ruby 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,46 @@
1
+ require 'nvtristrip'
2
+ require 'test/unit'
3
+
4
+ class TestNvTriStrip < Test::Unit::TestCase
5
+
6
+ def test_primitivegroups
7
+ pg=NvTriStrip::PrimitiveGroup.new NvTriStrip::PT_LIST, 100
8
+
9
+ assert_equal(100,pg.num_indices)
10
+ assert_equal(0, pg[0], "Testing if value inited to zero")
11
+ pg[0]=5
12
+ assert_equal(5, pg[0], "Testing if value changed")
13
+
14
+ assert_raise(IndexError, "Testing too big index") do
15
+ pg[100]=0
16
+ end
17
+
18
+ assert_raise(ArgumentError, "Testing too big value") do
19
+ pg[0]=65536
20
+ end
21
+
22
+
23
+ end
24
+
25
+
26
+
27
+ def test_generatestrips
28
+
29
+ a=[1,2,3,0,3,4,1,3,4]
30
+ v=NvTriStrip::generate_strips a,true
31
+
32
+ assert_equal( [2,2,1,3,4,0], v.first.to_a)
33
+
34
+ rv=NvTriStrip::remap_indices v, 5
35
+
36
+ assert_equal( [0,0,1,2,3,4], rv.first.to_a)
37
+
38
+ a=[1,2,3,5,6,7]
39
+ v=NvTriStrip::generate_strips a,true
40
+
41
+
42
+ end
43
+
44
+
45
+
46
+ end
metadata ADDED
@@ -0,0 +1,59 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: nvtristrip-ruby
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.5.0
7
+ date: 2006-05-04 00:00:00 +03:00
8
+ summary: Interface for NvTriStrip triangle stripification library.
9
+ require_paths:
10
+ - lib
11
+ email:
12
+ homepage: http://nvtristrip.rubyforge.org
13
+ rubyforge_project: nvtristrip
14
+ description:
15
+ autorequire:
16
+ default_executable:
17
+ bindir: bin
18
+ has_rdoc: true
19
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
20
+ requirements:
21
+ - - ">"
22
+ - !ruby/object:Gem::Version
23
+ version: 0.0.0
24
+ version:
25
+ platform: ruby
26
+ signing_key:
27
+ cert_chain:
28
+ authors:
29
+ - Mikko Lehtonen
30
+ files:
31
+ - test/test_nvtristrip.rb
32
+ - ext/NvTriStrip.cpp
33
+ - ext/NvTriStripObjects.cpp
34
+ - ext/RbTriStrip.cpp
35
+ - ext/NvTriStrip.h
36
+ - ext/NvTriStripObjects.h
37
+ - ext/VertexCache.h
38
+ - ext/extconf.rb
39
+ - Rakefile
40
+ - setup.rb
41
+ - README.nvtristrip
42
+ - README
43
+ - TODO
44
+ test_files:
45
+ - test/test_nvtristrip.rb
46
+ rdoc_options: []
47
+
48
+ extra_rdoc_files:
49
+ - README
50
+ - TODO
51
+ - ext/RbTriStrip.cpp
52
+ executables: []
53
+
54
+ extensions:
55
+ - ext/extconf.rb
56
+ requirements: []
57
+
58
+ dependencies: []
59
+