rmath3d 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/ChangeLog +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +4 -1
- data/ext/rmath3d/RMath3D.h +1 -1
- data/ext/rmath3d/RMtx2.c +1 -1
- data/ext/rmath3d/RMtx2.h +1 -1
- data/ext/rmath3d/RMtx3.c +1 -1
- data/ext/rmath3d/RMtx3.h +1 -1
- data/ext/rmath3d/RMtx4.c +25 -19
- data/ext/rmath3d/RMtx4.h +7 -6
- data/ext/rmath3d/RQuat.c +1 -1
- data/ext/rmath3d/RQuat.h +1 -1
- data/ext/rmath3d/RType.h +1 -1
- data/ext/rmath3d/RVec2.c +1 -1
- data/ext/rmath3d/RVec2.h +1 -1
- data/ext/rmath3d/RVec3.c +1 -1
- data/ext/rmath3d/RVec3.h +1 -1
- data/ext/rmath3d/RVec4.c +1 -1
- data/ext/rmath3d/RVec4.h +1 -1
- data/ext/rmath3d/rmath3d.c +88 -31
- data/lib/rmath3d/rmath3d_plain.rb +100 -59
- data/sample/opengl-bindings/load_matrix.rb +2 -2
- data/sample/opengl2/load_matrix.rb +2 -2
- data/test/test.rb +1 -1
- data/test/test_RMtx4.rb +11 -11
- metadata +7 -8
@@ -104,7 +104,7 @@ class App
|
|
104
104
|
def size_callback( window_handle, w, h )
|
105
105
|
glViewport( 0, 0, w, h )
|
106
106
|
glMatrixMode( GL_PROJECTION )
|
107
|
-
@mtxProj.perspectiveFovRH( 30.0*Math::PI/180.0, w.to_f/h.to_f, 0.1, 1000.0 )
|
107
|
+
@mtxProj.perspectiveFovRH( 30.0*Math::PI/180.0, w.to_f/h.to_f, 0.1, 1000.0, true )
|
108
108
|
glLoadMatrixf( @mtxProj.to_a.pack('F16') )
|
109
109
|
|
110
110
|
@window_width = w
|
@@ -119,7 +119,7 @@ class App
|
|
119
119
|
@at = RVec3.new(0.0, 0.0, 0.0)
|
120
120
|
@up = RVec3.new(0.0, 1.0, 0.0)
|
121
121
|
@mtxLookAt = RMtx4.new.lookAtRH( @eye, @at, @up )
|
122
|
-
@mtxProj = RMtx4.new.perspectiveFovRH( 30.0*Math::PI/180.0, @window_width.to_f/@window_height.to_f, 0.1, 1000.0 )
|
122
|
+
@mtxProj = RMtx4.new.perspectiveFovRH( 30.0*Math::PI/180.0, @window_width.to_f/@window_height.to_f, 0.1, 1000.0, true )
|
123
123
|
|
124
124
|
@light_pos = [2.5,0,5,1]
|
125
125
|
@light_diffuse = [1,1,1,1]
|
@@ -42,7 +42,7 @@ class App
|
|
42
42
|
def reshape( width, height )
|
43
43
|
glViewport( 0, 0, width, height )
|
44
44
|
glMatrixMode( GL_PROJECTION )
|
45
|
-
@mtxProj.perspectiveFovRH( 30.0*Math::PI/180.0, width.to_f/height.to_f, 0.1, 1000.0 )
|
45
|
+
@mtxProj.perspectiveFovRH( 30.0*Math::PI/180.0, width.to_f/height.to_f, 0.1, 1000.0, true )
|
46
46
|
glLoadMatrix( @mtxProj )
|
47
47
|
|
48
48
|
@window_width = width
|
@@ -74,7 +74,7 @@ class App
|
|
74
74
|
@at = RVec3.new(0.0, 0.0, 0.0)
|
75
75
|
@up = RVec3.new(0.0, 1.0, 0.0)
|
76
76
|
@mtxLookAt = RMtx4.new.lookAtRH( @eye, @at, @up )
|
77
|
-
@mtxProj = RMtx4.new.perspectiveFovRH( 30.0*Math::PI/180.0, @window_width.to_f/@window_height.to_f, 0.1, 1000.0 )
|
77
|
+
@mtxProj = RMtx4.new.perspectiveFovRH( 30.0*Math::PI/180.0, @window_width.to_f/@window_height.to_f, 0.1, 1000.0, true )
|
78
78
|
|
79
79
|
@light_pos = [2.5,0,5,1]
|
80
80
|
@light_diffuse = [1,1,1,1]
|
data/test/test.rb
CHANGED
data/test/test_RMtx4.rb
CHANGED
@@ -526,7 +526,7 @@ class TC_RMtx4 < Minitest::Test
|
|
526
526
|
0.0, 2*z_n/height, 0.0, 0.0,
|
527
527
|
0.0, 0.0, -(z_f+z_n)/(z_f-z_n), -2.0*z_f*z_n / (z_f-z_n),
|
528
528
|
0.0, 0.0, -1.0, 0.0 )
|
529
|
-
m1 = RMtx4.new.perspectiveRH( width, height, z_n, z_f )
|
529
|
+
m1 = RMtx4.new.perspectiveRH( width, height, z_n, z_f, true )
|
530
530
|
|
531
531
|
for r in 0...4 do
|
532
532
|
for c in 0...4 do
|
@@ -544,7 +544,7 @@ class TC_RMtx4 < Minitest::Test
|
|
544
544
|
0.0, f, 0.0, 0.0,
|
545
545
|
0.0, 0.0, (z_f+z_n)/(z_n-z_f), 2*z_f*z_n/(z_n-z_f),
|
546
546
|
0.0, 0.0, -1.0, 0.0 )
|
547
|
-
m3 = RMtx4.new.perspectiveFovRH( fovy, aspect, z_n, z_f );
|
547
|
+
m3 = RMtx4.new.perspectiveFovRH( fovy, aspect, z_n, z_f, true );
|
548
548
|
|
549
549
|
for r in 0...4 do
|
550
550
|
for c in 0...4 do
|
@@ -563,7 +563,7 @@ class TC_RMtx4 < Minitest::Test
|
|
563
563
|
0.0, 0.0, c, d,
|
564
564
|
0.0, 0.0, -1.0, 0.0 )
|
565
565
|
|
566
|
-
m5 = RMtx4.new.perspectiveOffCenterRH( left, right, bottom, top, z_n, z_f )
|
566
|
+
m5 = RMtx4.new.perspectiveOffCenterRH( left, right, bottom, top, z_n, z_f, true )
|
567
567
|
|
568
568
|
for r in 0...4 do
|
569
569
|
for c in 0...4 do
|
@@ -584,14 +584,14 @@ class TC_RMtx4 < Minitest::Test
|
|
584
584
|
height = top - bottom
|
585
585
|
|
586
586
|
# RMtx4#orthoRH
|
587
|
-
tx = (right+left)/width
|
588
|
-
ty = (top+bottom)/height
|
589
|
-
tz = (z_f+z_n)/(z_f-z_n)
|
587
|
+
tx = -(right+left)/width
|
588
|
+
ty = -(top+bottom)/height
|
589
|
+
tz = -(z_f+z_n)/(z_f-z_n)
|
590
590
|
m0 = RMtx4.new( 2.0/width, 0.0, 0.0, tx,
|
591
591
|
0.0, 2.0/height, 0.0, ty,
|
592
592
|
0.0, 0.0, -2.0/(z_f-z_n), tz,
|
593
593
|
0.0, 0.0, 0.0, 1.0 )
|
594
|
-
m1 = RMtx4.new.orthoRH( width, height, z_n, z_f )
|
594
|
+
m1 = RMtx4.new.orthoRH( width, height, z_n, z_f, true )
|
595
595
|
|
596
596
|
for r in 0...4 do
|
597
597
|
for c in 0...4 do
|
@@ -600,14 +600,14 @@ class TC_RMtx4 < Minitest::Test
|
|
600
600
|
end
|
601
601
|
|
602
602
|
# RMtx4#orthoOffCenterRH
|
603
|
-
tx = (right+left)/(right-left)
|
604
|
-
ty = (top+bottom)/(top-bottom)
|
605
|
-
tz = (z_f+z_n)/(z_f-z_n)
|
603
|
+
tx = -(right+left)/(right-left)
|
604
|
+
ty = -(top+bottom)/(top-bottom)
|
605
|
+
tz = -(z_f+z_n)/(z_f-z_n)
|
606
606
|
m2 = RMtx4.new( 2.0/(right-left), 0.0, 0.0, tx,
|
607
607
|
0.0, 2.0/(top-bottom), 0.0, ty,
|
608
608
|
0.0, 0.0, -2.0/(z_f-z_n), tz,
|
609
609
|
0.0, 0.0, 0.0, 1.0 )
|
610
|
-
m3 = RMtx4.new.orthoOffCenterRH( left, right, bottom, top, z_n, z_f )
|
610
|
+
m3 = RMtx4.new.orthoOffCenterRH( left, right, bottom, top, z_n, z_f, true )
|
611
611
|
|
612
612
|
for r in 0...4 do
|
613
613
|
for c in 0...4 do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmath3d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Provides vector2/3/4, matrix2x2/3x3/4x4 and quaternion in C extension library form (and plain Ruby form with the same interface for debugging use).
|
@@ -58,7 +58,7 @@ homepage: https://github.com/vaiorabbit/rmath3d
|
|
58
58
|
licenses:
|
59
59
|
- Zlib
|
60
60
|
metadata: {}
|
61
|
-
post_install_message:
|
61
|
+
post_install_message:
|
62
62
|
rdoc_options: []
|
63
63
|
require_paths:
|
64
64
|
- lib
|
@@ -66,16 +66,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
66
66
|
requirements:
|
67
67
|
- - ">="
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 2.
|
69
|
+
version: 2.4.0
|
70
70
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - ">="
|
73
73
|
- !ruby/object:Gem::Version
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
|
-
|
77
|
-
|
78
|
-
signing_key:
|
76
|
+
rubygems_version: 3.1.2
|
77
|
+
signing_key:
|
79
78
|
specification_version: 4
|
80
79
|
summary: Ruby Math Module for 3D Applications
|
81
80
|
test_files: []
|