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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5c192fef8336203feb0bcb02ee19b291d498a234d710ee6b676d5e3f0a21763e
4
- data.tar.gz: 42cd576210823a906fac2be9a092ec091ade4f1ca56a2f55f6b47924b96be9d5
3
+ metadata.gz: d38ff4d71e252cf45992f5c8679401d56e4b0ecde524d4d0f71cdeba4e592216
4
+ data.tar.gz: b9bacc84e9889c2e189fc52b367b1a307c7dda3d0bd216722320422f2bbf9c09
5
5
  SHA512:
6
- metadata.gz: 89d297ee3f2f5987edac681ecbc7073c62e205cc0e175190c0de19c9d15100ba0b0b81567a0302f451163a98b84e272c5c8a63651613cc7d7ba13f93e219e66b
7
- data.tar.gz: 191b40baf47b4c8c5c46a133aa97f07e7d33ef2d08a7e878663b6582e43d7fe89b7f7bd127137a9a22bef14c685c0479f43a79e5515c67d59661a9396e45b44b
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 :transform_vec_by_matrix4, :aiTransformVecByMatrix4, [Vector3D.by_ref, Matrix4x4.by_ref], :void
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.2
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-26 00:00:00.000000000 Z
11
+ date: 2019-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi