nit.git
8 years agoREADME: add system configuration for OS X
Alexis Laferrière [Wed, 27 Jan 2016 02:25:34 +0000 (21:25 -0500)]
README: add system configuration for OS X

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agomisc/nit_env.sh: add support for zsh and fix fallback creating a file
Alexis Laferrière [Fri, 29 Jan 2016 15:50:41 +0000 (10:50 -0500)]
misc/nit_env.sh: add support for zsh and fix fallback creating a file

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Intro Action Nitro!
Jean Privat [Mon, 8 Feb 2016 19:16:23 +0000 (14:16 -0500)]
Merge: Intro Action Nitro!

This PR intro our submission for the clibre gamejam. An action platformer where the goal is to jump from plane to plane and reach the ISS to kill the bad guys. It features explosion physics, randomly generated platforms, many weapons, a powerup system, blood, standing on helicopter rotors, an evil 3D ISS, and more!

This game uses both the sprites of gamnit flat and 3D models with gamnit depth. It has many particle effects and manipulates the camera to create custom animations.

Ping the cocreators @R4PaSs, @BlackMinou, @MehdiAit.

Pull-Request: #1938
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: flying numbers in memory
Jean Privat [Mon, 8 Feb 2016 01:43:48 +0000 (20:43 -0500)]
Merge: flying numbers in memory

when playing, the number of the shape is shown.

![memory02](https://cloud.githubusercontent.com/assets/135828/12864556/d5f7d43e-cc5c-11e5-86f8-3b0ed6146874.png)

Pull-Request: #1940
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: lib/core: use intern && ffi since it is now allowed by `c_src`
Jean Privat [Mon, 8 Feb 2016 01:43:45 +0000 (20:43 -0500)]
Merge: lib/core: use intern && ffi since it is now allowed by `c_src`

This is a cosmetic change, you should not see differences

Pull-Request: #1937
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: compiler: add a native implementation of NativeArray::memmove
Jean Privat [Sat, 6 Feb 2016 21:23:22 +0000 (16:23 -0500)]
Merge: compiler: add a native implementation of NativeArray::memmove

This is a simple patch but it needed the regen of `c_src` for boostrap reason

Pull-Request: #1936
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agotest: update sav based on kernel line numbers and content
Jean Privat [Sat, 6 Feb 2016 21:22:35 +0000 (16:22 -0500)]
test: update sav based on kernel line numbers and content

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib/memory: draw flying numbers when buttons are clicked
Jean Privat [Sat, 6 Feb 2016 21:11:29 +0000 (16:11 -0500)]
contrib/memory: draw flying numbers when buttons are clicked

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib/memory: use centered numbers
Jean Privat [Sat, 6 Feb 2016 03:52:55 +0000 (22:52 -0500)]
contrib/memory: use centered numbers

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/mnit: add `centered` to blit_number
Jean Privat [Sat, 6 Feb 2016 03:52:22 +0000 (22:52 -0500)]
lib/mnit: add `centered` to blit_number

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocontrib: intro action_nitro, a game for the clibre gamejam 2016
Alexis Laferrière [Mon, 1 Feb 2016 16:40:19 +0000 (11:40 -0500)]
contrib: intro action_nitro, a game for the clibre gamejam 2016

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
Signed-off-by: Lucas Bajolet <r4pass@hotmail.com>
Signed-off-by: Romain Chanoir <romain.chanoir@viacesi.fr>
Signed-off-by: Mehdi Ait Younes <overpex@gmail.com>

8 years agocontrib/asteronits & model_viewer: fix user for new Y direction and rotation
Alexis Laferrière [Mon, 1 Feb 2016 19:36:44 +0000 (14:36 -0500)]
contrib/asteronits & model_viewer: fix user for new Y direction and rotation

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit flat: rotation follows the right hand rule on the Z axis
Alexis Laferrière [Mon, 1 Feb 2016 19:35:52 +0000 (14:35 -0500)]
lib/gamnit flat: rotation follows the right hand rule on the Z axis

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: invert Y axis so higher values are higher on the screen
Alexis Laferrière [Mon, 1 Feb 2016 16:42:18 +0000 (11:42 -0500)]
lib/gamnit: invert Y axis so higher values are higher on the screen

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/core: use intern && ffi since it is now allowed by `c_src`
Jean Privat [Thu, 4 Feb 2016 02:02:08 +0000 (21:02 -0500)]
lib/core: use intern && ffi since it is now allowed by `c_src`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agocompiler: add a native implementation of NativeArray::memmove
Jean Privat [Thu, 4 Feb 2016 01:52:25 +0000 (20:52 -0500)]
compiler: add a native implementation of NativeArray::memmove

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Introduction to Nit generators
Jean Privat [Thu, 4 Feb 2016 01:20:50 +0000 (20:20 -0500)]
Merge: Introduction to Nit generators

Introduce the `yield` keyword in Nit grammar

@privat, @egagnon

Pull-Request: #1935
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoIntroduction to Nit generators
Ait younes Mehdi Adel [Wed, 3 Feb 2016 21:38:37 +0000 (16:38 -0500)]
Introduction to Nit generators

Introduce the `yield` keyword in Nit grammar

8 years agoMerge: gamnit: intro static particles, Sprite tint & invert_x, and fix a few bugs
Jean Privat [Wed, 3 Feb 2016 19:26:26 +0000 (14:26 -0500)]
Merge: gamnit: intro static particles, Sprite tint & invert_x,  and fix a few bugs

Intro a few new features:
* `Sprite::tint` to tint the color of a sprite.
* `Sprite::invert_x` to draw a sprite with the X axis inverted.
* `App::static_program` a particle program to display simple static and long lived particles. Can be useful to display clouds.

Fix a few bugs:
* `svg_to_png_and_nit` generated invalid code for array of textures when the target was gamnit.
* `App::clock` was instantiated with `app`, this caused the first `dt` of `App::update` to be much larger than expected.
* Divide `frame_core_flat` in 2 to allow the depth framework to draw particles after the world sprites but before the UI sprites.

Pull-Request: #1934
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/gamnit: fix clock starting at first usage, not with the program
Alexis Laferrière [Mon, 1 Feb 2016 16:47:46 +0000 (11:47 -0500)]
lib/gamnit: fix clock starting at first usage, not with the program

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `Sprite::invert_x`
Alexis Laferrière [Mon, 1 Feb 2016 16:47:22 +0000 (11:47 -0500)]
lib/gamnit: intro `Sprite::invert_x`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `Sprite::tint`
Alexis Laferrière [Mon, 1 Feb 2016 16:45:35 +0000 (11:45 -0500)]
lib/gamnit: intro `Sprite::tint`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: divide frame_core_flat in 2 parts to draw particles in between
Alexis Laferrière [Mon, 1 Feb 2016 16:45:01 +0000 (11:45 -0500)]
lib/gamnit: divide frame_core_flat in 2 parts to draw particles in between

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro static particles, the default most simple particle program
Alexis Laferrière [Mon, 1 Feb 2016 16:43:56 +0000 (11:43 -0500)]
lib/gamnit: intro static particles, the default most simple particle program

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/inkscape_tools: fix generated code for arrays with gamnit
Alexis Laferrière [Mon, 1 Feb 2016 16:41:06 +0000 (11:41 -0500)]
contrib/inkscape_tools: fix generated code for arrays with gamnit

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoversion 0.8 v0.8
Jean Privat [Sun, 31 Jan 2016 19:47:23 +0000 (14:47 -0500)]
version 0.8

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: c_src: regenerate
Jean Privat [Fri, 29 Jan 2016 22:41:20 +0000 (17:41 -0500)]
Merge: c_src: regenerate

Last regeneration was Wed Jun 10, 2015. Impressive.

Pull-Request: #1933

8 years agoc_src: regenerate
Jean Privat [Fri, 29 Jan 2016 21:37:13 +0000 (16:37 -0500)]
c_src: regenerate

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: src/Makefile: use peflags to bootstrap on windows
Jean Privat [Fri, 29 Jan 2016 03:14:37 +0000 (22:14 -0500)]
Merge: src/Makefile: use peflags to bootstrap on windows

Inject automatically call to peflags on the 2 first steps of the bootstrap.

Other executables (those in bin/ and those compiled by the user) are not peflaged since it does not seems that useful in general.

Pull-Request: #1932
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agosrc/Makefile: use peflags to bootstrap on windows
Jean Privat [Fri, 29 Jan 2016 02:57:50 +0000 (21:57 -0500)]
src/Makefile: use peflags to bootstrap on windows

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Harden tests script
Jean Privat [Thu, 28 Jan 2016 21:56:55 +0000 (16:56 -0500)]
Merge: Harden tests script

Improve the resilience of the tests.sh script if java is not found or if ulimit is limited

Pull-Request: #1930
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Fix makefile of Tinks!
Jean Privat [Thu, 28 Jan 2016 18:21:37 +0000 (13:21 -0500)]
Merge: Fix makefile of Tinks!

This PR fix the broken Android makefile rules of Tinks!, reported by @privat.

The duplicated calls to nitserial should be temporary until we find a cleaner way to manage it.

Pull-Request: #1931
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib/tinks: remove the archive rule
Alexis Laferrière [Thu, 28 Jan 2016 17:18:14 +0000 (12:18 -0500)]
contrib/tinks: remove the archive rule

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tinks: always generate client_serialize
Alexis Laferrière [Thu, 28 Jan 2016 17:17:57 +0000 (12:17 -0500)]
contrib/tinks: always generate client_serialize

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agohtcpcp_server: add .res file for tests
Jean Privat [Thu, 28 Jan 2016 13:55:40 +0000 (08:55 -0500)]
htcpcp_server: add .res file for tests

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Implemented a htcpcp server
Jean Privat [Thu, 28 Jan 2016 13:54:24 +0000 (08:54 -0500)]
Merge: Implemented a htcpcp server

An attempt at: https://github.com/nitlang/nit/issues/1808, a fun little example.

As a first step I haven't implemented additions, and gave as best implementation of the protocol as I could interpret it.

It's mostly based on the `file_server.nit` file. If you want to test it locally a good way is to use `curl -X <METHOD> localhost:8080`

@xymus @Bl4ckb0ne @R4PaSs

Pull-Request: #1915
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agotests: avoid errors messages if java is not found
Jean Privat [Thu, 28 Jan 2016 01:49:02 +0000 (20:49 -0500)]
tests: avoid errors messages if java is not found

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agotests: filter out ulimit error messages to avoid corruption of .res files
Jean Privat [Thu, 28 Jan 2016 01:38:56 +0000 (20:38 -0500)]
tests: filter out ulimit error messages to avoid corruption of .res files

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Intro Tinks! 3D: A gamnit game with particles effects
Jean Privat [Mon, 25 Jan 2016 20:09:07 +0000 (15:09 -0500)]
Merge: Intro Tinks! 3D: A gamnit game with particles effects

Intro a 3D client for Tinks! built with _gamnit depth_. It uses the same logic as the 2D client so they are compatible for multiplayer games.

To support this client there was a few fix to gamnit and some new features, most notably:

* A customizable particle system with two implementations, one for smoke and one for explosions. This module is a first draft, a few features are lacking.

* The method `show_splash_screen` which displays a single texture centered on a cleared screen (by default black).This method should usually be called before loading textures and models and doing other slow work.

---

Sorry for the scary diff (once again) but there is actually little code added. The main commits are the intro of the particle system and of the new Tinks! client.

Pull-Request: #1928
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib/tinks: intro 3D client
Alexis Laferrière [Wed, 30 Dec 2015 05:15:57 +0000 (00:15 -0500)]
contrib/tinks: intro 3D client

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tinks: extract common client code from the mnit client
Alexis Laferrière [Sun, 24 Jan 2016 15:59:00 +0000 (10:59 -0500)]
contrib/tinks: extract common client code from the mnit client

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tinks: add `FeatureChangeEvent::old_feature`
Alexis Laferrière [Sat, 23 Jan 2016 16:44:04 +0000 (11:44 -0500)]
contrib/tinks: add `FeatureChangeEvent::old_feature`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/tinks: do not publish TankMoveEvents for dead tanks
Alexis Laferrière [Fri, 1 Jan 2016 23:06:34 +0000 (18:06 -0500)]
contrib/tinks: do not publish TankMoveEvents for dead tanks

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: fix Y offset, repeated clicks and tweak display
Alexis Laferrière [Fri, 22 Jan 2016 16:57:59 +0000 (11:57 -0500)]
contrib/model_viewer: fix Y offset, repeated clicks and tweak display

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: use `show_splash_screen`
Alexis Laferrière [Fri, 22 Jan 2016 16:58:30 +0000 (11:58 -0500)]
contrib/model_viewer: use `show_splash_screen`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit flat: intro `show_splash_screen`
Alexis Laferrière [Sun, 24 Jan 2016 16:02:34 +0000 (11:02 -0500)]
lib/gamnit flat: intro `show_splash_screen`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: intro particle systems
Alexis Laferrière [Sat, 23 Jan 2016 22:20:50 +0000 (17:20 -0500)]
lib/gamnit depth: intro particle systems

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: discard fragments with a low alpha value
Alexis Laferrière [Sun, 24 Jan 2016 06:37:34 +0000 (01:37 -0500)]
lib/gamnit depth: discard fragments with a low alpha value

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: fix ambient color, multiply with texture
Alexis Laferrière [Fri, 22 Jan 2016 21:32:11 +0000 (16:32 -0500)]
lib/gamnit depth: fix ambient color, multiply with texture

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: intro `Plane::repeat_x|y`
Alexis Laferrière [Fri, 22 Jan 2016 19:05:56 +0000 (14:05 -0500)]
lib/gamnit depth: intro `Plane::repeat_x|y`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: make colors in SmoothMaterial writable
Alexis Laferrière [Thu, 21 Jan 2016 19:30:44 +0000 (14:30 -0500)]
lib/gamnit depth: make colors in SmoothMaterial writable

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: TextureMaterial supports subtexture
Alexis Laferrière [Thu, 21 Jan 2016 16:28:08 +0000 (11:28 -0500)]
lib/gamnit depth: TextureMaterial supports subtexture

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: solve the mysterious bug "Why is the Y axis inverted?"
Alexis Laferrière [Thu, 21 Jan 2016 11:12:16 +0000 (06:12 -0500)]
lib/gamnit depth: solve the mysterious bug "Why is the Y axis inverted?"

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `GamnitRootTexture::pixelated=`
Alexis Laferrière [Thu, 21 Jan 2016 19:31:47 +0000 (14:31 -0500)]
lib/gamnit: intro `GamnitRootTexture::pixelated=`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `EulerCamera::center`
Alexis Laferrière [Thu, 21 Jan 2016 11:11:41 +0000 (06:11 -0500)]
lib/gamnit: intro `EulerCamera::center`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: solve the mysterious bug "camera is 2 times too far"
Alexis Laferrière [Sat, 23 Jan 2016 16:45:46 +0000 (11:45 -0500)]
lib/gamnit: solve the mysterious bug "camera is 2 times too far"

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: fix `Subtexture::gl_texture` not being set
Alexis Laferrière [Thu, 21 Jan 2016 19:31:20 +0000 (14:31 -0500)]
lib/gamnit: fix `Subtexture::gl_texture` not being set

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: lib/core/math: add `Collection::sample`
Jean Privat [Sat, 23 Jan 2016 21:52:03 +0000 (16:52 -0500)]
Merge: lib/core/math: add `Collection::sample`

Close a task of @ablondin

Pull-Request: #1927
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: lib/core: add Sequence::modulo to access with a Python-wrap semantic
Jean Privat [Sat, 23 Jan 2016 21:52:00 +0000 (16:52 -0500)]
Merge: lib/core: add Sequence::modulo to access with a Python-wrap semantic

Proposed because https://github.com/nitlang/nit/pull/1920/files#diff-c6e41a937b2b8ba5e5e04bd8f49260f7R104

I'm not sure of the name `modulo`.

Pull-Request: #1921
Reviewed-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/core: add Sequence::modulo to access with a Python-wrap semantic
Jean Privat [Fri, 22 Jan 2016 04:44:58 +0000 (23:44 -0500)]
lib/core: add Sequence::modulo to access with a Python-wrap semantic

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agolib/core/math: add `Collection::sample`
Jean Privat [Fri, 22 Jan 2016 04:34:12 +0000 (23:34 -0500)]
lib/core/math: add `Collection::sample`

Signed-off-by: Jean Privat <jean@pryen.org>

8 years agoMerge: Small improvements to the gamnit README
Jean Privat [Thu, 21 Jan 2016 01:19:45 +0000 (20:19 -0500)]
Merge: Small improvements to the gamnit README

Pull-Request: #1926
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: contrib/model_viewer: refactor the globe standalone example as a model in...
Jean Privat [Thu, 21 Jan 2016 01:19:38 +0000 (20:19 -0500)]
Merge: contrib/model_viewer: refactor the globe standalone example as a model in model_viewer

This PR extracts the base code of the globe example from gamnit into a `GlobeModel` for model_viewer. It will be the official example of a custom material/graphical program for the _gamnit
depth_ framework.

Fix the bugs, including when switching between the graphics programs from _depth_ and _flat_, as well as the new custom one to display the globe.

Also add missing UI textures and change the icon to reuse the globe one (I think it looks better on the device). In order to keep a simple example (and Makefile) we lose a few features in this change, namely the dynamic texture resolution selection and the Android Wear version.

Pull-Request: #1924
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: gamnit VR: steroscopic view and head tracking on Android
Jean Privat [Thu, 21 Jan 2016 01:19:36 +0000 (20:19 -0500)]
Merge: gamnit VR: steroscopic view and head tracking on Android

This PR adds support for VR to the _gamnit depth_ framework. By importing `gamnit::vr`, all drawings are duplicated for a stereoscopic view and the `world_camera` orientation is updated from head tracking data.

VR is applied to the `model_viewer` app for testing only. The UI should still be updated for a nicer VR experience.

This is done by simple refinement, which allows for easy (but dirty) conversion to VR using `nitc ... -m lib/gamnit/depth/vr.nit`. However this does not allow to easily switch between VR and a classic view. This could be improved as needed in the future by using a subclass of `EulerCamera` and a few conditions in `frame_core_draw`.

Pull-Request: #1923
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: gamnit keys: simple service to keep track of pressed keys
Jean Privat [Thu, 21 Jan 2016 01:19:34 +0000 (20:19 -0500)]
Merge: gamnit keys: simple service to keep track of pressed keys

This simple service can be incredibly useful in games where a key held down causes an event at each frame, like walking forward by pressing `w`.

I use this in the 3D version of Tinks! Which should be ready for a PR in a near future.

Pull-Request: #1922
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/gamnit: improve the gamnit README and fix the typo in its name
Alexis Laferrière [Fri, 1 Jan 2016 23:08:04 +0000 (18:08 -0500)]
lib/gamnit: improve the gamnit README and fix the typo in its name

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `keys` to keep track of pressed keys
Alexis Laferrière [Mon, 5 Oct 2015 14:03:38 +0000 (10:03 -0400)]
lib/gamnit: intro `keys` to keep track of pressed keys

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: intro simple VR variant by pure refinement
Alexis Laferrière [Tue, 19 Jan 2016 17:56:12 +0000 (12:56 -0500)]
contrib/model_viewer: intro simple VR variant by pure refinement

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: intro VR for Android with head tracking
Alexis Laferrière [Tue, 19 Jan 2016 17:39:24 +0000 (12:39 -0500)]
lib/gamnit depth: intro VR for Android with head tracking

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: use the globe icon
Alexis Laferrière [Tue, 19 Jan 2016 18:50:47 +0000 (13:50 -0500)]
contrib/model_viewer: use the globe icon

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: update README file
Alexis Laferrière [Tue, 19 Jan 2016 18:47:07 +0000 (13:47 -0500)]
contrib/model_viewer: update README file

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: move the globe example as a custom model
Alexis Laferrière [Sat, 16 Jan 2016 17:16:50 +0000 (12:16 -0500)]
contrib/model_viewer: move the globe example as a custom model

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: add stereoscopic view module
Alexis Laferrière [Tue, 19 Jan 2016 17:26:58 +0000 (12:26 -0500)]
lib/gamnit depth: add stereoscopic view module

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth&flat: extract implementations of frame_core_draw
Alexis Laferrière [Tue, 19 Jan 2016 19:06:02 +0000 (14:06 -0500)]
lib/gamnit depth&flat: extract implementations of frame_core_draw

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android/cardboard: remove `gyro_bias` as it no more available in the SDK
Alexis Laferrière [Tue, 19 Jan 2016 19:53:14 +0000 (14:53 -0500)]
lib/android/cardboard: remove `gyro_bias` as it no more available in the SDK

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/model_viewer: add missing texture assets
Alexis Laferrière [Tue, 19 Jan 2016 15:49:23 +0000 (10:49 -0500)]
contrib/model_viewer: add missing texture assets

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit flat: set array_enabled at each draw
Alexis Laferrière [Tue, 19 Jan 2016 13:56:55 +0000 (08:56 -0500)]
lib/gamnit flat: set array_enabled at each draw

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: make scale and translation uniforms
Alexis Laferrière [Tue, 19 Jan 2016 13:56:28 +0000 (08:56 -0500)]
lib/gamnit depth: make scale and translation uniforms

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: add texture_coords to Cube
Alexis Laferrière [Mon, 18 Jan 2016 16:54:57 +0000 (11:54 -0500)]
lib/gamnit depth: add texture_coords to Cube

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit depth: fix Plane drawing using indices for glDrawElements
Alexis Laferrière [Tue, 19 Jan 2016 14:08:24 +0000 (09:08 -0500)]
lib/gamnit depth: fix Plane drawing using indices for glDrawElements

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Intro gamnit depth, the 3D game framework for Nit
Jean Privat [Tue, 19 Jan 2016 14:04:28 +0000 (09:04 -0500)]
Merge: Intro gamnit depth, the 3D game framework for Nit

This PR intro the base structure of a framework for portable 3D game development in Nit.

This framework is based on a list of `Actor`, in `app::actors`, which are drawn at each frame. Each actor is composed of a model and other information specific to this instance: position in the world, rotation and scaling. Each `Model` is either a composite of models or it is composed of a `Mesh` defining its geometry and a `Material` defining how to draw the model. `Material` can be subclassed to use custom shaders. These main classes are defined in the module `depth_core`.

_gamnit depth_ is built upon _app.nit_ and it works well with _gamnit flat_ (renamed from _gamnit simple_2d_). Clients are portable across GNU/Linux and Android, and _gamnit flat_ can still be used for UI elements.

This framework is far from complete at this point, however it designed for extensibility.

Here's a list of _gamnit depth_ implemented features and todo:

### Mesh
- [x] Create 3D simple meshes: cube, plane and UVSphere.
- [ ] Create simple debug meshes: axis arrows, etc.

### Material
- [x] Simple material with uniform ambient, diffuse and specular colors
- [x] Normals visualization materials
- [ ] Depth material
- [x] Texture material with ambient and diffuse lighting
- [ ] Texture material with specular lighting (implement Blinn Phong in GLSL, most attributes are already present)
- [ ] Texture material with normals mapping

### Models
- [x] Load models from .obj and .mtl files.
- [ ] Load models from a binary model format
- [x] Fallback on a simple material and mesh on load errors

### Sample programs
- [x] Sample minimal graphics-only application: model_viewer
- [ ] Merge the globe example with model_viewer
- [ ] Simple client game (like Asteronits for `gamnit::flat`)

### Other engine features
- [x] Composite pattern to manage simple models (single mesh to single material) and composite models
- [ ] Scene framework with a tree-like structure
- [ ] Particle emitters.
- [ ] Support for multiple light types and instances.
- [ ] Optimized GPU side caching with VBO.
- [ ] Optimized C side caching of models data.
- [ ] VR support (at least Cardboard)
- [ ] Hardware key services.
- [ ] Line-3D model collision (as in simple model selection from mouse click)

### Known bugs
- [ ] TexturedMaterial affects 2D sprites geometry, more data is needed to debug.

Pull-Request: #1920
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agocontrib: intro model viewer
Alexis Laferrière [Sat, 19 Dec 2015 23:44:39 +0000 (18:44 -0500)]
contrib: intro model viewer

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agocontrib/asteronits: fix path to project in metadata descriptions
Alexis Laferrière [Sun, 17 Jan 2016 16:33:25 +0000 (11:33 -0500)]
contrib/asteronits: fix path to project in metadata descriptions

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro gamnit depth
Alexis Laferrière [Wed, 13 Jan 2016 18:02:27 +0000 (13:02 -0500)]
lib/gamnit: intro gamnit depth

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro `EulerCamera::look_at`
Alexis Laferrière [Mon, 11 Jan 2016 14:11:18 +0000 (09:11 -0500)]
lib/gamnit: intro `EulerCamera::look_at`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit flat: set array_enabled settings at each frame
Alexis Laferrière [Sun, 17 Jan 2016 21:25:35 +0000 (16:25 -0500)]
lib/gamnit flat: set array_enabled settings at each frame

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit flat: extract `App::frame_core_draw`
Alexis Laferrière [Fri, 15 Jan 2016 04:59:27 +0000 (23:59 -0500)]
lib/gamnit flat: extract `App::frame_core_draw`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: rename simple_2d to flat
Alexis Laferrière [Thu, 14 Jan 2016 20:35:36 +0000 (15:35 -0500)]
lib/gamnit: rename simple_2d to flat

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: add support for map_Ka in the .mtl parser
Alexis Laferrière [Fri, 15 Jan 2016 21:25:50 +0000 (16:25 -0500)]
lib/gamnit: add support for map_Ka in the .mtl parser

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: move `Texture::checker` to its own class to fix loading
Alexis Laferrière [Sat, 16 Jan 2016 17:14:26 +0000 (12:14 -0500)]
lib/gamnit: move `Texture::checker` to its own class to fix loading

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: document `offset` methods
Alexis Laferrière [Sat, 16 Jan 2016 17:15:18 +0000 (12:15 -0500)]
lib/gamnit: document `offset` methods

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoimplemented htcpc server
itsWill [Mon, 28 Dec 2015 22:20:52 +0000 (23:20 +0100)]
implemented htcpc server

Signed-off-by: itsWill <guilhermerpmansur@gmail.com>

8 years agoMerge: Intro parsers to load 3D models from .obj and .mtl files
Jean Privat [Thu, 14 Jan 2016 20:47:48 +0000 (15:47 -0500)]
Merge: Intro parsers to load 3D models from .obj and .mtl files

Intro parsers to load 3D models from the ASCII based format of .obj and .mtl files. Also as support intro a new kind of asset, `app::TextAsset`, with lazy loading in the style of `Sound` and `Texture`.

Model parsing services will be used by the 3D API of gamnit to load 3D models generated by modeler tools like Blender.

The services in `gamnit::model_parsers` are independent of gamnit. However since they are game related, it is a nice package to classify them in. They still can be used by any other 3D graphics engine, as `gamnit::network` which is also independent but game oriented. This adds a small duplication in their representation because a model is stored differently once loaded in gamnit. But the format in gamnit is so low-level (only arrays of Float) that we need an intermediate representation to triangulate faces and stuff like that.

Services of `model_parser_base` may be moved to other modules in the future as needed. The services added to `StringProcessor`, may be useful to other parsers and thus it could be moved up to `parser_base`. `Vec3` and `Vec4` apply an API similar to `vec3 & vec4` of GLSL. I may move them up to gamnit or glesv2 and add more services to transform from and to points, colors and other float based data vectors.

Pull-Request: #1918
Reviewed-by: Alexandre Blondin Massé <alexandre.blondin.masse@gmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/mnit: rename `Asset` to `MnitAsset` to fix conflict with `app::Asset`
Alexis Laferrière [Tue, 12 Jan 2016 19:00:48 +0000 (14:00 -0500)]
lib/mnit: rename `Asset` to `MnitAsset` to fix conflict with `app::Asset`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro parsers for .obj and .mtl files
Alexis Laferrière [Tue, 12 Jan 2016 03:52:31 +0000 (22:52 -0500)]
lib/gamnit: intro parsers for .obj and .mtl files

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/gamnit: intro new services and refine `StringProcessor` to read model files
Alexis Laferrière [Sat, 19 Dec 2015 15:36:07 +0000 (10:36 -0500)]
lib/gamnit: intro new services and refine `StringProcessor` to read model files

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agoMerge: Extend is_numeric to support negative values and scientific notation
Jean Privat [Thu, 14 Jan 2016 14:34:00 +0000 (09:34 -0500)]
Merge: Extend is_numeric to support negative values and scientific notation

Pull-Request: #1917
Reviewed-by: Lucas Bajolet <r4pass@hotmail.com>
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agoMerge: nitcorn: skip the listening loop when running the tests
Jean Privat [Thu, 14 Jan 2016 14:33:58 +0000 (09:33 -0500)]
Merge: nitcorn: skip the listening loop when running the tests

Until now, each nitcorn example checked if it was being tested, and if so it would quit to not block jenkins. This PR moves this check in the nitcorn module so it is the default behavior.

This should help for #1915 and future nitcorn programs.

Pull-Request: #1916
Reviewed-by: Jean Privat <jean@pryen.org>

8 years agolib/parser_base: intro `StringProcessor::eof` and fix index error
Alexis Laferrière [Mon, 11 Jan 2016 19:49:11 +0000 (14:49 -0500)]
lib/parser_base: intro `StringProcessor::eof` and fix index error

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

8 years agolib/android: implement `TextAsset`
Alexis Laferrière [Wed, 30 Dec 2015 21:26:43 +0000 (16:26 -0500)]
lib/android: implement `TextAsset`

Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>