assimp-ffi 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assimp/import.rb +1 -1
- data/lib/assimp/scene.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d38ff4d71e252cf45992f5c8679401d56e4b0ecde524d4d0f71cdeba4e592216
|
4
|
+
data.tar.gz: b9bacc84e9889c2e189fc52b367b1a307c7dda3d0bd216722320422f2bbf9c09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 11685cc5071e03ed4c18f278d1678ca6b44b17b9b0dd65912fe34cc4e94198a772cbec7abb838f71e993b9eedbde1c1323d455f8e1fe74de77024d56ada67691
|
7
|
+
data.tar.gz: c5512f28bac1cc50395016568f37e92ae8b8c5b6a5f39959c0019e12e055e54531d5381948aeecdb935fb7d9a2fc7e98642358b0d9f98f524fe6b7027076a99f
|
data/lib/assimp/import.rb
CHANGED
@@ -210,7 +210,7 @@ module Assimp
|
|
210
210
|
attach_function :aiTransposeMatrix4, [Matrix4x4.by_ref], :void
|
211
211
|
attach_function :aiTransposeMatrix3, [Matrix3x3.by_ref], :void
|
212
212
|
attach_function :aiTransformVecByMatrix3, [Vector3D.by_ref, Matrix3x3.by_ref], :void
|
213
|
-
attach_function :
|
213
|
+
attach_function :aiTransformVecByMatrix4, [Vector3D.by_ref, Matrix4x4.by_ref], :void
|
214
214
|
attach_function :aiMultiplyMatrix4, [Matrix4x4.by_ref, Matrix4x4.by_ref], :void
|
215
215
|
attach_function :aiMultiplyMatrix3, [Matrix3x3.by_ref, Matrix3x3.by_ref], :void
|
216
216
|
attach_function :aiIdentityMatrix4, [Matrix4x4.by_ref], :void
|
data/lib/assimp/scene.rb
CHANGED
@@ -37,6 +37,14 @@ module Assimp
|
|
37
37
|
Node::new(ptr)
|
38
38
|
end
|
39
39
|
|
40
|
+
def ancestors
|
41
|
+
return parent ? [parent] + parent.ancestors : []
|
42
|
+
end
|
43
|
+
|
44
|
+
def world_transformation
|
45
|
+
ancestors.reverse.collect(&:transformation).reduce(:*) * transformation
|
46
|
+
end
|
47
|
+
|
40
48
|
def parent=(other)
|
41
49
|
if other.kind_of? FFI::Pointer
|
42
50
|
self[:parent] = other
|
@@ -60,6 +68,18 @@ module Assimp
|
|
60
68
|
end
|
61
69
|
end
|
62
70
|
|
71
|
+
def each_node_with_depth(depth=nil, &block)
|
72
|
+
depth = (depth ? depth + 1 : 0)
|
73
|
+
if block then
|
74
|
+
block.call self, depth
|
75
|
+
children.each { |c|
|
76
|
+
c.each_node_with_depth(depth, &block)
|
77
|
+
}
|
78
|
+
else
|
79
|
+
to_enum(:each_node_with_depth)
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
63
83
|
def meta_data
|
64
84
|
p = self[:meta_data]
|
65
85
|
return nil if p.null?
|
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.3
|
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-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ffi
|