assimp-ffi 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/assimp/base.rb +6 -1
- data/lib/assimp/material.rb +26 -0
- metadata +2 -3
- data/assimp.gemspec +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7d1aa04481190c3c16c9bd389905b36d8217d8d3c9c3a42e21abb77f58fa1e1
|
4
|
+
data.tar.gz: b094934f2f1f7fbf5c1e23d098fd0626e9be3d027e0d9ce21c1782f516c82cff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95999a134bc79d4ed7ddb7a04196f144d93ea789a5c0036220ddbdab1f0206105ce4f980080ec974a951455053172b3a4033a48981d56630e618568c92b98543
|
7
|
+
data.tar.gz: 6001365547e0eb714108f2f5dbac2e1dc43ed6240c011c8bd7dfc80d2daec39903d9aab40656e97934d9152af31d373aee57d3fb3e9d9593401e760bd8dc3325
|
data/lib/assimp/base.rb
CHANGED
data/lib/assimp/material.rb
CHANGED
@@ -172,6 +172,11 @@ module Assimp
|
|
172
172
|
|
173
173
|
@__has_ref = true
|
174
174
|
|
175
|
+
def self.property(key, val, semantic: 0, index: 0, type: nil)
|
176
|
+
p = MaterialProperty::new
|
177
|
+
p.set_property(key, val, semantic: semantic, index: index, type: type)
|
178
|
+
end
|
179
|
+
|
175
180
|
def set_property(key, val, semantic: 0, index: 0, type: nil)
|
176
181
|
if type
|
177
182
|
self.type = type
|
@@ -377,6 +382,27 @@ module Assimp
|
|
377
382
|
MaterialProperty::new(new_ptr)
|
378
383
|
end
|
379
384
|
|
385
|
+
def add_property(key, val, semantic: 0, index: 0, type: nil)
|
386
|
+
push(MaterialProperty::property(key, val, semantic: semantic, index: index, type: type))
|
387
|
+
end
|
388
|
+
|
389
|
+
def push(property)
|
390
|
+
@properties = [nil, []] unless @properties
|
391
|
+
@properties[1].push(property)
|
392
|
+
if num_allocated > num_properties
|
393
|
+
self[:properties].put_pointer(FFI::Pointer.size*num_properties, property.pointer)
|
394
|
+
else
|
395
|
+
self.num_allocated = [32, num_allocated*2].max
|
396
|
+
new_ptr = FFI::MemoryPointer::new(:pointer, num_allocated)
|
397
|
+
new_ptr.write_array_of_pointer(self[:properties].read_array_of_pointer(num_properties)) unless self[:properties].null?
|
398
|
+
new_ptr[num_properties].write_pointer(property.pointer)
|
399
|
+
@properties[0] = new_ptr
|
400
|
+
self[:properties] = new_ptr
|
401
|
+
end
|
402
|
+
self.num_properties += 1
|
403
|
+
self
|
404
|
+
end
|
405
|
+
|
380
406
|
end
|
381
407
|
|
382
408
|
attach_function :aiGetMaterialProperty,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: assimp-ffi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brice Videau
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-01-
|
11
|
+
date: 2019-01-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|
@@ -39,7 +39,6 @@ extra_rdoc_files: []
|
|
39
39
|
files:
|
40
40
|
- LICENSE
|
41
41
|
- README.md
|
42
|
-
- assimp.gemspec
|
43
42
|
- lib/assimp-ffi.rb
|
44
43
|
- lib/assimp/anim.rb
|
45
44
|
- lib/assimp/base.rb
|
data/assimp.gemspec
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
Gem::Specification.new do |s|
|
2
|
-
s.name = 'assimp-ffi'
|
3
|
-
s.version = "0.1.0"
|
4
|
-
s.author = "Brice Videau"
|
5
|
-
s.email = "brice.videau@imag.fr"
|
6
|
-
s.homepage = "https://github.com/Kerilk/assimp-ruby"
|
7
|
-
s.summary = "Open Asset Import Library bindings"
|
8
|
-
s.description = "FFI bindings of Assimp (Open Asset Import Library bindings) for version 4.1.0 onward"
|
9
|
-
s.files = Dir['assimp.gemspec', 'LICENSE', 'README.md', 'lib/**/*']
|
10
|
-
s.has_rdoc = false
|
11
|
-
s.license = 'BSD-2-Clause'
|
12
|
-
s.required_ruby_version = '>= 2.1.0'
|
13
|
-
s.add_dependency 'ffi', '~> 1.9', '>=1.9.19'
|
14
|
-
end
|