gamnit depth, a framework to create portable 3D games in Nit.

This framework is based on a list of Actor, in app::actors, which are drawn to the screen 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.

Assets

gamnit depth is built upon to portability framework app.nit which provides a simple system to package and use asset files. Every file in the assets/ folder at the root of a projet is packaged with the program at compilation for mobiles devices. These files can be loaded during execution using the many subclasses of Asset.

var my_texture = new Texture("textures/texture.png")
var my_sound = new Sound("sounds/my_sound.mp3")
var my_model = new Model("models/my_model.obj")
var my_text = new TextAsset("simple_text_file.txt")

In relation to gamnit flat

gamnit flat is a framework for 2D games based on simple sprites and two drawing contexts: UI and world.

The UI context works well with depth. It should be used to display simple 2D UI elements and to create menus with ease.

However, the world context is difficultly compatible with depth. Only the world_camera from the flat framework is used to display the world objects in the depth framework as well.

Examples

Take a look at the model_viewer project for a basic usage of the depth framework combined with the flat framework for the UI. Becaus of its simple goal, this projet has no game logic and only manipulates graphical objects. This projet is located in the contrib folder of the Nit repository.

All subgroups and modules

module cardboard

gamnit :: cardboard

Update the orientation of world_camera at each frame using the head position given by android::cardboard
module depth

gamnit :: depth

Framework for 3D games in Nit
module depth_core

gamnit :: depth_core

Base entities of the depth 3D game framework
module model_dimensions

gamnit :: model_dimensions

Dimensions related services for Model and Mesh
module more_lights

gamnit :: more_lights

More implementations of Light
module more_materials

gamnit :: more_materials

Various material implementations
module more_meshes

gamnit :: more_meshes

More simple geometric meshes
module more_models

gamnit :: more_models

Services to load models from the assets folder
module particles

gamnit :: particles

Particle effects
module selection

gamnit :: selection

Select Actor from a screen coordinate
module shadow

gamnit :: shadow

Shadow mapping using a depth texture
module stereoscopic_view

gamnit :: stereoscopic_view

Refine EulerCamera and App::frame_core_draw to get a stereoscopic view
module vr

gamnit :: vr

VR support for gamnit depth, for Android only
package_diagram gamnit\>depth\> depth android android gamnit\>depth\>->android gamnit\>flat\> flat gamnit\>depth\>->gamnit\>flat\> gamnit\>model_parsers\> model_parsers gamnit\>depth\>->gamnit\>model_parsers\> java java android->java app app android->app core core android->core mnit mnit android->mnit c c android->c gamnit gamnit android->gamnit json json android->json gamnit\>flat\>->app gamnit\>flat\>->gamnit parser_base parser_base gamnit\>model_parsers\>->parser_base ...java ... ...java->java ...app ... ...app->app ...core ... ...core->core ...mnit ... ...mnit->mnit ...c ... ...c->c ...gamnit ... ...gamnit->gamnit ...json ... ...json->json ...parser_base ... ...parser_base->parser_base

Ancestors

group app

app

app.nit, a framework for portable applications
group bundle

android > bundle

A mapping class of String to various value types used by the
group c

c

Structures and services for compatibility with the C language
group cocoa

cocoa

Cocoa API, the development layer of OS X
group codecs

core > codecs

Group module for all codec-related manipulations
group collection

core > collection

This module define several collection classes.
group core

core

Nit common library of core classes and methods
group curl

curl

Data transfer powered by the native curl library
group dom

dom

Easy XML DOM parser
group egl

egl

Interface between rendering APIs (OpenGL, OpenGL ES, etc.) and the native windowing system.
group gamnit

gamnit

Portable game and multimedia framework for Nit
group gen_nit

gen_nit

Support to generate and otherwise manipulate Nit code
group geometry

geometry

Basic geometry data structures and services.
group glesv2

glesv2

OpenGL graphics rendering library for embedded systems, version 2.0
group gtk

gtk

GTK+ widgets and services
group ios

ios

iOS support for app.nit
group java

java

Supporting services for the FFI with Java and to access Java libraries
group json

json

read and write JSON formatted text
group jvm

jvm

Java Virtual Machine invocation API and others services from the JNI C API
group linux

linux

Implementation of app.nit for the Linux platform
group matrix

matrix

Services for matrices of Float values
group meta

meta

Simple user-defined meta-level to manipulate types of instances as object.
group mnit

mnit

group more_collections

more_collections

Highly specific, but useful, collections-related classes.
group opts

opts

Management of options on the command line
group parser_base

parser_base

Simple base for hand-made parsers of all kinds
group performance_analysis

performance_analysis

Services to gather information on the performance of events by categories
group pipeline

pipeline

Pipelined filters and operations on iterators.
group poset

poset

Pre order sets and partial order set (ie hierarchies)
group pthreads

pthreads

POSIX Threads support
group realtime

realtime

Services to keep time of the wall clock time
group sdl2

sdl2

This is a low-level wrapper of the SDL 2.0 library (as sdl2) and SDL_image 2.0 (as sdl2::image).
group serialization

serialization

Abstract serialization services
group shared_preferences

android > shared_preferences

Services allowing to save and load datas to internal android device
group sqlite3

sqlite3

Services to manipulate a Sqlite3 database
group template

template

Basic template system
group text

core > text

All the classes and methods related to the manipulation of text entities
group ui

android > ui

Views and services to use the Android native user interface
group v3_4

gtk > v3_4

group xdg_basedir

xdg_basedir

Services for using the XDG Base Directory specification

Parents

group android

android

Android platform support and APIs
group flat

gamnit > flat

Simple API for 2D games, built around Sprite and App::update