mittsu 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/build-workflow.yml +74 -0
- data/Gemfile +0 -3
- data/README.md +3 -6
- data/Rakefile +1 -0
- data/install-glfw.ps1 +13 -0
- data/lib/mittsu.rb +1 -16
- data/lib/mittsu/cameras/camera.rb +0 -2
- data/lib/mittsu/cameras/cube_camera.rb +0 -2
- data/lib/mittsu/cameras/orthographic_camera.rb +2 -4
- data/lib/mittsu/cameras/perspective_camera.rb +1 -2
- data/lib/mittsu/core/buffer_geometry.rb +1 -1
- data/lib/mittsu/core/geometry.rb +2 -4
- data/lib/mittsu/core/object_3d.rb +3 -1
- data/lib/mittsu/core/raycaster.rb +0 -2
- data/lib/mittsu/extras/helpers/camera_helper.rb +38 -38
- data/lib/mittsu/lights/directional_light.rb +9 -5
- data/lib/mittsu/loaders/obj_loader.rb +4 -0
- data/lib/mittsu/materials/material.rb +6 -3
- data/lib/mittsu/math/box2.rb +0 -2
- data/lib/mittsu/math/box3.rb +0 -2
- data/lib/mittsu/math/color.rb +0 -1
- data/lib/mittsu/math/euler.rb +1 -2
- data/lib/mittsu/math/frustum.rb +0 -2
- data/lib/mittsu/math/line3.rb +0 -2
- data/lib/mittsu/math/matrix3.rb +0 -2
- data/lib/mittsu/math/matrix4.rb +0 -2
- data/lib/mittsu/math/plane.rb +0 -2
- data/lib/mittsu/math/quaternion.rb +1 -3
- data/lib/mittsu/math/ray.rb +0 -2
- data/lib/mittsu/math/sphere.rb +0 -2
- data/lib/mittsu/math/spline.rb +0 -2
- data/lib/mittsu/math/triangle.rb +0 -2
- data/lib/mittsu/math/vector2.rb +0 -1
- data/lib/mittsu/math/vector3.rb +0 -1
- data/lib/mittsu/math/vector4.rb +0 -1
- data/lib/mittsu/objects/line.rb +0 -1
- data/lib/mittsu/renderers/glfw_window.rb +1 -1
- data/lib/mittsu/renderers/opengl/core/object_3d.rb +1 -1
- data/lib/mittsu/renderers/opengl/opengl_geometry_group.rb +1 -0
- data/lib/mittsu/renderers/opengl/opengl_program.rb +1 -2
- data/lib/mittsu/renderers/opengl_renderer.rb +4 -9
- data/lib/mittsu/scenes/scene.rb +0 -2
- data/lib/mittsu/textures/texture.rb +4 -2
- data/lib/mittsu/utils.rb +15 -0
- data/lib/mittsu/version.rb +1 -1
- data/mittsu.gemspec +10 -9
- metadata +55 -42
- data/.circleci/config.yml +0 -87
- data/.circleci/images/primary/Dockerfile +0 -10
- data/appveyor.yml +0 -23
- data/install_glfw.ps1 +0 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a55da556e2ceb6e5babfd2a3ad6d2323ed55d8a6826711e788a4ca6d4c4d3f5
|
4
|
+
data.tar.gz: 1bb2eb47e77bd8cf29b3b76528c279de08ae8070bc8f2fa7a87450761db8fa47
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6738337c1dbe38d39bbe163a108e06abbe9f6838db2dcbe6314696bb3f8344878c060d7b85e9e98149fe455d72a58d1781718a569bac7ec20808fe806eec7eac
|
7
|
+
data.tar.gz: 97defbe815a66d53398b93252be981484d186c11f785cde562cc20845c6dbed2256ccafce957c891ffe08c73f118700488fdf179d4f6832e96f501262e8feb8e
|
@@ -0,0 +1,74 @@
|
|
1
|
+
name: Build
|
2
|
+
on: [push]
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
linux:
|
6
|
+
name: Linux
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
steps:
|
9
|
+
- uses: actions/checkout@v1
|
10
|
+
- name: Cache gems
|
11
|
+
uses: actions/cache@v1
|
12
|
+
with:
|
13
|
+
path: vendor/bundle
|
14
|
+
key: gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
15
|
+
restore-keys: |
|
16
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
17
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-
|
18
|
+
gems-v1-${{ runner.os }}-
|
19
|
+
- uses: actions/setup-ruby@v1
|
20
|
+
with:
|
21
|
+
ruby-version: '2.x'
|
22
|
+
- run: sudo apt-get update; sudo apt-get install cmake xorg-dev libgl1-mesa-dev
|
23
|
+
- run: bash install-glfw.sh
|
24
|
+
- run: bundle install --path vendor/bundle
|
25
|
+
- name: Test & publish code coverage
|
26
|
+
uses: paambaati/codeclimate-action@v2.2.1
|
27
|
+
env:
|
28
|
+
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
|
29
|
+
with:
|
30
|
+
coverageCommand: bundle exec rake test
|
31
|
+
|
32
|
+
macos:
|
33
|
+
name: macOS
|
34
|
+
runs-on: macos-latest
|
35
|
+
steps:
|
36
|
+
- uses: actions/checkout@v1
|
37
|
+
- name: Cache gems
|
38
|
+
uses: actions/cache@v1
|
39
|
+
with:
|
40
|
+
path: vendor/bundle
|
41
|
+
key: gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
42
|
+
restore-keys: |
|
43
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
44
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-
|
45
|
+
gems-v1-${{ runner.os }}-
|
46
|
+
- uses: actions/setup-ruby@v1
|
47
|
+
with:
|
48
|
+
ruby-version: '2.x'
|
49
|
+
- run: brew install glfw
|
50
|
+
- run: bundle install --path vendor/bundle
|
51
|
+
- run: bundle exec rake test
|
52
|
+
|
53
|
+
windows:
|
54
|
+
name: Windows
|
55
|
+
runs-on: windows-latest
|
56
|
+
env:
|
57
|
+
MITTSU_LIBGLFW_FILE: c:\projects\mittsu\glfw-3.3.1.bin.WIN32\lib-mingw\glfw3.dll
|
58
|
+
steps:
|
59
|
+
- uses: actions/checkout@v1
|
60
|
+
- name: Cache gems
|
61
|
+
uses: actions/cache@v1
|
62
|
+
with:
|
63
|
+
path: vendor/bundle
|
64
|
+
key: gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
65
|
+
restore-keys: |
|
66
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/*.gemspec') }}-
|
67
|
+
gems-v1-${{ runner.os }}-${{ hashFiles('**/Gemfile') }}-
|
68
|
+
gems-v1-${{ runner.os }}-
|
69
|
+
- uses: actions/setup-ruby@v1
|
70
|
+
with:
|
71
|
+
ruby-version: '2.x'
|
72
|
+
- run: .\install-glfw.ps1
|
73
|
+
- run: bundle install --path vendor/bundle
|
74
|
+
- run: bundle exec rake test
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,12 +1,9 @@
|
|
1
1
|
# Mittsu
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/mittsu.svg)](https://badge.fury.io/rb/mittsu)
|
4
|
-
[![Coverage
|
5
|
-
[![
|
6
|
-
|
7
|
-
🍎 [![Circle CI Build Status (macOS)](https://circleci.com/gh/jellymann/mittsu/tree/master.svg?style=shield)](https://circleci.com/gh/jellymann/mittsu/tree/master)
|
8
|
-
🐧 [![Travis Build Status (Ubuntu)](https://travis-ci.org/jellymann/mittsu.svg?branch=master)](https://travis-ci.org/jellymann/mittsu)
|
9
|
-
🖼 [![AppVeyor Build status (Windows)](https://ci.appveyor.com/api/projects/status/x7k8r95m5f5fg9cu/branch/master?svg=true)](https://ci.appveyor.com/project/jellymann/mittsu/branch/master)
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/22be300984d81fa10af8/test_coverage)](https://codeclimate.com/github/jellymann/mittsu/test_coverage)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/22be300984d81fa10af8/maintainability)](https://codeclimate.com/github/jellymann/mittsu/maintainability)
|
6
|
+
[![Build Status](https://github.com/jellymann/mittsu/workflows/Build/badge.svg)](https://github.com/jellymann/mittsu/actions?query=workflow%3A%22Build%22)
|
10
7
|
|
11
8
|
3D Graphics Library for Ruby
|
12
9
|
|
data/Rakefile
CHANGED
data/install-glfw.ps1
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
$glfwversion="3.3.1"
|
2
|
+
|
3
|
+
Invoke-WebRequest "https://github.com/glfw/glfw/releases/download/$glfwversion/glfw-$glfwversion.bin.WIN32.zip" -OutFile "$pwd\glfw-$glfwversion.bin.WIN32.zip"
|
4
|
+
|
5
|
+
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
6
|
+
function Unzip
|
7
|
+
{
|
8
|
+
param([string]$zipfile, [string]$outpath)
|
9
|
+
|
10
|
+
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
|
11
|
+
}
|
12
|
+
|
13
|
+
Unzip "$pwd\glfw-$glfwversion.bin.WIN32.zip" "$pwd"
|
data/lib/mittsu.rb
CHANGED
@@ -1,19 +1,4 @@
|
|
1
|
-
|
2
|
-
DEBUG = ENV["DEBUG"] == "true"
|
3
|
-
|
4
|
-
def self.debug?
|
5
|
-
DEBUG
|
6
|
-
end
|
7
|
-
|
8
|
-
def self.env
|
9
|
-
ENV["MITTSU_ENV"]
|
10
|
-
end
|
11
|
-
|
12
|
-
def self.test?
|
13
|
-
env == 'test'
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
1
|
+
require "mittsu/utils"
|
17
2
|
require "mittsu/version"
|
18
3
|
require "mittsu/math"
|
19
4
|
require "mittsu/core"
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'mittsu'
|
2
|
-
|
3
1
|
module Mittsu
|
4
2
|
class OrthographicCamera < Camera
|
5
3
|
attr_accessor :zoom, :left, :right, :top, :bottom, :near, :far
|
@@ -25,8 +23,8 @@ module Mittsu
|
|
25
23
|
def update_projection_matrix
|
26
24
|
dx = (right - left) / (2.0 * zoom)
|
27
25
|
dy = (top - bottom) / (2.0 * zoom)
|
28
|
-
cx = (right
|
29
|
-
cy = (top
|
26
|
+
cx = (right + left) / 2.0
|
27
|
+
cy = (top + bottom) / 2.0
|
30
28
|
|
31
29
|
projection_matrix.make_orthographic(cx - dx, cx + dx, cy + dy, cy - dy, near, far)
|
32
30
|
end
|
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'mittsu'
|
2
|
-
|
3
1
|
module Mittsu
|
4
2
|
class PerspectiveCamera < Camera
|
5
3
|
attr_accessor :zoom, :fov, :aspect, :near, :far
|
@@ -15,6 +13,7 @@ module Mittsu
|
|
15
13
|
@aspect = aspect.to_f
|
16
14
|
@near = near.to_f
|
17
15
|
@far = far.to_f
|
16
|
+
@full_width = nil
|
18
17
|
|
19
18
|
update_projection_matrix
|
20
19
|
end
|
data/lib/mittsu/core/geometry.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
require 'securerandom'
|
2
|
-
require 'mittsu'
|
3
|
-
require 'securerandom'
|
4
2
|
|
5
3
|
module Mittsu
|
6
4
|
class Geometry
|
@@ -52,6 +50,8 @@ module Mittsu
|
|
52
50
|
@colors_need_update = false
|
53
51
|
@line_distances_need_update = false
|
54
52
|
@groups_need_update = false
|
53
|
+
|
54
|
+
@_listeners = {}
|
55
55
|
end
|
56
56
|
|
57
57
|
def apply_matrix(matrix)
|
@@ -429,12 +429,10 @@ module Mittsu
|
|
429
429
|
face.b = changes[face.b]
|
430
430
|
face.c = changes[face.c]
|
431
431
|
indices = [face.a, face.b, face.c]
|
432
|
-
dup_index = -1
|
433
432
|
# if any duplicate vertices are found in a Face3
|
434
433
|
# we have to remove the face as nothing can be saved
|
435
434
|
3.times do |n|
|
436
435
|
if indices[n] == indices[(n + 1) % 3]
|
437
|
-
dup_index = n
|
438
436
|
face_indices_to_remove << i
|
439
437
|
break
|
440
438
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'securerandom'
|
2
|
-
require 'mittsu'
|
3
2
|
|
4
3
|
module Mittsu
|
5
4
|
class Object3D
|
@@ -22,6 +21,8 @@ module Mittsu
|
|
22
21
|
@type = 'Object3D'
|
23
22
|
|
24
23
|
@children = []
|
24
|
+
@parent = nil
|
25
|
+
@name = nil
|
25
26
|
|
26
27
|
@up = DefaultUp.clone
|
27
28
|
|
@@ -55,6 +56,7 @@ module Mittsu
|
|
55
56
|
@render_order = 0
|
56
57
|
|
57
58
|
@user_data = {}
|
59
|
+
@_listeners = {}
|
58
60
|
end
|
59
61
|
|
60
62
|
def name
|
@@ -15,58 +15,58 @@ module Mittsu
|
|
15
15
|
|
16
16
|
# colors
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
18
|
+
hex_frustrum = 0xffaa00
|
19
|
+
hex_cone = 0xff0000
|
20
|
+
hex_up = 0x00aaff
|
21
|
+
hex_target = 0xffffff
|
22
|
+
hex_cross = 0x333333
|
23
23
|
|
24
24
|
# near
|
25
25
|
|
26
|
-
add_line(:n1, :n2,
|
27
|
-
add_line(:n2, :n4,
|
28
|
-
add_line(:n4, :n3,
|
29
|
-
add_line(:n3, :n1,
|
26
|
+
add_line(:n1, :n2, hex_frustrum)
|
27
|
+
add_line(:n2, :n4, hex_frustrum)
|
28
|
+
add_line(:n4, :n3, hex_frustrum)
|
29
|
+
add_line(:n3, :n1, hex_frustrum)
|
30
30
|
|
31
31
|
# far
|
32
32
|
|
33
|
-
add_line(:f1, :f2,
|
34
|
-
add_line(:f2, :f4,
|
35
|
-
add_line(:f4, :f3,
|
36
|
-
add_line(:f3, :f1,
|
33
|
+
add_line(:f1, :f2, hex_frustrum)
|
34
|
+
add_line(:f2, :f4, hex_frustrum)
|
35
|
+
add_line(:f4, :f3, hex_frustrum)
|
36
|
+
add_line(:f3, :f1, hex_frustrum)
|
37
37
|
|
38
38
|
# sides
|
39
39
|
|
40
|
-
add_line(:n1, :f1,
|
41
|
-
add_line(:n2, :f2,
|
42
|
-
add_line(:n3, :f3,
|
43
|
-
add_line(:n4, :f4,
|
40
|
+
add_line(:n1, :f1, hex_frustrum)
|
41
|
+
add_line(:n2, :f2, hex_frustrum)
|
42
|
+
add_line(:n3, :f3, hex_frustrum)
|
43
|
+
add_line(:n4, :f4, hex_frustrum)
|
44
44
|
|
45
45
|
# cone
|
46
46
|
|
47
|
-
add_line(:p, :n1,
|
48
|
-
add_line(:p, :n2,
|
49
|
-
add_line(:p, :n3,
|
50
|
-
add_line(:p, :n4,
|
47
|
+
add_line(:p, :n1, hex_cone)
|
48
|
+
add_line(:p, :n2, hex_cone)
|
49
|
+
add_line(:p, :n3, hex_cone)
|
50
|
+
add_line(:p, :n4, hex_cone)
|
51
51
|
|
52
52
|
# up
|
53
53
|
|
54
|
-
add_line(:u1, :u2,
|
55
|
-
add_line(:u2, :u3,
|
56
|
-
add_line(:u3, :u1,
|
54
|
+
add_line(:u1, :u2, hex_up)
|
55
|
+
add_line(:u2, :u3, hex_up)
|
56
|
+
add_line(:u3, :u1, hex_up)
|
57
57
|
|
58
58
|
# target
|
59
59
|
|
60
|
-
add_line(:c, :t,
|
61
|
-
add_line(:p, :c,
|
60
|
+
add_line(:c, :t, hex_target)
|
61
|
+
add_line(:p, :c, hex_cross)
|
62
62
|
|
63
63
|
# cross
|
64
64
|
|
65
|
-
add_line(:cn1, :cn2,
|
66
|
-
add_line(:cn3, :cn4,
|
65
|
+
add_line(:cn1, :cn2, hex_cross)
|
66
|
+
add_line(:cn3, :cn4, hex_cross)
|
67
67
|
|
68
|
-
add_line(:cf1, :cf2,
|
69
|
-
add_line(:cf3, :cf4,
|
68
|
+
add_line(:cf1, :cf2, hex_cross)
|
69
|
+
add_line(:cf3, :cf4, hex_cross)
|
70
70
|
|
71
71
|
super(@geometry, @material, LinePieces)
|
72
72
|
|
@@ -101,10 +101,10 @@ module Mittsu
|
|
101
101
|
|
102
102
|
# far
|
103
103
|
|
104
|
-
set_point(:f1, -w, -h,
|
105
|
-
set_point(:f2, w, -h,
|
106
|
-
set_point(:f3, -w, h,
|
107
|
-
set_point(:f4, w, h,
|
104
|
+
set_point(:f1, -w, -h, 1.0)
|
105
|
+
set_point(:f2, w, -h, 1.0)
|
106
|
+
set_point(:f3, -w, h, 1.0)
|
107
|
+
set_point(:f4, w, h, 1.0)
|
108
108
|
|
109
109
|
# up
|
110
110
|
|
@@ -119,10 +119,10 @@ module Mittsu
|
|
119
119
|
set_point(:cf3, 0.0, -h, 1.0)
|
120
120
|
set_point(:cf4, 0.0, h, 1.0)
|
121
121
|
|
122
|
-
set_point(:cn1, -w, 0.0, 1.0)
|
123
|
-
set_point(:cn2, w, 0.0, 1.0)
|
124
|
-
set_point(:cn3, 0.0, -h, 1.0)
|
125
|
-
set_point(:cn4, 0.0, h, 1.0)
|
122
|
+
set_point(:cn1, -w, 0.0, -1.0)
|
123
|
+
set_point(:cn2, w, 0.0, -1.0)
|
124
|
+
set_point(:cn3, 0.0, -h, -1.0)
|
125
|
+
set_point(:cn4, 0.0, h, -1.0)
|
126
126
|
|
127
127
|
@geometry.vertices_need_update = true
|
128
128
|
end
|
@@ -120,12 +120,16 @@ module Mittsu
|
|
120
120
|
light.shadow_cascade_offset.copy(@shadow_cascade_offset)
|
121
121
|
light.shadow_cascade_count = @shadow_cascade_count
|
122
122
|
|
123
|
-
|
124
|
-
|
125
|
-
|
123
|
+
light.shadow_cascade_bias = @shadow_cascade_bias.dup
|
124
|
+
light.shadow_cascade_width = @shadow_cascade_width.dup
|
125
|
+
light.shadow_cascade_height = @shadow_cascade_height.dup
|
126
126
|
|
127
|
-
|
128
|
-
|
127
|
+
light.shadow_cascade_near_z = @shadow_cascade_near_z.dup
|
128
|
+
light.shadow_cascade_far_z = @shadow_cascade_far_z.dup
|
129
|
+
end
|
130
|
+
|
131
|
+
def virtual?
|
132
|
+
false
|
129
133
|
end
|
130
134
|
|
131
135
|
protected
|
@@ -1,5 +1,4 @@
|
|
1
1
|
require 'securerandom'
|
2
|
-
require 'mittsu'
|
3
2
|
|
4
3
|
module Mittsu
|
5
4
|
class Material
|
@@ -7,9 +6,13 @@ module Mittsu
|
|
7
6
|
|
8
7
|
attr_reader :id, :uuid, :type
|
9
8
|
|
10
|
-
attr_accessor :name, :side, :opacity, :transparent, :blending, :blend_src, :blend_dst, :blend_equation, :blend_src_alpha,
|
9
|
+
attr_accessor :name, :side, :opacity, :transparent, :blending, :blend_src, :blend_dst, :blend_equation, :blend_src_alpha,
|
10
|
+
:blend_dst_alpha, :blend_equation_alpha, :depth_test, :depth_write, :color_write, :polygon_offset, :polygon_offset_factor,
|
11
|
+
:polygon_offset_units, :alpha_test, :overdraw, :visible, :attributes, :shading, :program
|
11
12
|
|
12
|
-
attr_accessor :map, :env_map, :light_map, :
|
13
|
+
attr_accessor :map, :env_map, :light_map, :normal_map, :specular_map, :alpha_map, :combine, :vertex_colors, :fog,
|
14
|
+
:size_attenuation, :skinning, :morph_targets, :morph_normals, :metal, :wrap_around, :defines, :lights, :color, :bump_map,
|
15
|
+
:reflectivity, :refraction_ratio, :wireframe, :default_attribute_values, :uniforms, :vertex_shader, :fragment_shader
|
13
16
|
|
14
17
|
def initialize
|
15
18
|
super
|
data/lib/mittsu/math/box2.rb
CHANGED
data/lib/mittsu/math/box3.rb
CHANGED
data/lib/mittsu/math/color.rb
CHANGED
data/lib/mittsu/math/euler.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'mittsu/math'
|
2
|
-
|
3
1
|
module Mittsu
|
4
2
|
class Euler
|
5
3
|
RotationOrders = [ 'XYZ', 'YZX', 'ZXY', 'XZY', 'YXZ', 'ZYX' ]
|
@@ -9,6 +7,7 @@ module Mittsu
|
|
9
7
|
|
10
8
|
def initialize(x = 0.0, y = 0.0, z = 0.0, order = DefaultOrder)
|
11
9
|
@x, @y, @z, @order = x.to_f, y.to_f, z.to_f, order
|
10
|
+
@on_change_callback = nil
|
12
11
|
end
|
13
12
|
|
14
13
|
def set(x, y, z, order = nil)
|
data/lib/mittsu/math/frustum.rb
CHANGED
data/lib/mittsu/math/line3.rb
CHANGED
data/lib/mittsu/math/matrix3.rb
CHANGED
data/lib/mittsu/math/matrix4.rb
CHANGED
data/lib/mittsu/math/plane.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'mittsu/math'
|
2
|
-
|
3
1
|
module Mittsu
|
4
2
|
class Quaternion
|
5
3
|
EPS = 0.000001
|
@@ -8,6 +6,7 @@ module Mittsu
|
|
8
6
|
|
9
7
|
def initialize(x = 0.0, y = 0.0, z = 0.0, w = 1.0)
|
10
8
|
@x, @y, @z, @w = x, y, z, w
|
9
|
+
@on_change_callback = nil
|
11
10
|
end
|
12
11
|
|
13
12
|
def set(x, y, z, w)
|
@@ -304,6 +303,5 @@ module Mittsu
|
|
304
303
|
def self.slerp(qa, qb, qm, t)
|
305
304
|
qm.copy(qa).slerp(qb, t)
|
306
305
|
end
|
307
|
-
|
308
306
|
end
|
309
307
|
end
|
data/lib/mittsu/math/ray.rb
CHANGED
data/lib/mittsu/math/sphere.rb
CHANGED
data/lib/mittsu/math/spline.rb
CHANGED
data/lib/mittsu/math/triangle.rb
CHANGED
data/lib/mittsu/math/vector2.rb
CHANGED
data/lib/mittsu/math/vector3.rb
CHANGED
data/lib/mittsu/math/vector4.rb
CHANGED
data/lib/mittsu/objects/line.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'opengl'
|
2
2
|
require 'glfw'
|
3
3
|
|
4
|
-
require 'mittsu'
|
4
|
+
require 'mittsu/utils'
|
5
5
|
require 'mittsu/renderers/glfw_lib'
|
6
6
|
glfw_lib = Mittsu::GLFWLib.discover
|
7
7
|
GLFW.load_lib(ENV["MITTSU_LIBGLFW_FILE"] || glfw_lib.file, ENV["MITTSU_LIBGLFW_PATH"] || glfw_lib.path) unless Mittsu.test?
|
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'erb'
|
2
|
-
|
3
2
|
require 'mittsu/renderers/opengl/opengl_shader'
|
4
3
|
|
5
4
|
module Mittsu
|
6
5
|
class OpenGLProgram
|
7
|
-
attr_reader :id, :program, :uniforms
|
6
|
+
attr_reader :id, :program, :uniforms
|
8
7
|
attr_accessor :code, :used_times, :attributes, :vertex_shader, :fragment_shader
|
9
8
|
|
10
9
|
def initialize(renderer, code, material, parameters)
|
@@ -2,12 +2,10 @@ require 'opengl'
|
|
2
2
|
require 'glfw'
|
3
3
|
require 'fiddle'
|
4
4
|
|
5
|
-
|
6
5
|
require 'mittsu/renderers/opengl/opengl_lib'
|
7
6
|
opengl_lib = Mittsu::OpenGLLib.discover
|
8
7
|
OpenGL.load_lib(ENV["MITTSU_LIBGL_FILE"] || opengl_lib.file, ENV["MITTSU_LIBGL_PATH"] || opengl_lib.path)
|
9
8
|
|
10
|
-
require 'mittsu'
|
11
9
|
require 'mittsu/renderers/glfw_window'
|
12
10
|
require 'mittsu/renderers/opengl/opengl_implementations'
|
13
11
|
require 'mittsu/renderers/opengl/opengl_debug'
|
@@ -30,9 +28,11 @@ require 'mittsu/renderers/opengl/opengl_mittsu_params'
|
|
30
28
|
|
31
29
|
module Mittsu
|
32
30
|
class OpenGLRenderer
|
33
|
-
attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
|
31
|
+
attr_accessor :auto_clear, :auto_clear_color, :auto_clear_depth, :auto_clear_stencil, :sort_objects, :gamma_factor, :gamma_input,
|
32
|
+
:gamma_output, :shadow_map_enabled, :shadow_map_type, :shadow_map_cull_face, :shadow_map_debug, :shadow_map_cascade,
|
33
|
+
:max_morph_targets, :max_morph_normals, :info, :pixel_ratio, :window, :width, :height, :state
|
34
34
|
|
35
|
-
attr_reader :logarithmic_depth_buffer, :
|
35
|
+
attr_reader :logarithmic_depth_buffer, :programs, :light_renderer, :proj_screen_matrix
|
36
36
|
|
37
37
|
def initialize(parameters = {})
|
38
38
|
puts "OpenGLRenderer (Revision #{REVISION})"
|
@@ -81,11 +81,6 @@ module Mittsu
|
|
81
81
|
|
82
82
|
# TODO: get_context ???
|
83
83
|
# TODO: force_context_loss ???
|
84
|
-
|
85
|
-
def supports_vertex_textures?
|
86
|
-
@_supports_vertex_textures
|
87
|
-
end
|
88
|
-
|
89
84
|
# TODO: supports_float_textures? ???
|
90
85
|
# TODO: supports[half|standard|compressed|blend min max] ... ???
|
91
86
|
|
data/lib/mittsu/scenes/scene.rb
CHANGED
@@ -10,9 +10,10 @@ module Mittsu
|
|
10
10
|
DEFAULT_IMAGE = nil
|
11
11
|
DEFAULT_MAPPING = UVMapping
|
12
12
|
|
13
|
-
attr_reader :id, :uuid
|
13
|
+
attr_reader :id, :uuid
|
14
14
|
|
15
|
-
attr_accessor :image, :name, :source_file, :mipmaps, :offset, :repeat, :generate_mipmaps, :premultiply_alpha, :filp_y,
|
15
|
+
attr_accessor :image, :name, :source_file, :mipmaps, :offset, :repeat, :generate_mipmaps, :premultiply_alpha, :filp_y,
|
16
|
+
:unpack_alignment, :on_update, :mapping, :wrap_s, :wrap_t, :mag_filter, :min_filter, :anisotropy, :format, :type
|
16
17
|
|
17
18
|
def initialize(image = DEFAULT_IMAGE, mapping = DEFAULT_MAPPING, wrap_s = ClampToEdgeWrapping, wrap_t = ClampToEdgeWrapping, mag_filter = LinearFilter, min_filter = LinearMipMapLinearFilter, format = RGBAFormat, type = UnsignedByteType, anisotropy = 1)
|
18
19
|
super()
|
@@ -42,6 +43,7 @@ module Mittsu
|
|
42
43
|
|
43
44
|
@_needs_update = false
|
44
45
|
@on_update = nil
|
46
|
+
@_listeners = {}
|
45
47
|
end
|
46
48
|
|
47
49
|
def needs_update?
|
data/lib/mittsu/utils.rb
ADDED
data/lib/mittsu/version.rb
CHANGED
data/mittsu.gemspec
CHANGED
@@ -23,14 +23,15 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.required_ruby_version = '>= 2.0.0'
|
24
24
|
spec.requirements << 'OpenGL 3.3+ capable hardware and drivers'
|
25
25
|
|
26
|
-
spec.add_runtime_dependency 'opengl-bindings'
|
27
|
-
spec.add_runtime_dependency 'ffi'
|
28
|
-
spec.add_runtime_dependency 'chunky_png'
|
26
|
+
spec.add_runtime_dependency 'opengl-bindings'
|
27
|
+
spec.add_runtime_dependency 'ffi'
|
28
|
+
spec.add_runtime_dependency 'chunky_png'
|
29
29
|
|
30
|
-
spec.add_development_dependency "bundler"
|
31
|
-
spec.add_development_dependency "rake"
|
32
|
-
spec.add_development_dependency 'minitest'
|
33
|
-
spec.add_development_dependency 'minitest-reporters'
|
34
|
-
spec.add_development_dependency 'pry'
|
35
|
-
spec.add_development_dependency 'benchmark-ips'
|
30
|
+
spec.add_development_dependency "bundler"
|
31
|
+
spec.add_development_dependency "rake"
|
32
|
+
spec.add_development_dependency 'minitest'
|
33
|
+
spec.add_development_dependency 'minitest-reporters'
|
34
|
+
spec.add_development_dependency 'pry'
|
35
|
+
spec.add_development_dependency 'benchmark-ips'
|
36
|
+
spec.add_development_dependency 'simplecov'
|
36
37
|
end
|
metadata
CHANGED
@@ -1,141 +1,155 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mittsu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: opengl-bindings
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ffi
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: chunky_png
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: bundler
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- - "
|
73
|
+
- - ">="
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '0'
|
76
76
|
type: :development
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- - "
|
80
|
+
- - ">="
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
82
|
+
version: '0'
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: minitest
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- - "
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
89
|
+
version: '0'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- - "
|
94
|
+
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
96
|
+
version: '0'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: minitest-reporters
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- - "
|
101
|
+
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
103
|
+
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- - "
|
108
|
+
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
110
|
+
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: pry
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- - "
|
115
|
+
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0
|
117
|
+
version: '0'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- - "
|
122
|
+
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0
|
124
|
+
version: '0'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: benchmark-ips
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
128
128
|
requirements:
|
129
|
-
- - "
|
129
|
+
- - ">="
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
131
|
+
version: '0'
|
132
132
|
type: :development
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: simplecov
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - ">="
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '0'
|
139
153
|
description: Mittsu makes 3D graphics easier by providing an abstraction over OpenGL,
|
140
154
|
and is based heavily off of THREE.js. No more weird pointers and wondering about
|
141
155
|
the difference between a VAO and a VBO (besides the letter). Simply think of something
|
@@ -146,9 +160,8 @@ executables: []
|
|
146
160
|
extensions: []
|
147
161
|
extra_rdoc_files: []
|
148
162
|
files:
|
149
|
-
- ".circleci/config.yml"
|
150
|
-
- ".circleci/images/primary/Dockerfile"
|
151
163
|
- ".codeclimate.yml"
|
164
|
+
- ".github/workflows/build-workflow.yml"
|
152
165
|
- ".gitignore"
|
153
166
|
- ".rubocop.yml"
|
154
167
|
- CODE_OF_CONDUCT.md
|
@@ -156,10 +169,9 @@ files:
|
|
156
169
|
- LICENSE.txt
|
157
170
|
- README.md
|
158
171
|
- Rakefile
|
159
|
-
- appveyor.yml
|
160
172
|
- bin/console
|
161
173
|
- bin/setup
|
162
|
-
-
|
174
|
+
- install-glfw.ps1
|
163
175
|
- lib/mittsu.rb
|
164
176
|
- lib/mittsu/cameras.rb
|
165
177
|
- lib/mittsu/cameras/camera.rb
|
@@ -391,6 +403,7 @@ files:
|
|
391
403
|
- lib/mittsu/textures/data_texture.rb
|
392
404
|
- lib/mittsu/textures/texture.rb
|
393
405
|
- lib/mittsu/textures/video_texture.rb
|
406
|
+
- lib/mittsu/utils.rb
|
394
407
|
- lib/mittsu/version.rb
|
395
408
|
- mittsu.gemspec
|
396
409
|
homepage: https://github.com/jellymann/mittsu
|
data/.circleci/config.yml
DELETED
@@ -1,87 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
jobs:
|
3
|
-
test-macos:
|
4
|
-
macos:
|
5
|
-
xcode: "9.4.1"
|
6
|
-
working_directory: ~/mittsu
|
7
|
-
steps:
|
8
|
-
- checkout
|
9
|
-
|
10
|
-
- restore_cache:
|
11
|
-
keys:
|
12
|
-
- mittsu-brew-v1-{{ .Branch }}
|
13
|
-
- mittsu-brew-v1-
|
14
|
-
- run: brew install glfw
|
15
|
-
- save_cache:
|
16
|
-
key: mittsu-brew-v1-{{ .Branch }}
|
17
|
-
paths:
|
18
|
-
- /usr/local/Homebrew
|
19
|
-
|
20
|
-
- restore_cache:
|
21
|
-
keys:
|
22
|
-
- mittsu-bundler-v2-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "mittsu.gemspec" }}
|
23
|
-
- mittsu-bundler-v2-{{ .Branch }}-
|
24
|
-
- mittsu-bundler-v2-
|
25
|
-
- run: bundle install --path vendor/bundle
|
26
|
-
- save_cache:
|
27
|
-
key: mittsu-bundler-v2-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "mittsu.gemspec" }}
|
28
|
-
paths:
|
29
|
-
- vendor/bundle
|
30
|
-
|
31
|
-
## TEST
|
32
|
-
- run:
|
33
|
-
name: Run tests
|
34
|
-
command: bundle exec rake test
|
35
|
-
environment:
|
36
|
-
MITTSU_LIBGLFW_PATH: /usr/local/lib
|
37
|
-
MITTSU_LIBGLFW_FILE: libglfw.dylib
|
38
|
-
MINITEST_REPORTER: JUnitReporter
|
39
|
-
|
40
|
-
## COLLECT RESULTS
|
41
|
-
- run: bundle exec codeclimate-test-reporter
|
42
|
-
- store_test_results:
|
43
|
-
path: test/reports
|
44
|
-
|
45
|
-
test-linux:
|
46
|
-
docker:
|
47
|
-
- image: dansmith45/circleci-ruby-glfw:2.5.1
|
48
|
-
environment:
|
49
|
-
MITTSU_LIBGLFW_PATH: /usr/local/lib
|
50
|
-
MITTSU_LIBGLFW_FILE: libglfw.so
|
51
|
-
MINITEST_REPORTER: JUnitReporter
|
52
|
-
working_directory: ~/mittsu
|
53
|
-
steps:
|
54
|
-
- checkout
|
55
|
-
|
56
|
-
- restore_cache:
|
57
|
-
keys:
|
58
|
-
- mittsu-linux-bundler-v2-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "mittsu.gemspec" }}
|
59
|
-
- mittsu-linux-bundler-v2-{{ .Branch }}-
|
60
|
-
- mittsu-linux-bundler-v2-
|
61
|
-
- run: bundle install --path vendor/bundle
|
62
|
-
- save_cache:
|
63
|
-
key: mittsu-linux-bundler-v2-{{ .Branch }}-{{ checksum "Gemfile" }}-{{ checksum "mittsu.gemspec" }}
|
64
|
-
paths:
|
65
|
-
- vendor/bundle
|
66
|
-
|
67
|
-
## TEST
|
68
|
-
- run:
|
69
|
-
name: Run tests
|
70
|
-
command: bundle exec rake test
|
71
|
-
environment:
|
72
|
-
MITTSU_LIBGLFW_PATH: /usr/local/lib
|
73
|
-
MITTSU_LIBGLFW_FILE: libglfw.dylib
|
74
|
-
MINITEST_REPORTER: JUnitReporter
|
75
|
-
|
76
|
-
## COLLECT RESULTS
|
77
|
-
- run: bundle exec codeclimate-test-reporter
|
78
|
-
- store_test_results:
|
79
|
-
path: test/reports
|
80
|
-
|
81
|
-
workflows:
|
82
|
-
version: 2
|
83
|
-
|
84
|
-
test:
|
85
|
-
jobs:
|
86
|
-
- test-macos
|
87
|
-
- test-linux
|
@@ -1,10 +0,0 @@
|
|
1
|
-
FROM circleci/ruby:2.5.1
|
2
|
-
|
3
|
-
RUN sudo apt-get update; sudo apt-get install cmake xorg-dev libgl1-mesa-dev
|
4
|
-
|
5
|
-
RUN wget https://github.com/glfw/glfw/releases/download/3.1.2/glfw-3.1.2.zip -O /tmp/glfw.zip
|
6
|
-
RUN unzip /tmp/glfw.zip -d /tmp
|
7
|
-
WORKDIR /tmp/glfw-3.1.2/
|
8
|
-
RUN cmake -D BUILD_SHARED_LIBS=ON .
|
9
|
-
RUN make
|
10
|
-
RUN sudo make install
|
data/appveyor.yml
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
version: '{build}'
|
2
|
-
|
3
|
-
clone_folder: c:\projects\mittsu
|
4
|
-
|
5
|
-
environment:
|
6
|
-
MITTSU_LIBGLFW_FILE: c:\projects\mittsu\glfw-3.2.1.bin.WIN32\lib-mingw\glfw3.dll
|
7
|
-
|
8
|
-
install:
|
9
|
-
- ps: c:\projects\mittsu\install_glfw.ps1
|
10
|
-
- set PATH=C:\Ruby22\bin;%PATH%
|
11
|
-
- bundle install
|
12
|
-
|
13
|
-
build: off
|
14
|
-
|
15
|
-
|
16
|
-
before_test:
|
17
|
-
- dir c:\projects\mittsu\glfw-3.2.1.bin.WIN32
|
18
|
-
- ruby -v
|
19
|
-
- gem -v
|
20
|
-
- bundle -v
|
21
|
-
|
22
|
-
test_script:
|
23
|
-
- bundle exec rake test
|
data/install_glfw.ps1
DELETED
@@ -1,11 +0,0 @@
|
|
1
|
-
Invoke-WebRequest https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.bin.WIN32.zip -OutFile "$pwd\glfw-3.2.1.bin.WIN32.zip"
|
2
|
-
|
3
|
-
Add-Type -AssemblyName System.IO.Compression.FileSystem
|
4
|
-
function Unzip
|
5
|
-
{
|
6
|
-
param([string]$zipfile, [string]$outpath)
|
7
|
-
|
8
|
-
[System.IO.Compression.ZipFile]::ExtractToDirectory($zipfile, $outpath)
|
9
|
-
}
|
10
|
-
|
11
|
-
Unzip "$pwd\glfw-3.2.1.bin.WIN32.zip" "$pwd"
|