172 Commits

Author SHA1 Message Date
dependabot[bot]
4c3c549f27 Bump nokogiri from 1.14.0.rc1 to 1.14.3
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.14.0.rc1 to 1.14.3.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.14.0.rc1...v1.14.3)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-04-20 21:15:06 +00:00
2da9edb6d0 Refactored to use CyberarmEngine::Window#delta_time instead of our reimplementing it, add WIP frame timing to Overlay using CyberarmEngine::Stats.frames data 2023-04-20 16:14:29 -05:00
8f2d7ff905 Moved shaders to cyberarm_engine, patched up settings menu, updated gems. 2023-01-08 17:29:31 -06:00
580c9d79ce Updated gems, fix issues caused by the removal of $window from cyberarm_engine 2022-07-16 06:59:47 -05:00
07c8dfa45b Merge pull request #11 from cyberarm/dependabot/bundler/nokogiri-1.13.6
Bump nokogiri from 1.13.4 to 1.13.6
2022-05-24 09:37:58 -05:00
dependabot[bot]
b69bdc8e46 Bump nokogiri from 1.13.4 to 1.13.6
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.4 to 1.13.6.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.4...v1.13.6)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-24 05:21:15 +00:00
3481de2498 Merge pull request #9 from cyberarm/dependabot/bundler/nokogiri-1.13.4
Bump nokogiri from 1.13.2 to 1.13.4
2022-04-12 08:06:00 -05:00
dependabot[bot]
7bcd973a88 Bump nokogiri from 1.13.2 to 1.13.4
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.2 to 1.13.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/v1.13.4/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.2...v1.13.4)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-12 10:23:14 +00:00
1d34cbb63d Merge pull request #8 from cyberarm/dependabot/bundler/nokogiri-1.13.2
Bump nokogiri from 1.11.6 to 1.13.2
2022-03-12 21:27:21 -06:00
dependabot[bot]
2df2df8488 Bump nokogiri from 1.11.6 to 1.13.2
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.6 to 1.13.2.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.6...v1.13.2)

---
updated-dependencies:
- dependency-name: nokogiri
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-26 06:56:08 +00:00
87bff4ab82 Extracted Console into CyberarmEngine 2021-06-26 13:10:54 +00:00
cf37b94d80 Initial music playlist implementation, added menu music 2021-06-17 23:54:46 +00:00
0fe1d85924 Added Window#input_hijack to allow objects to get exclusive access to button_down/up callbacks, improved Chat widget 2021-06-03 15:14:06 +00:00
ec2b32ff92 Added title screen sound, added sound when mousing over menu links, update "required" Ruby version to 3.0+ in README 2021-06-03 03:05:10 +00:00
3986b1b0af Tweak menus a bit, add proper single player menu, made back link have some margin from above links 2021-06-03 00:59:08 +00:00
58b2f8b890 Added vertical_/horizontal_margin/padding to Widgets, added HUD command to toggle HUD 2021-06-02 12:55:08 +00:00
5cb48233fb Removed vertices count from Window, use new CyberarmEngine::Renderer::OpenGLRenderer#vertices_count for debug stats 2021-05-30 14:09:32 +00:00
da54bf5c53 Replaced usages of Text shadow with properly named border, use new correct Text shadow for menu titles, use text border for a few more elements 2021-05-29 00:36:47 +00:00
3570a80d67 Added icons for settings menu, refreshed menus to unify layouts 2021-05-27 02:39:32 +00:00
51363d2e3d Changed HUD text to have solid black 'border' 2021-05-26 23:18:52 +00:00
a16e14b0e5 Merge pull request #6 from cyberarm/dependabot/bundler/nokogiri-1.11.4
Bump nokogiri from 1.11.1 to 1.11.4
2021-05-20 15:05:59 +00:00
dependabot[bot]
4ebc4772a1 Bump nokogiri from 1.11.1 to 1.11.4
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.11.1 to 1.11.4.
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.11.1...v1.11.4)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 15:00:13 +00:00
15ba3fb15b Fixed AssetViewer crashing when loading a scripted asset 2021-04-25 23:22:01 +00:00
c5e0f33f21 Addded some life to the Close state with some animations 2021-04-25 15:38:39 +00:00
d3fbf5dcf5 Breathe a little life into the Boot state 2021-04-25 14:57:03 +00:00
5b662f83cf Fixed g_buffer shader failing to compile 2021-04-24 20:09:21 +00:00
55bfe6ed79 Clean up window initialization a little bit, prevent window from being resizable if fullscreen: 'fixes' gosu believing that the window is smaller than it is 2021-04-19 19:11:01 +00:00
bd414cf765 Removed border from links 2021-03-29 08:52:08 -05:00
c848a11c12 WIP changes sync 2021-03-29 08:52:08 -05:00
5759055838 Added initial gamma correction 2021-03-29 08:14:29 -05:00
f04217ccc7 Fixed map editor state crashing 2020-12-14 16:04:12 -06:00
5ebcc56c33 Update README.md 2020-12-09 18:32:05 -06:00
8420ccd364 Unfreeze SoundManager caches 2020-12-02 17:40:51 -06:00
95bea199ed Ran rubocop autocorrect 2020-12-02 17:37:48 -06:00
aa30ff73d0 Rubocop autocorrect frozen string literal cop 2020-12-02 17:29:01 -06:00
791351f2f5 Replaced the Nobile font with Cantarell, added a BOLD_SANS_FONT constant 2020-12-02 17:25:48 -06:00
9aa5dc7174 Cleanup, moved Map lifecycle into Director, added renderer_info command 2020-12-02 11:38:10 -06:00
c7590366a6 Initial work on locales, more work on netcode 2020-12-01 13:02:22 -06:00
b9c30ade80 More work on networking code 2020-11-30 20:09:26 -06:00
ecbbc77ca7 Added rubocop config, more work on CyberarmEngine Netcode; basic sending and receiving of packets is now functional 2020-11-30 15:41:37 -06:00
85ec285263 Tweaked menus, stubbed multiplayer profile menu, updated readme 2020-11-28 09:36:39 -06:00
4c8e6c3d5f update settings menu, misc tweaks and fixes 2020-09-24 10:45:15 -05:00
9558370ab9 Updated excon gem, disabled netcode in Game to able game to be "playable" 2020-08-01 11:18:53 -05:00
e09bd06d24 BROKEN: Work on netcode refactor 2020-08-01 08:06:13 -05:00
87b4b8ef92 Update readme 2020-07-21 08:08:17 -05:00
2a36c58abe Stubbed files for simplified networking system 2020-07-20 21:36:56 -05:00
e69dd3402d Updated in-game screenshot 2020-07-20 19:56:07 -05:00
dd7a7ac602 Update README.md 2020-07-20 19:16:53 -05:00
985f7c331f Updated gems, added test.rake rakefile that includes default rake task 2020-07-20 19:06:30 -05:00
b6c64b4b6b Update ruby.yml 2020-07-20 19:00:14 -05:00
d91398b529 Update ruby.yml 2020-07-20 18:58:30 -05:00
f7945bf47d Create ruby.yml 2020-07-20 18:54:27 -05:00
d72e8ccbd0 Misc. 2020-07-19 09:42:55 -05:00
4ee97cca4b Use fonts everywhere, misc. tweaks 2020-07-18 21:33:33 -05:00
ce90284001 Storm Sync 2020-07-18 18:20:24 -05:00
1d7cd19b41 Added more hud widgets for showing squadmates and crosshair, added crosshair image and source svg, hackish fix to make renderer resize on windows size change, added CameraController camera control is back in 😂 2020-07-18 15:54:00 -05:00
f6e4a509fd Added fonts and tweaked hud, added chat history and score board hud widgets 2020-07-18 13:00:22 -05:00
b4a0a7a8bc Update README.md 2020-07-15 21:38:57 -05:00
65cfc1a124 Moved renderering system and model loading into CyberarmEngine, added island_test_map 2020-07-15 21:29:18 -05:00
9264ef6e58 Initial reimplementation of shader based lighting 2020-07-10 07:19:09 -05:00
635f4e3720 Updated MapEditor menu 2020-07-09 06:57:42 -05:00
5827f0b907 Added initial faction emblems 2020-07-08 11:22:22 -05:00
bac0311263 Added prototype multiplayer lobby 2020-05-16 08:11:34 -05:00
94c3dea7b9 Console now will resize when window is resized 2020-05-16 07:10:10 -05:00
fbdea30015 Patched bounding box renderer to work again- in immediate mode renderer, more work on lighting rework for modern renderer 2020-05-14 09:54:08 -05:00
dae950c72a Restructured deferred lighting/rendering 2020-05-12 15:19:05 -05:00
7c81dd93e3 Apply matrix to vertices parsed from collada models 2020-05-12 09:32:00 -05:00
fa2873bb8f Fixed model with texture and texture-less objects having texture-less objects renderer 'black' due to having hasTexture incorrectly set for shader 2020-05-11 23:05:34 -05:00
f72a8d4c35 Added support for renderering multiple textures per Model 2020-05-11 22:49:25 -05:00
d03c3ffcd8 Fixed Networking.milliseconds not returning milliseconds, fixed ReadBuffer not deleting processed buffers, misc. 2020-05-11 08:56:16 -05:00
644c1916b2 Packets can be sent/received now 2020-05-10 20:30:22 -05:00
a0f8ce4bfb Added default texture, refactored Texture to cache textures which have a file path 2020-05-10 17:57:46 -05:00
cf1e72225c More work on implementing networking 2020-05-10 11:05:16 -05:00
e94f2582f9 More fleshing out of networking 2020-05-09 09:56:03 -05:00
bae6a6a332 Removed async-websocket, more work on netcode 2020-05-08 21:42:14 -05:00
e3a2c9abe0 Added require_all method to replace explicitly requiring every source file, added SoundManager and sound effects, added sound for shield/health regen 2020-05-08 19:03:45 -05:00
bc695df4a1 Refactored ModelCache into a module, misc. fixes due to change. 2020-05-07 21:45:18 -05:00
bc480f9fae Fixed min opengl warning showing for opengl >3.3 2020-05-07 13:37:11 -05:00
d212691b71 tweaks to release.rake 2020-05-07 13:37:11 -05:00
95fc6272b8 tweaks to release.rake 2020-05-07 12:33:09 -05:00
d3603947cc Added semi-automatic game:release rake task 2020-05-07 11:46:54 -05:00
029d9b1951 Updated Gems 2020-05-07 08:31:11 -05:00
6520051938 Added Editor model 2020-05-06 21:33:17 -05:00
8d956131d1 Made 'use_shaders' debug option work 2020-05-06 21:32:55 -05:00
7f16efe0a4 Update README 2020-05-06 20:00:20 -05:00
c92ea9ec73 Added screenshots 2020-05-06 19:49:51 -05:00
c9ba1ab94a Fixed typo in Overlay 2020-05-06 12:53:55 -05:00
2000f601d8 Tweak SettingsMenu and AssetViewer MainMenu 2020-05-06 12:02:13 -05:00
a078645b94 Refreshed a few menus, stubbed Settings menu 2020-05-05 10:46:23 -05:00
c1eb02a106 Fixed game not launching when packaged 2020-05-04 11:56:26 -05:00
a3b4c6e651 Update Boot/Close to use Menu constants 2020-05-04 11:32:17 -05:00
fd3785cdcd Updated menus, added background to Tools 2020-05-04 11:13:51 -05:00
06fb2c0e43 Stub NetworkManager, remove pixel test image, added icon for releasy 2020-05-04 09:59:01 -05:00
d524c21332 Enable server to require i-mic-fps.rb without launching game, fixed missing update method from connection/server, update gemfile to add releasy and rake 2020-05-04 09:28:57 -05:00
85dd90b2f4 Added HUD widgets, make Boot and Close use button_up instead of button_down 2020-05-04 08:57:58 -05:00
1629cf4605 Added Close game state, tweaked Boot state 2020-05-04 07:34:24 -05:00
f3c3a1047f Tweaked Boot state transition effect 2020-05-03 23:39:52 -05:00
face4b092a Added boot screen, added logo 2020-05-03 23:25:33 -05:00
75185425b6 Stubbed out files for networking 2020-05-03 21:18:08 -05:00
bb21de2e2a Use a bullet symbol for Overlay spacer 2020-05-03 09:55:26 -05:00
c53d42166b Use glLineWidth for wireframe rendering, use LoadingState for MapEditor 2020-05-03 09:49:57 -05:00
c05009a000 Moved renderer stats to Overlay 2020-05-03 09:40:51 -05:00
9593d341bf Added overlay for future fps and stats display 2020-05-02 17:34:19 -05:00
27de5667be Initial work on map editor 2020-05-02 15:59:26 -05:00
bb8e210362 Added canvas_size_changed 'event' to Renderer and OpenGLRenderer 2020-03-25 13:27:00 -05:00
15e5d0a5e1 Framebuffer rendering on quad is now working! 😂 2020-03-25 13:06:40 -05:00
87ae77a9cb Updates 2020-03-25 10:11:56 -05:00
d293772690 Initial work on using framebuffer from GBuffer 2020-03-25 09:18:06 -05:00
9a195fbf68 Updated deps 2020-03-24 10:36:29 -05:00
d839811cfd Fixed reloading shader which failed to compile at start up but succeeded at runtime caused crash due to Model expecting access to attribute location of shader inputs 2020-03-24 10:32:32 -05:00
578c00673d Added command to reload shaders at runtime, added support for shared scripts to Manifest, lights are now loadable from MapParser, misc changes. 2020-03-24 09:51:20 -05:00
2ad1385fb4 Fixed NVIDIA renderering errors, use 'flat in/out int integerValue' instead of 'in/out float integerValue' 2020-03-23 18:45:25 -05:00
cb7b3d4883 Added static, maps, and data folders to build files, fixed crash for AssetViewer tool 2020-03-23 17:32:16 -05:00
87fcc3a05c Fixed lighting artifacts caused by untransformed normals, added 'Scene' for holding objects for rendering, added turn table models to menus using a scene, misc other changes. 2020-03-23 11:48:44 -05:00
18a62b81cc Added Texture object for handling creating and caching textures, stubbed ParticleEmitter 2020-03-23 08:05:40 -05:00
45021a92aa Bump version 2020-03-22 18:16:17 -05:00
3d86661921 Added notice on main menu if opengl version < 3.3 2020-03-22 18:13:41 -05:00
f32dbfabeb Set shader lights once per frame instead of per entity 2020-03-22 17:46:50 -05:00
0d1d7ff6bc Fixed modern opengl renderer not renderering model textures, framebuffer can be used without crashing, model uv coordinates are now in buffer, minor rendering optimization 2020-03-22 17:22:10 -05:00
35d6061198 Setup GBuffer for future deferred rendering 2020-03-22 14:56:22 -05:00
fd228aa0c0 Added extras menu, stubbed map editor, made asset viewer and map editor accessible from extras menu 2020-03-22 12:17:28 -05:00
d6802c8756 Enabled wireframes for shader renderer 2020-01-30 22:54:59 -06:00
99ae19c34d Fixed bug that prevented Asset Viewer from using shader, manifests are now sorted by name, fixed sponza test model manifest 2020-01-30 22:31:49 -06:00
1b6019419b Fixed cursor not showing up in Asset Viewer main menu, fixed Camera free move not having :turn_left/right implemented 2020-01-30 19:53:42 -06:00
eb1bfe204b Added Asset Viewer 2020-01-30 15:30:58 -06:00
dbf4edbb93 Collada parser mostly works for single object/material models 2020-01-30 13:36:42 -06:00
b8e53c7a88 Oriented tree properly 2020-01-30 13:35:29 -06:00
8b35bf037e Added evergreen_tree model, added work-in-progress collada parser, renamed ModelLoader to ModelCache 2020-01-30 11:25:31 -06:00
31f0fa141b Restructured Model loading to enable easier implementation of other parsers 2020-01-30 08:50:05 -06:00
4f1b490600 Use persistent hash for config 2020-01-29 18:18:46 -06:00
201ddabbcc Added game version footer on MainMenu 2020-01-28 23:52:55 -06:00
ea68748234 Renamed MapLoader to MapParser, added level select menu 2020-01-28 23:41:44 -06:00
c1b5e72d7d Added a proper cursor, game pause menu now has a transparent background (Game is drawn behind menu) 2020-01-28 23:17:25 -06:00
46cffa293e Added more menus; stub for settings, basic pause menu, fixes for multiple Game inits 2020-01-28 19:59:42 -06:00
c25df59819 Use new @include preprocessor added to CyberarmEngin::Shader 2020-01-28 10:48:47 -06:00
e7b84bd123 Removed redundant glError? from Map class and renamed CommonMethods#glError? to #gl_error?, added debug settings for disabling shaders and whether to exit on opengl error 2020-01-27 22:19:07 -06:00
75f94963b2 DISABLED collision detection and physics 2019-12-09 16:37:50 -06:00
59334132c8 Updated gemfile to require head version of cyberarm_engine 2019-12-09 16:17:05 -06:00
e4333a82b8 Fixed immediate mode lighting, improved-ish modern gl lighting 2019-12-09 11:48:54 -06:00
ff1d34deec Initital shader lighting support 2019-12-08 20:05:48 -06:00
af19166af2 Modern 'GL now renders properly, camera works as expected, added fallback to immediate mode if shader fails to compile. 2019-12-08 17:50:20 -06:00
e076ce8612 Stubbed out VBOs for model 2019-12-05 20:43:54 -06:00
6aeee41a71 Progress towards modern gl made 2019-12-05 17:23:02 -06:00
93a9e2215c Add character model 2019-11-06 08:39:13 -06:00
18595bdf7f Supplanted biped with character 2019-11-05 11:23:14 -06:00
2ae97aa993 Fixed progressbar jumping back due to needing to load additional assets detected in manifests 2019-09-30 09:14:35 -05:00
c1ec292570 Fixed power plant inverted normals, moved purchase terminal origin to back edge of model, fixed door texture 2019-09-28 13:55:45 -05:00
40d1105fb8 Moved collision/physics information into manifest, made real mouse cursor always invisible and use 'virtual' cursor when needed. 2019-09-28 13:29:21 -05:00
e038dcbe24 Extracted Crosshair and Demo from Game 2019-09-27 22:46:32 -05:00
4af7f21a51 Make PhysicsManager use Map#gravity, defined EARTH and MOON gravity's 2019-09-27 14:41:50 -05:00
f3d3ceebb8 Fixed crash when jumping 2019-09-27 14:33:35 -05:00
b091a489af Removed entity management from Game, refactored Map to MapLoader and added Map to manage world 2019-09-27 14:30:23 -05:00
1bfc6e6929 Initial work on Scripting sandbox, no longer Entity's responsibility. 2019-09-27 12:37:16 -05:00
0b40e042bf Make wavefront material parser use relative path for textures 2019-09-27 10:08:57 -05:00
819b3989de Update assets readme 2019-09-26 16:33:36 -05:00
b559c7c383 Add assets readme 2019-09-26 16:32:23 -05:00
8df05eda13 Added event handler for :entity_moved, added door script, various tweaks 2019-09-26 16:19:01 -05:00
f7936b38bc Ripped IMICFPS::Wavefront::Model to IMICFPS::Model, more refactoring needed. 2019-09-26 14:29:42 -05:00
f72008369d Updated PowerPlant and Alternate Tank models to be correctly orientated (x side to side, y back to front) 2019-09-26 12:23:02 -05:00
b6d7a6ebdb Implemented event system, Implemented initial bit of scripting system, Stubbed component system. Entities can now use the scripting system to place their 'decorations' 2019-09-26 12:13:08 -05:00
e41a2b6524 Cleanup i-mic-fps.rb a bit 2019-09-26 08:24:32 -05:00
eb7a7fc6d6 Added protype scripts for Alternate Tank and Power Plant, changed naming convention of assets to: package -> name instead of: package -> model 2019-09-25 22:01:03 -05:00
19f5a0cd9c Added Alternate Tank, go back to using glScalef for scaling models until shader based rendering is implemented, improved Map handling of scaling. 2019-09-25 20:59:19 -05:00
ecee086590 Exported door model, added CollisionManager#on_ground?(entity), made gravity work in PhyisicsManager if Entity has physics enabled, updated test map 2019-09-25 18:17:18 -05:00
954c6899be Made model/entity manifest a first class object 2019-09-25 11:52:19 -05:00
f41078b14b Fixed player unable to rotate 2019-09-25 10:57:37 -05:00
a2089c0ae1 Fixed demo feature crashing game 2019-09-25 10:50:50 -05:00
93522703f9 Fixed terrain and skydome not loading in LoadingState 2019-09-25 10:18:16 -05:00
ee844f256f Renamed objects/ to game_objects/ removed redundant entities, added Map loader and test map, made LoadingState use Map for entity asset loading. 2019-09-25 10:09:05 -05:00
42191729ae Added models for: Power Plant, Information Panel, Purchase Terminal, and Door. Updated War Factory model. added .svg files. misc. 2019-09-24 15:34:09 -05:00
06502abe3e Added Rakefile for windows build 2019-08-19 03:02:20 -05:00
9cc97fd6ec Added ocra to gemfile 2019-08-19 03:01:11 -05:00
251 changed files with 26568 additions and 22295 deletions

37
.github/workflows/ruby.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
name: Ruby
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Install Gosu dependencies
run: |
sudo apt-get update -y -qq
sudo apt-get install -y libsdl2-dev libgl1-mesa-dev libfontconfig1-dev libopenal-dev libsndfile1-dev libmpg123-dev cmake:
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake

5
.gitignore vendored
View File

@@ -1,2 +1,5 @@
*.dat
profile.*
profile.*
pkg/*
data/*
!data/.gitkeep

8
.rubocop.yml Normal file
View File

@@ -0,0 +1,8 @@
Style/StringLiterals:
EnforcedStyle: double_quotes
Metrics/MethodLength:
Max: 40
Style/EmptyMethod:
EnforcedStyle: expanded

16
Gemfile
View File

@@ -1,3 +1,15 @@
# frozen_string_literal: true
source "https://rubygems.org"
gem "opengl-bindings"
gem "cyberarm_engine"
gem "cyberarm_engine", git: "https://github.com/cyberarm/cyberarm_engine"
gem "i18n"
gem "nokogiri", ">= 1.11.0.rc1"
gem "opengl-bindings", require: "opengl"
gem "rake"
group(:packaging) do
gem "excon"
gem "ocra"
gem "releasy", github: "gosu/releasy"
gem "rubyzip"
end

View File

@@ -1,19 +1,57 @@
GIT
remote: https://github.com/cyberarm/cyberarm_engine
revision: 72037efc735089cf1ff4b56ec57eb793699b27c6
specs:
cyberarm_engine (0.23.0)
excon (~> 0.88)
gosu (~> 1.1)
gosu_more_drawables (~> 0.3)
GIT
remote: https://github.com/gosu/releasy.git
revision: e8a24c079c4930c6ddbab17fc444027ba41491ca
specs:
releasy (0.2.3)
bundler (>= 1.2.1)
cri (~> 2.1.0)
ocra (~> 1.3.0)
rake (>= 0.9.2.2)
GEM
remote: https://rubygems.org/
specs:
cyberarm_engine (0.10.2)
gosu (~> 0.14.0)
gosu (0.14.5)
gosu (0.14.5-x86-mingw32)
opengl-bindings (1.6.9)
concurrent-ruby (1.2.2)
cri (2.1.0)
excon (0.99.0)
gosu (1.4.5)
gosu_more_drawables (0.3.1)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
mini_portile2 (2.8.1)
nokogiri (1.14.3)
mini_portile2 (~> 2.8.0)
racc (~> 1.4)
ocra (1.3.11)
opengl-bindings (1.6.13)
racc (1.6.2)
rake (13.0.6)
rubyzip (2.3.2)
PLATFORMS
ruby
x86-mingw32
x64-mingw-ucrt
x64-mingw32
DEPENDENCIES
cyberarm_engine
cyberarm_engine!
excon
i18n
nokogiri (>= 1.11.0.rc1)
ocra
opengl-bindings
rake
releasy!
rubyzip
BUNDLED WITH
1.17.3
2.4.8

View File

@@ -1,14 +1,46 @@
![Ruby](https://github.com/cyberarm/i-mic-fps/workflows/Ruby/badge.svg)
![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/cyberarm/i-mic-fps?include_prereleases)
![GitHub repo size](https://img.shields.io/github/repo-size/cyberarm/i-mic-fps)
# I-MIC FPS
An endeavor to create a multiplayer first-person-shooter in pure Ruby; Using C extensions only for Rendering, Sound, and Input. ([Gosu](https://libgosu.org) and [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl/))
![logo](https://raw.githubusercontent.com/cyberarm/i-mic-fps/master/svg/logo.svg)
Creating a multiplayer first-person-shooter in pure Ruby; Using C extensions only for Rendering, Sound, and Input. ([Gosu](https://libgosu.org) and [opengl-bindings](https://github.com/vaiorabbit/ruby-opengl/))
![screenshot](https://raw.githubusercontent.com/cyberarm/i-mic-fps/master/screenshots/screenshot-game.png)
## Using
Requires a Ruby runtime that supports the gosu and opengl-bindings C-extensions (truffleruby 1.0.0-rc12 did not work when tested. Rubinus was not tested.)
Ruby 3.0+ interpeter with support for the Gosu game library C extension.
* Clone or download this repo
* `bundle install`
* `bundle exec ruby i-mic-fps.rb [options]`
### System Requirements
| Minimum | |
| :------ | ----------------------: |
| OS | Windows 10 or GNU/Linux |
| CPU | Intel Core i5-3320M |
| RAM | 512 MB |
| GPU | OpenGL 3.30 Capable |
| Storage | To Be Determined |
| Network | To Be Determined |
| Display | 1280x720 |
| Recommended | |
| :---------- | ----------------------------: |
| OS | Windows 10 or GNU/Linux |
| CPU | AMD Ryzen 5 3600 |
| RAM | 1 GB+ |
| GPU | AMD Radeon RX 5700 XT |
| Storage | To Be Determined (< 4 GB) |
| Network | Broadband Internet Connection |
| Display | 1920x1080 60Hz |
Note: Recommended CPU and GPU are those of the primary development system and are overkill at this point.
### Options
* `--native` - Launch in fullscreen using primary displays resolution
* `--profile` - Run ruby-prof profiler
* `--mesa-override` - (Linux) Force MESA to use OpenGL/GLSL version 3.30
* `--savedemo` - Record camera movement and key events to playback later *(alpha-quality feature)*
* `--playdemo` - Plays the previously recorded demo *(alpha-quality feature)*
* `--playdemo` - Plays the previously recorded demo *(alpha-quality feature)*

27
Rakefile Normal file
View File

@@ -0,0 +1,27 @@
# frozen_string_literal: true
require "json"
require "tmpdir"
require "fileutils"
require "zip"
require "excon"
require "releasy"
require "bundler/setup" # Releasy requires that your application uses bundler.
require_relative "lib/version"
Releasy::Project.new do
name IMICFPS::NAME
version IMICFPS::VERSION
executable "i-mic-fps.rb"
files ["lib/**/*.*", "assets/**/*.*", "blends/**/*.*", "shaders/**/*.*", "static/**/*.*", "maps/**/*.*", "data/**/*.*"]
exclude_encoding # Applications that don't use advanced encoding (e.g. Japanese characters) can save build size with this.
verbose
add_build :windows_folder do
icon "static/icon.ico"
executable_type :console # Assuming you don't want it to run with a console window.
add_package :exe # Windows self-extracting archive.
end
end

View File

@@ -1,34 +1,39 @@
require "gosu"
require_relative "lib/objects/text"
# frozen_string_literal: true
begin
require_relative "../cyberarm_engine/lib/cyberarm_engine"
rescue LoadError
require "cyberarm_engine"
end
class Window < Gosu::Window
def initialize
super(Gosu.screen_width, Gosu.screen_height, fullscreen: true)
$window = self
CyberarmEngine::Window.instance = self
@size = 50
@slope = 250
@color_step = 10
@base_color = Gosu::Color.rgb(255, 127, 0)
@title = Text.new("I-MIC FPS", color: Gosu::Color.rgb(255,127,0), size: 100, x: 0, y: 15, alignment: :center)
@singleplayer = Text.new("Singleplayer", color: Gosu::Color.rgb(0,127,127), size: 50, x: 0, y: 150, alignment: :center)
@title = CyberarmEngine::Text.new("I-MIC FPS", color: Gosu::Color.rgb(255, 127, 0), size: 100, x: 0, y: 15, alignment: :center)
@singleplayer = CyberarmEngine::Text.new("Singleplayer", color: Gosu::Color.rgb(0, 127, 127), size: 50, x: 0, y: 150, alignment: :center)
end
def draw
@background ||= Gosu.record(Gosu.screen_width, Gosu.screen_height) do
((Gosu.screen_height+@slope)/@size).times do |i|
((Gosu.screen_height + @slope) / @size).times do |i|
fill_quad(
0, i*@size,
0, @slope+(i*@size),
Gosu.screen_width/2, (-@slope)+(i*@size),
Gosu.screen_width/2, i*@size,
Gosu::Color.rgba(@base_color.red-i*@color_step, @base_color.green-i*@color_step, @base_color.blue-i*@color_step, 200)
0, i * @size,
0, @slope + (i * @size),
Gosu.screen_width / 2, (-@slope) + (i * @size),
Gosu.screen_width / 2, i * @size,
Gosu::Color.rgba(@base_color.red - i * @color_step, @base_color.green - i * @color_step, @base_color.blue - i * @color_step, 200)
)
fill_quad(
Gosu.screen_width, i*@size,
Gosu.screen_width, @slope+(i*@size),
Gosu.screen_width/2, (-@slope)+(i*@size),
Gosu.screen_width/2, i*@size,
Gosu::Color.rgba(@base_color.red-i*@color_step, @base_color.green-i*@color_step, @base_color.blue-i*@color_step, 200)
Gosu.screen_width, i * @size,
Gosu.screen_width, @slope + (i * @size),
Gosu.screen_width / 2, (-@slope) + (i * @size),
Gosu.screen_width / 2, i * @size,
Gosu::Color.rgba(@base_color.red - i * @color_step, @base_color.green - i * @color_step, @base_color.blue - i * @color_step, 200)
)
end
end
@@ -37,8 +42,8 @@ class Window < Gosu::Window
# Box
draw_rect(
Gosu.screen_width/4, 0,
Gosu.screen_width/2, Gosu.screen_height,
Gosu.screen_width / 4, 0,
Gosu.screen_width / 2, Gosu.screen_height,
Gosu::Color.rgba(100, 100, 100, 150)
# Gosu::Color.rgba(@base_color.red+@color_step, @base_color.green+@color_step, @base_color.blue+@color_step, 200)
)
@@ -50,21 +55,21 @@ class Window < Gosu::Window
# Cursor
fill_quad(
mouse_x, mouse_y,
mouse_x+16, mouse_y+16,
mouse_x, mouse_y+16,
mouse_x, mouse_y+16,
mouse_x + 16, mouse_y + 16,
mouse_x, mouse_y + 16,
mouse_x, mouse_y + 16,
Gosu::Color::RED, Float::INFINITY
)
end
def fill_quad(x1, y1, x2, y2, x3, y3, x4, y4, color = Gosu::Color::WHITE, z = 0, mode = :default)
draw_quad(
x1,y1, color,
x2,y2, color,
x3,y3, color,
x4,y4, color,
x1, y1, color,
x2, y2, color,
x3, y3, color,
x4, y4, color,
z, mode
)
)
end
def button_up(id)
@@ -76,4 +81,4 @@ class Window < Gosu::Window
end
end
Window.new.show
Window.new.show

35
assets/README.md Normal file
View File

@@ -0,0 +1,35 @@
# IMIC FPS Assets
## Directory Structure
* /__package__
* /__name__
* /model
* model.obj
* /scripts
* script.rb
* /textures
* texture.png
* manifest.yaml
## Manifest File
```yaml
name: "Friendly Name of Object"
model: "model.obj" # path to model relative to package/name/model/
# optional options:
# Type of collision detection to use: null, boundingbox, orientated_bb, mesh
collision: "mesh"
# Path to collision model or null to use `model`
collision_mesh: null
# Array of scripts to load, relative to package/name/scripts/
# Optionally shared scripts can be loaded from package/shared/scripts/ if prefixed with an exclaimation mark "!"
scripts: [
"script",
"!shared_script"
]
# Array of assets to preload that this asset uses/requires
uses: [
-
package: "base"
name: "door"
]
```

View File

@@ -0,0 +1,5 @@
name: "Alternate Tank"
model: "alternate_tank.obj"
scripts: [
"!vehicle"
]

View File

@@ -0,0 +1,42 @@
# Blender MTL File: 'alternate_tank.blend'
# Material Count: 4
newmtl Body
Ns 110.250015
Ka 0.900000 0.900000 0.900000
Kd 0.029064 0.018578 0.011797
Ks 0.883333 0.883333 0.883333
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 3
newmtl Material
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.527719 0.213857 0.101860
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.001
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.029064 0.018578 0.011797
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl wheel
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.044455 0.044455 0.044455
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2

File diff suppressed because it is too large Load Diff

View File

@@ -1,2 +1,6 @@
name: "biped"
model: "biped.obj"
model: "biped.obj"
collision: "mesh"
collision_mesh: null
collision_resolution: "dynamic"
physics: true

View File

@@ -0,0 +1,6 @@
name: "character"
model: "character.obj"
collision: "mesh"
collision_mesh: null
collision_resolution: "dynamic"
physics: true

View File

@@ -0,0 +1,13 @@
# Blender MTL File: 'character.blend'
# Material Count: 1
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
map_Kd /home/cyberarm/Code/i-mic-fps/assets/base/character/textures/Base.png

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 223 KiB

View File

@@ -0,0 +1,7 @@
---
name: "door"
model: "door.obj"
collision: "boundingbox"
scripts: [
"door"
]

View File

@@ -0,0 +1,13 @@
# Blender MTL File: 'door.blend'
# Material Count: 1
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
map_Kd /home/cyberarm/Code/i-mic-fps/assets/base/door/textures/door.png

View File

@@ -0,0 +1,55 @@
# Blender v2.80 (sub 75) OBJ File: 'door.blend'
# www.blender.org
mtllib door.mtl
o Cube
v 1.250000 2.400000 -0.125000
v 1.250000 0.000000 -0.125000
v 1.250000 2.400000 0.125000
v 1.250000 0.000000 0.125000
v 0.000000 0.000000 -0.125000
v 0.000000 2.400000 0.125000
v 0.000000 0.000000 0.125000
v 0.000000 2.400000 -0.125000
vt 0.923077 0.000000
vt 1.000000 0.500000
vt 0.923077 0.500000
vt 0.923077 0.960000
vt 0.846154 0.000000
vt 0.000000 0.959961
vt 0.384766 -0.000000
vt 0.000000 0.000000
vt 0.384615 0.960000
vt 0.000000 0.000000
vt 0.384615 0.000000
vt 1.000000 1.000000
vt 0.923077 0.500000
vt 1.000000 0.500000
vt 0.769231 0.960000
vt 0.846154 0.000000
vt 0.846154 0.960000
vt 1.000000 0.000000
vt 0.846154 0.960000
vt 0.384766 0.959961
vt 0.000000 0.960000
vt 0.923077 1.000000
vt 0.769231 0.000000
vn 0.0000 -1.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn -1.0000 0.0000 0.0000
usemtl Material
s off
f 2/1/1 7/2/1 5/3/1
f 1/4/2 4/5/2 2/1/2
f 8/6/3 2/7/3 5/8/3
f 3/9/4 7/10/4 4/11/4
f 8/12/5 3/13/5 1/14/5
f 7/15/6 8/16/6 5/17/6
f 2/1/1 4/18/1 7/2/1
f 1/4/2 3/19/2 4/5/2
f 8/6/3 1/20/3 2/7/3
f 3/9/4 6/21/4 7/10/4
f 8/12/5 6/22/5 3/13/5
f 7/15/6 6/23/6 8/16/6

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
origin = entity.position
on.entity_moved do |event|
entity.position = if origin.distance3d(event.entity.position) <= 3.0
origin + Vector.up * 2.4
else
origin
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

View File

@@ -0,0 +1,3 @@
name: "editor"
model: "editor.obj"
collision: "mesh"

View File

@@ -0,0 +1,32 @@
# Blender MTL File: 'editor.blend'
# Material Count: 3
newmtl body
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.011935 0.113782 0.401969
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl energy
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.653036 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl eye
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.710554 0.177754 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,4 @@
---
name: "evergreen_tree"
model: "evergreen_tree.dae"
collision: "boundingbox"

View File

@@ -0,0 +1,303 @@
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<asset>
<contributor>
<author>Blender User</author>
<authoring_tool>Blender 2.81.16 commit date:2019-12-04, commit time:11:32, hash:f1aa4d18d49d</authoring_tool>
</contributor>
<created>2020-01-30T13:33:36</created>
<modified>2020-01-30T13:33:36</modified>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_effects>
<effect id="Material_002-effect">
<profile_COMMON>
<technique sid="common">
<lambert>
<emission>
<color sid="emission">0 0 0 1</color>
</emission>
<diffuse>
<color sid="diffuse">0 0.4868966 0.07537682 1</color>
</diffuse>
<index_of_refraction>
<float sid="ior">1.45</float>
</index_of_refraction>
</lambert>
</technique>
</profile_COMMON>
</effect>
<effect id="Material_003-effect">
<profile_COMMON>
<technique sid="common">
<lambert>
<emission>
<color sid="emission">0 0 0 1</color>
</emission>
<diffuse>
<color sid="diffuse">0 0.5173332 0.03164556 1</color>
</diffuse>
<index_of_refraction>
<float sid="ior">1.45</float>
</index_of_refraction>
</lambert>
</technique>
</profile_COMMON>
</effect>
<effect id="Material_001-effect">
<profile_COMMON>
<technique sid="common">
<lambert>
<emission>
<color sid="emission">0 0 0 1</color>
</emission>
<diffuse>
<color sid="diffuse">0.3031975 0.1076129 0.05296437 1</color>
</diffuse>
<index_of_refraction>
<float sid="ior">1.45</float>
</index_of_refraction>
</lambert>
</technique>
</profile_COMMON>
</effect>
</library_effects>
<library_images/>
<library_materials>
<material id="Material_002-material" name="Material.002">
<instance_effect url="#Material_002-effect"/>
</material>
<material id="Material_003-material" name="Material.003">
<instance_effect url="#Material_003-effect"/>
</material>
<material id="Material_001-material" name="Material.001">
<instance_effect url="#Material_001-effect"/>
</material>
</library_materials>
<library_geometries>
<geometry id="Plane_002-mesh" name="Plane.002">
<mesh>
<source id="Plane_002-mesh-positions">
<float_array id="Plane_002-mesh-positions-array" count="15">-0.7701593 0 0.7701593 0.7701593 0 0.7701593 -0.7701593 0 -0.7701593 0.7701593 0 -0.7701593 0 0.6063125 0</float_array>
<technique_common>
<accessor source="#Plane_002-mesh-positions-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane_002-mesh-normals">
<float_array id="Plane_002-mesh-normals-array" count="15">0 -1 0 0 0.7857296 0.6185703 0.6185703 0.7857295 0 -0.6185703 0.7857295 0 0 0.7857296 -0.6185703</float_array>
<technique_common>
<accessor source="#Plane_002-mesh-normals-array" count="5" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane_002-mesh-map-0">
<float_array id="Plane_002-mesh-map-0-array" count="36">0 1 1 0 0 0 0 0 1 0 0 0 1 0 1 1 1 0 0 1 0 0 0 1 1 1 0 1 1 1 0 1 1 1 1 0</float_array>
<technique_common>
<accessor source="#Plane_002-mesh-map-0-array" count="18" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane_002-mesh-vertices">
<input semantic="POSITION" source="#Plane_002-mesh-positions"/>
</vertices>
<triangles material="Material_002-material" count="6">
<input semantic="VERTEX" source="#Plane_002-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane_002-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Plane_002-mesh-map-0" offset="2" set="0"/>
<p>2 0 0 1 0 1 0 0 2 0 1 3 1 1 4 4 1 5 1 2 6 3 2 7 4 2 8 2 3 9 0 3 10 4 3 11 3 4 12 2 4 13 4 4 14 2 0 15 3 0 16 1 0 17</p>
</triangles>
</mesh>
</geometry>
<geometry id="Plane_001-mesh" name="Plane.001">
<mesh>
<source id="Plane_001-mesh-positions">
<float_array id="Plane_001-mesh-positions-array" count="24">-1 0 1 1 0 1 -1 0 -1 1 0 -1 -0.4597772 0.5360521 0.4597772 0.4597772 0.5360521 0.4597772 -0.4597772 0.5360521 -0.4597772 0.4597772 0.5360521 -0.4597772</float_array>
<technique_common>
<accessor source="#Plane_001-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane_001-mesh-normals">
<float_array id="Plane_001-mesh-normals-array" count="30">0 -1 0 0 1 0 0 0.7098416 0.7043614 0.7043614 0.7098416 0 -0.7043614 0.7098416 0 0 0.7098416 -0.7043614 0 0.7098415 0.7043614 0.7043614 0.7098416 0 -0.7043614 0.7098416 0 0 0.7098415 -0.7043614</float_array>
<technique_common>
<accessor source="#Plane_001-mesh-normals-array" count="10" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane_001-mesh-map-0">
<float_array id="Plane_001-mesh-map-0-array" count="72">0 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 1</float_array>
<technique_common>
<accessor source="#Plane_001-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane_001-mesh-vertices">
<input semantic="POSITION" source="#Plane_001-mesh-positions"/>
</vertices>
<triangles material="Material_003-material" count="12">
<input semantic="VERTEX" source="#Plane_001-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane_001-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Plane_001-mesh-map-0" offset="2" set="0"/>
<p>2 0 0 1 0 1 0 0 2 5 1 3 6 1 4 4 1 5 1 2 6 4 2 7 0 2 8 3 3 9 5 3 10 1 3 11 0 4 12 6 4 13 2 4 14 2 5 15 7 5 16 3 5 17 2 0 18 3 0 19 1 0 20 5 1 21 7 1 22 6 1 23 1 6 24 5 6 25 4 6 26 3 7 27 7 7 28 5 7 29 0 8 30 4 8 31 6 8 32 2 9 33 6 9 34 7 9 35</p>
</triangles>
</mesh>
</geometry>
<geometry id="Plane-mesh" name="Plane">
<mesh>
<source id="Plane-mesh-positions">
<float_array id="Plane-mesh-positions-array" count="24">-1.366034 0 1.366034 1.366034 0 1.366034 -1.366034 0 -1.366034 1.366034 0 -1.366034 -0.7 0.5 0.7 0.7 0.5 0.7 -0.7 0.5 -0.7 0.7 0.5 -0.7</float_array>
<technique_common>
<accessor source="#Plane-mesh-positions-array" count="8" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane-mesh-normals">
<float_array id="Plane-mesh-normals-array" count="30">0 -1 0 0 1 0 0 0.7997263 0.6003649 0.6003648 0.7997263 0 -0.6003648 0.7997263 0 0 0.7997263 -0.6003649 0 0.7997263 0.6003648 0.6003648 0.7997263 0 -0.6003648 0.7997263 0 0 0.7997263 -0.6003648</float_array>
<technique_common>
<accessor source="#Plane-mesh-normals-array" count="10" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane-mesh-map-0">
<float_array id="Plane-mesh-map-0-array" count="72">0 1 1 0 0 0 1 0 0 1 0 0 1 0 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 0 1 1 1 1 0 1 0 1 1 0 1 1 0 1 0 0 0 1 1 1 1 1 0 0 0 0 0 0 1 0 1 0 1 1 1</float_array>
<technique_common>
<accessor source="#Plane-mesh-map-0-array" count="36" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane-mesh-vertices">
<input semantic="POSITION" source="#Plane-mesh-positions"/>
</vertices>
<triangles material="Material_002-material" count="12">
<input semantic="VERTEX" source="#Plane-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Plane-mesh-map-0" offset="2" set="0"/>
<p>2 0 0 1 0 1 0 0 2 5 1 3 6 1 4 4 1 5 1 2 6 4 2 7 0 2 8 3 3 9 5 3 10 1 3 11 0 4 12 6 4 13 2 4 14 2 5 15 7 5 16 3 5 17 2 0 18 3 0 19 1 0 20 5 1 21 7 1 22 6 1 23 1 6 24 5 6 25 4 6 26 3 7 27 7 7 28 5 7 29 0 8 30 4 8 31 6 8 32 2 9 33 6 9 34 7 9 35</p>
</triangles>
</mesh>
</geometry>
<geometry id="Circle-mesh" name="Circle">
<mesh>
<source id="Circle-mesh-positions">
<float_array id="Circle-mesh-positions-array" count="75">0 0 -0.5 -0.4755282 0 -0.1545085 -0.2938926 0 0.4045085 0.2938927 0 0.4045085 0.4755282 0 -0.1545085 0 2 -0.4 -0.3804226 2 -0.1236068 -0.235114 2 0.3236068 0.2351141 2 0.3236068 0.3804226 2 -0.1236068 3.64108e-7 4.3 -0.42 -0.3043377 4.3 -0.1988854 -0.1880909 4.3 0.1588854 0.1880916 4.3 0.1588854 0.3043384 4.3 -0.1988855 -8.83978e-7 6 -0.156 -0.2434713 6 0.0208916 -0.1504738 6 0.3071084 0.1504722 6 0.3071084 0.2434695 6 0.02089154 -1.64407e-6 7 -0.02799999 -0.1217368 7 0.06044578 -0.0752381 7 0.2035542 0.07523488 7 0.2035542 0.1217336 7 0.06044578</float_array>
<technique_common>
<accessor source="#Circle-mesh-positions-array" count="25" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Circle-mesh-normals">
<float_array id="Circle-mesh-normals-array" count="129">0 -1 0 0.5877706 -0.007034838 -0.8089972 -0.587305 0.04041773 -0.8083561 0.9502794 0.04041779 0.3087643 -0.9502794 0.04041779 0.3087645 0.5873049 0.04041779 -0.808356 0 0.04041779 0.9991829 0.95104 -0.005896985 0.3090115 0 0.07143497 0.9974453 -0.5877708 -0.007034659 -0.808997 0.9502357 0.04153919 0.3087501 -0.9502357 0.04153949 0.3087502 0.5846588 0.1030038 -0.8047139 -0.9510399 -0.005898416 0.3090118 0.5832006 0.124656 -0.8027067 0 -0.08686035 0.9962205 -0.5832004 0.1246552 -0.8027069 0 1 0 0 0.1030034 0.994681 -0.5846592 0.1030029 -0.8047137 0.9459978 0.1030041 0.3073732 -0.945998 0.1030026 0.3073735 0.5877708 -0.007034838 -0.808997 -0.587305 0.04041779 -0.808356 0.9502794 0.04041779 0.3087643 -0.9502794 0.04041779 0.3087646 0.587305 0.04041779 -0.808356 0 0.04041779 0.9991829 0.9510402 -0.005896985 0.3090113 0 0.07143497 0.9974453 -0.5877707 -0.007034659 -0.808997 0.9502358 0.04153919 0.3087501 -0.9502357 0.04153949 0.3087503 0.5846586 0.1030038 -0.804714 -0.9510401 -0.005898416 0.3090116 0.5832004 0.124656 -0.8027068 0 -0.08686041 0.9962205 -0.5832005 0.1246553 -0.802707 -1.10718e-5 1 0 0 0.1030033 0.994681 -0.5846592 0.1030029 -0.8047137 0.9459979 0.1030041 0.3073732 -0.9459978 0.1030027 0.3073736</float_array>
<technique_common>
<accessor source="#Circle-mesh-normals-array" count="43" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Circle-mesh-map-0">
<float_array id="Circle-mesh-map-0-array" count="276">0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0</float_array>
<technique_common>
<accessor source="#Circle-mesh-map-0-array" count="138" stride="2">
<param name="S" type="float"/>
<param name="T" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Circle-mesh-vertices">
<input semantic="POSITION" source="#Circle-mesh-positions"/>
</vertices>
<triangles material="Material_001-material" count="46">
<input semantic="VERTEX" source="#Circle-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Circle-mesh-normals" offset="1"/>
<input semantic="TEXCOORD" source="#Circle-mesh-map-0" offset="2" set="0"/>
<p>4 0 0 3 0 1 2 0 2 5 1 3 14 1 4 9 1 5 1 2 6 5 2 7 0 2 8 4 3 9 8 3 10 3 3 11 2 4 12 6 4 13 1 4 14 0 5 15 9 5 16 4 5 17 3 6 18 7 6 19 2 6 20 13 7 21 19 7 22 18 7 23 8 8 24 12 8 25 7 8 26 5 9 27 11 9 28 10 9 29 9 10 30 13 10 31 8 10 32 6 11 33 12 11 34 11 11 35 15 12 36 24 12 37 19 12 38 12 13 39 16 13 40 11 13 41 14 14 42 15 14 43 19 14 44 12 15 45 18 15 46 17 15 47 11 16 48 15 16 49 10 16 50 22 17 51 24 17 52 20 17 53 17 18 54 23 18 55 22 18 56 16 19 57 20 19 58 15 19 59 18 20 60 24 20 61 23 20 62 16 21 63 22 21 64 21 21 65 2 0 66 1 0 67 0 0 68 0 0 69 4 0 70 2 0 71 5 22 72 10 22 73 14 22 74 1 23 75 6 23 76 5 23 77 4 24 78 9 24 79 8 24 80 2 25 81 7 25 82 6 25 83 0 26 84 5 26 85 9 26 86 3 27 87 8 27 88 7 27 89 13 28 90 14 28 91 19 28 92 8 29 93 13 29 94 12 29 95 5 30 96 6 30 97 11 30 98 9 31 99 14 31 100 13 31 101 6 32 102 7 32 103 12 32 104 15 33 105 20 33 106 24 33 107 12 34 108 17 34 109 16 34 110 14 35 111 10 35 112 15 35 113 12 36 114 13 36 115 18 36 116 11 37 117 16 37 118 15 37 119 20 38 120 21 38 121 22 38 122 22 17 123 23 17 124 24 17 125 17 39 126 18 39 127 23 39 128 16 40 129 21 40 130 20 40 131 18 41 132 19 41 133 24 41 134 16 42 135 17 42 136 22 42 137</p>
</triangles>
</mesh>
</geometry>
</library_geometries>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node id="Plane_002" name="Plane.002" type="NODE">
<matrix sid="transform">1.326094 0 -0.4826588 0 0 3.66912 0 5.393049 0.4826588 0 1.326094 0 0 0 0 1</matrix>
<instance_geometry url="#Plane_002-mesh" name="Plane.002">
<bind_material>
<technique_common>
<instance_material symbol="Material_002-material" target="#Material_002-material">
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="Plane_001" name="Plane.001" type="NODE">
<matrix sid="transform">1.544178 0 -0.2722803 0 0 4.0768 0 3.677205 0.2722803 0 1.544178 0 0 0 0 1</matrix>
<instance_geometry url="#Plane_001-mesh" name="Plane.001">
<bind_material>
<technique_common>
<instance_material symbol="Material_003-material" target="#Material_003-material">
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="Plane" name="Plane" type="NODE">
<matrix sid="transform">1.6 0 0 0 0 4.16 0 2 0 0 1.6 0 0 0 0 1</matrix>
<instance_geometry url="#Plane-mesh" name="Plane">
<bind_material>
<technique_common>
<instance_material symbol="Material_002-material" target="#Material_002-material">
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
<node id="Circle" name="Circle" type="NODE">
<matrix sid="transform">1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1</matrix>
<instance_geometry url="#Circle-mesh" name="Circle">
<bind_material>
<technique_common>
<instance_material symbol="Material_001-material" target="#Material_001-material">
<bind_vertex_input semantic="UVMap" input_semantic="TEXCOORD" input_set="0"/>
</instance_material>
</technique_common>
</bind_material>
</instance_geometry>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>

View File

@@ -0,0 +1,4 @@
name: "information_panel"
model: "information_panel.obj"
collision: "mesh"
collision_mesh: null

View File

@@ -0,0 +1,32 @@
# Blender MTL File: 'information_panel.blend'
# Material Count: 3
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.310814 0.310814 0.310814
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.001
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.581504 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.002
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.496923 0.455629 0.203897
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2

View File

@@ -0,0 +1,266 @@
# Blender v2.80 (sub 75) OBJ File: 'information_panel.blend'
# www.blender.org
mtllib information_panel.mtl
o Cube
v 0.892570 1.235657 -0.268793
v 0.900000 1.077635 -0.301229
v 0.900000 1.054090 0.375000
v 0.900000 0.875000 0.375000
v -0.907430 1.235657 -0.268793
v -0.900000 1.077635 -0.301229
v -1.000000 1.125000 0.375000
v -1.000000 0.875000 0.375000
v -0.900000 1.054090 0.375000
v -0.900000 0.875000 0.375000
v 0.970903 1.084925 0.196072
v 1.000000 0.898673 0.200000
v -0.970903 1.084925 0.196072
v -1.000000 0.898673 0.200000
v 1.000000 0.975000 -0.137500
v 0.970903 1.237112 0.019890
v -0.970903 1.237112 0.019890
v -1.000000 0.975000 -0.137500
v 1.000000 1.240505 0.015962
v 1.000000 1.081532 0.200000
v -1.000000 1.240505 0.015962
v -1.000000 1.081532 0.200000
v 0.970903 1.230140 0.013868
v 0.970903 1.077953 0.190049
v -0.970903 1.230140 0.013868
v -0.970903 1.077953 0.190049
vt 0.625000 0.250000
vt 0.375000 0.375000
vt 0.375000 0.250000
vt 0.625000 0.875000
vt 0.500000 1.000000
vt 0.437500 0.875000
vt 0.125000 0.625000
vt 0.375000 0.750000
vt 0.125000 0.750000
vt 0.625000 0.500000
vt 0.875000 0.750000
vt 0.625000 0.750000
vt 0.625000 0.375000
vt 0.625000 0.187500
vt 0.406250 0.812500
vt 0.625000 0.093750
vt 0.125000 0.562500
vt 0.375000 0.625000
vt 0.625000 0.812500
vt 0.377823 0.123666
vt 0.560344 0.123666
vt 0.560344 0.123666
vt 0.375000 0.750000
vt 0.125000 0.500000
vt 0.375000 0.562500
vt 0.625000 0.000000
vt 0.375000 0.125000
vt 0.378087 0.063834
vt 0.593750 0.062500
vt 0.589996 0.063834
vt 0.378087 0.063834
vt 0.377823 0.123666
vt 0.589996 0.063834
vt 0.625000 1.000000
vt 0.875000 0.500000
vt 0.375000 0.500000
vt 0.562500 0.125000
vt 0.375000 0.062500
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.500000 0.250000
vn 0.0000 0.0000 1.0000
vn 0.0000 -0.9910 -0.1341
vn 0.8682 0.0000 0.4961
vn 0.0000 0.2011 -0.9796
vn -0.8682 0.0000 0.4961
vn -1.0000 0.0000 0.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 -0.9754 -0.2206
vn 0.0000 0.6537 -0.7568
vn 0.0000 -0.8473 -0.5311
vn 0.8880 0.2301 -0.3981
vn -0.9507 0.0188 -0.3094
vn 0.0000 0.7568 0.6537
vn 0.0000 -0.6537 0.7568
vn 0.9287 0.1160 -0.3523
vn -0.8880 0.2301 -0.3981
vn 0.0000 0.9879 0.1549
vn 0.0000 0.9999 -0.0170
usemtl Material
s off
f 3/1/1 10/2/1 4/3/1
f 12/4/2 10/5/2 14/6/2
f 12/7/3 3/8/3 4/9/3
f 6/10/4 1/11/4 2/12/4
f 14/6/5 9/13/5 22/14/5
f 18/15/6 22/14/6 21/16/6
f 15/17/7 20/18/7 12/7/7
f 15/19/8 14/6/8 18/15/8
f 11/20/9 26/21/9 13/22/9
f 2/12/10 18/15/10 6/23/10
f 2/24/11 19/25/11 15/17/11
f 6/23/12 21/16/12 5/26/12
f 13/22/13 20/27/13 11/20/13
f 16/28/13 21/29/13 17/30/13
f 11/20/6 23/31/6 24/32/6
f 17/30/14 23/31/14 16/28/14
f 13/22/7 25/33/7 17/30/7
f 3/1/1 9/13/1 10/2/1
f 12/4/2 4/34/2 10/5/2
f 12/7/3 20/18/3 3/8/3
f 6/10/4 5/35/4 1/11/4
f 14/6/5 10/5/5 9/13/5
f 18/15/6 14/6/6 22/14/6
f 15/17/7 19/25/7 20/18/7
f 15/19/8 12/4/8 14/6/8
f 11/20/9 24/32/9 26/21/9
f 2/12/10 15/19/10 18/15/10
f 2/24/15 1/36/15 19/25/15
f 6/23/16 18/15/16 21/16/16
f 13/22/13 22/37/13 20/27/13
f 16/28/13 19/38/13 21/29/13
f 11/20/6 16/28/6 23/31/6
f 17/30/14 25/33/14 23/31/14
f 13/22/7 26/21/7 25/33/7
usemtl Material.001
f 25/33/13 24/32/13 23/31/13
f 25/33/13 26/21/13 24/32/13
usemtl Material.002
f 22/37/17 3/39/17 20/27/17
f 1/40/18 21/29/18 19/38/18
f 16/28/13 20/27/13 19/38/13
f 17/30/13 22/37/13 13/22/13
f 22/37/17 9/41/17 3/39/17
f 1/40/18 5/26/18 21/29/18
f 16/28/13 11/20/13 20/27/13
f 17/30/13 21/29/13 22/37/13
o Cube.001_Cube.002
v -0.030000 0.000000 -0.170000
v -0.030000 1.062657 -0.170000
v -0.030000 0.000000 -0.230000
v -0.030000 1.062657 -0.230000
v 0.030000 0.000000 -0.170000
v 0.030000 1.062657 -0.170000
v 0.030000 0.000000 -0.230000
v 0.030000 1.062657 -0.230000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.375000 1.000000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.875000 0.500000
vt 0.625000 1.000000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material
s off
f 28/42/19 29/43/19 27/44/19
f 30/45/20 33/46/20 29/43/20
f 34/47/21 31/48/21 33/46/21
f 32/49/22 27/50/22 31/48/22
f 33/46/23 27/51/23 29/52/23
f 30/53/24 32/49/24 34/47/24
f 28/42/19 30/45/19 29/43/19
f 30/45/20 34/47/20 33/46/20
f 34/47/21 32/49/21 31/48/21
f 32/49/22 28/54/22 27/50/22
f 33/46/23 31/48/23 27/51/23
f 30/53/24 28/55/24 32/49/24
o Cube.002
v -0.930000 -0.000000 0.230000
v -0.930000 1.062657 0.230000
v -0.930000 -0.000000 0.170000
v -0.930000 1.062657 0.170000
v -0.870000 -0.000000 0.230000
v -0.870000 1.062657 0.230000
v -0.870000 -0.000000 0.170000
v -0.870000 1.062657 0.170000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.375000 1.000000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.875000 0.500000
vt 0.625000 1.000000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material
s off
f 36/56/25 37/57/25 35/58/25
f 38/59/26 41/60/26 37/57/26
f 42/61/27 39/62/27 41/60/27
f 40/63/28 35/64/28 39/62/28
f 41/60/29 35/65/29 37/66/29
f 38/67/30 40/63/30 42/61/30
f 36/56/25 38/59/25 37/57/25
f 38/59/26 42/61/26 41/60/26
f 42/61/27 40/63/27 39/62/27
f 40/63/28 36/68/28 35/64/28
f 41/60/29 39/62/29 35/65/29
f 38/67/30 36/69/30 40/63/30
o Cube.003_Cube.002
v 0.870000 -0.000000 0.230000
v 0.870000 1.062657 0.230000
v 0.870000 -0.000000 0.170000
v 0.870000 1.062657 0.170000
v 0.930000 -0.000000 0.230000
v 0.930000 1.062657 0.230000
v 0.930000 -0.000000 0.170000
v 0.930000 1.062657 0.170000
vt 0.625000 0.000000
vt 0.375000 0.250000
vt 0.375000 0.000000
vt 0.625000 0.250000
vt 0.375000 0.500000
vt 0.625000 0.500000
vt 0.375000 0.750000
vt 0.625000 0.750000
vt 0.375000 1.000000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.875000 0.500000
vt 0.625000 1.000000
vt 0.875000 0.750000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
usemtl Material
s off
f 44/70/31 45/71/31 43/72/31
f 46/73/32 49/74/32 45/71/32
f 50/75/33 47/76/33 49/74/33
f 48/77/34 43/78/34 47/76/34
f 49/74/35 43/79/35 45/80/35
f 46/81/36 48/77/36 50/75/36
f 44/70/31 46/73/31 45/71/31
f 46/73/32 50/75/32 49/74/32
f 50/75/33 48/77/33 47/76/33
f 48/77/34 44/82/34 43/78/34
f 49/74/35 47/76/35 43/79/35
f 46/81/36 44/83/36 48/77/36

View File

@@ -0,0 +1,3 @@
name: "islands_terrain"
model: "islands_terrain.obj"
collision: "mesh"

View File

@@ -0,0 +1,32 @@
# Blender MTL File: 'islands_terrain.blend'
# Material Count: 3
newmtl Ground
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.137348 0.064835 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl Rock
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.388300 0.159443 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2
newmtl Water
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.003266 0.332269 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.450000
d 1.000000
illum 2

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,17 @@
name: "power_plant"
model: "power_plant.obj"
collision: "mesh"
collision_mesh: null # Use model mesh for collision detection
scripts: [
"power_plant"
]
uses:
-
package: "base"
name: "purchase_terminal"
-
package: "base"
name: "information_panel"
-
package: "base"
name: "door"

View File

@@ -0,0 +1,42 @@
# Blender MTL File: 'power_plant.blend'
# Material Count: 4
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.142401 0.072932 0.051375
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.002
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.057602 0.000000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.004
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.350556 0.350556 0.350556
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl pipes
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.420023 0.371232 0.326654
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,10 @@
# frozen_string_literal: true
component(:building)
on.create do |event|
map.insert_entity("base", "purchase_terminal", event.entity.position + Vector.new(-1.5, 1.5, -4.52), Vector.new(0, 20, 0), data: { team: nil })
map.insert_entity("base", "information_panel", event.entity.position + Vector.new(3, 0, 1), Vector.new(0, -90, 0))
map.insert_entity("base", "door", event.entity.position + Vector.new(0, 0, 6), Vector.new(0, 0, 0))
map.insert_entity("base", "door", event.entity.position + Vector.new(0, 0, 6), Vector.new(0, 180, 0))
end

View File

@@ -0,0 +1,3 @@
name: "purchase_terminal"
model: "purchase_terminal.obj"
collision: "boundingbox"

View File

@@ -0,0 +1,23 @@
# Blender MTL File: 'purchase_terminal.blend'
# Material Count: 2
newmtl Material
Ns 323.999994
Ka 1.000000 1.000000 1.000000
Kd 0.094626 0.094626 0.094626
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
newmtl Material.001
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.500000 0.500000 0.500000
Ke 0.0 0.0 0.0
Ni 1.450000
d 1.000000
illum 2
map_Kd /home/cyberarm/Code/i-mic-fps/assets/base/purchase_terminal/textures/purchase_terminal_screen.png

View File

@@ -0,0 +1,108 @@
# Blender v2.80 (sub 75) OBJ File: 'purchase_terminal.blend'
# www.blender.org
mtllib purchase_terminal.mtl
o Cube
v 0.750000 1.000000 0.000000
v 0.750000 0.000000 0.000000
v 0.721107 0.980738 0.250000
v 0.750000 0.000000 0.300000
v 0.721107 0.219262 0.250000
v 0.750000 0.200000 0.000000
v -0.750000 1.000000 0.000000
v -0.750000 0.000000 0.000000
v -0.721107 0.980738 0.250000
v -0.750000 0.000000 0.300000
v 0.000000 0.200000 0.250000
v 0.000000 0.200000 0.000000
v -0.721107 0.219262 0.250000
v -0.750000 0.200000 0.000000
v 0.000000 0.000000 0.000000
v 0.000000 1.000000 0.250000
v 0.000000 0.000000 0.250000
v 0.000000 1.000000 0.000000
v 0.750000 1.000000 0.250000
v 0.750000 0.200000 0.250000
v -0.750000 1.000000 0.250000
v -0.750000 0.200000 0.250000
v 0.721107 0.980738 0.224828
v 0.721107 0.219262 0.224828
v -0.721107 0.980738 0.224828
v -0.721107 0.219262 0.224828
v 0.750000 0.100000 0.300000
v -0.750000 0.100000 0.300000
vt 0.125000 0.500000
vt 0.250000 0.500000
vt 0.125000 0.500000
vt 0.250000 0.750000
vt 0.187500 0.750000
vt 0.125000 0.750000
vt 0.375000 0.500000
vt 0.375000 0.750000
vt 0.375000 0.750000
vt 0.125000 0.750000
vt 0.187500 0.750000
vt 0.250000 0.750000
vt 0.375000 0.500000
vt 0.250000 0.500000
vt 0.253010 0.750000
vt 0.371990 0.750000
vt 0.371990 0.750000
vt 0.253010 0.750000
vt 0.371990 0.750000
vt 0.371990 0.750000
vt 0.253010 0.750000
vt 0.253010 0.750000
vt 1.000000 1.000000
vt -0.000000 0.000000
vt 1.000000 -0.000000
vt -0.000000 1.000000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.4472 0.8944
vn 0.0000 0.0000 1.0000
usemtl Material
s off
f 8/1/1 6/2/1 2/3/1
f 20/4/2 27/5/2 4/6/2
f 4/6/3 8/1/3 2/3/3
f 1/7/2 20/4/2 6/2/2
f 1/7/4 21/8/4 19/9/4
f 10/10/5 28/11/5 22/12/5
f 20/4/6 28/11/6 27/5/6
f 22/12/5 7/13/5 14/14/5
f 13/15/2 25/16/2 9/17/2
f 7/13/1 6/2/1 14/14/1
f 5/18/7 19/9/7 3/19/7
f 3/19/7 21/8/7 9/17/7
f 13/15/7 20/4/7 5/18/7
f 9/17/7 22/12/7 13/15/7
f 9/17/3 23/20/3 3/19/3
f 5/18/4 26/21/4 13/15/4
f 3/19/5 24/22/5 5/18/5
f 27/5/7 10/10/7 4/6/7
f 8/1/1 14/14/1 6/2/1
f 4/6/2 2/3/2 20/4/2
f 2/3/2 6/2/2 20/4/2
f 4/6/3 10/10/3 8/1/3
f 1/7/2 19/9/2 20/4/2
f 1/7/4 7/13/4 21/8/4
f 14/14/5 8/1/5 22/12/5
f 8/1/5 10/10/5 22/12/5
f 20/4/6 22/12/6 28/11/6
f 22/12/5 21/8/5 7/13/5
f 13/15/2 26/21/2 25/16/2
f 7/13/1 1/7/1 6/2/1
f 5/18/7 20/4/7 19/9/7
f 3/19/7 19/9/7 21/8/7
f 13/15/7 22/12/7 20/4/7
f 9/17/7 21/8/7 22/12/7
f 9/17/3 25/16/3 23/20/3
f 5/18/4 24/22/4 26/21/4
f 3/19/5 23/20/5 24/22/5
f 27/5/7 28/11/7 10/10/7
usemtl Material.001
f 23/23/7 26/24/7 24/25/7
f 23/23/7 25/26/7 26/24/7

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -1,3 +1,3 @@
---
name: "randomish_terrain"
model: "randomish_terrain.obj"
model: "randomish_terrain.obj"
collision: "mesh"

View File

@@ -1,3 +1,3 @@
---
name: "river_terrain"
model: "river_terrain.obj"
collision: "mesh"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@@ -0,0 +1,12 @@
# frozen_string_literal: true
component(:vehicle) # Generic, Weapon
on.button_down(:interact) do |event|
CyberarmEngine::Window.instance.console.stdin("#{event.entity.name} handled button_down(:interact)")
# if event.player.touching?(event.entity)
# event.player.enter_vehicle
# elsif event.player.driving?(event.entity) or event.player.passenger?(event.entity)
# event.player.exit_vehicle
# end
end

View File

@@ -0,0 +1,22 @@
{
"playlists": {
"menus": [
"menu_background"
],
"nighttime": [],
"daytime": []
},
"music": [
{
"name": "menu_background",
"path": "music/untitled-2-revised-extended_mixed.ogg"
}
],
"sounds": [
{
"name": "shield_regen",
"type": "sfx",
"path": "sfx/shield_regen.wav"
}
]
}

Binary file not shown.

View File

@@ -1,2 +1,3 @@
name: "skydome"
model: "skydome.obj"
model: "skydome.obj"
collision: null

View File

@@ -0,0 +1,2 @@
name: sponza_demo
model: sponza.obj

View File

@@ -1,2 +1,5 @@
name: "war_factory"
model: "war_factory.obj"
model: "war_factory.obj"
scripts: [
"war_factory"
]

View File

@@ -1,42 +1,32 @@
# Blender MTL File: 'war_factory.blend'
# Material Count: 4
# Material Count: 3
newmtl Material
Ns 96.078431
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.527055 0.242208
Kd 0.800000 0.658819 0.302760
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
newmtl door
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.000000 0.006044 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2
newmtl garage
Ns 96.078431
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.358382 0.358382 0.358382
Kd 0.447978 0.447978 0.447978
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2
newmtl pipes
Ns 96.078431
Ns 225.000000
Ka 1.000000 1.000000 1.000000
Kd 0.336018 0.296986 0.261323
Kd 0.420023 0.371232 0.326654
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ke 0.0 0.0 0.0
Ni 1.000000
d 1.000000
illum 2

View File

@@ -1,4 +1,4 @@
# Blender v2.79 (sub 6) OBJ File: 'war_factory.blend'
# Blender v2.80 (sub 75) OBJ File: 'war_factory.blend'
# www.blender.org
mtllib war_factory.mtl
o smoke_stacks_Cube.001
@@ -263,86 +263,86 @@ f 65//15 66//15 18//15
f 18//16 66//16 67//16
f 67//17 68//17 20//17
o outlets_pipes_Cube.002
v 3.358796 7.940995 0.866388
v 3.887199 7.940995 0.350280
v 3.895892 7.940995 -0.388300
v 3.358797 7.940995 0.866388
v 3.887200 7.940995 0.350280
v 3.895893 7.940995 -0.388300
v 3.379785 7.940995 -0.916703
v 2.641204 7.940995 -0.925396
v 2.112801 7.940995 -0.409289
v 2.104108 7.940995 0.329292
v 2.620216 7.940995 0.857695
v 5.358797 7.940995 0.866388
v 5.887199 7.940995 0.350280
v 5.895893 7.940995 -0.388300
v 5.887200 7.940995 0.350280
v 5.895893 7.940995 -0.388301
v 5.379785 7.940995 -0.916704
v 4.641204 7.940995 -0.925396
v 4.641205 7.940995 -0.925396
v 4.112801 7.940995 -0.409289
v 4.104108 7.940995 0.329292
v 4.620215 7.940995 0.857695
v 3.358796 15.179012 0.866388
v 3.887199 15.179012 0.350280
v 3.895892 15.179010 -0.388300
v 4.620216 7.940995 0.857695
v 3.358797 15.179012 0.866388
v 3.887200 15.179012 0.350280
v 3.895893 15.179010 -0.388300
v 3.379785 15.179012 -0.916703
v 2.641204 15.179010 -0.925396
v 2.112801 15.179012 -0.409289
v 2.104108 15.179010 0.329292
v 2.620216 15.179012 0.857695
v 5.358797 15.179012 0.866388
v 5.887199 15.179012 0.350280
v 5.895893 15.179010 -0.388300
v 5.887200 15.179012 0.350280
v 5.895893 15.179010 -0.388301
v 5.379785 15.179012 -0.916704
v 4.641204 15.179010 -0.925396
v 4.641205 15.179010 -0.925396
v 4.112801 15.179012 -0.409289
v 4.104108 15.179010 0.329292
v 4.620215 15.179012 0.857695
v 4.620216 15.179012 0.857695
v 3.394676 15.179012 0.955977
v 3.975919 15.179012 0.388259
v 3.985482 15.179010 -0.424180
v 3.417763 15.179012 -1.005423
v 2.605324 15.179010 -1.014985
v 2.605325 15.179010 -1.014985
v 2.024081 15.179012 -0.447267
v 2.014518 15.179010 0.365172
v 2.014519 15.179010 0.365172
v 2.582237 15.179012 0.946415
v 5.394676 15.179012 0.955977
v 5.975919 15.179012 0.388258
v 5.985482 15.179010 -0.424180
v 5.417763 15.179012 -1.005423
v 4.605325 15.179010 -1.014985
v 4.024081 15.179012 -0.447267
v 5.394677 15.179012 0.955977
v 5.975920 15.179012 0.388259
v 5.985483 15.179010 -0.424180
v 5.417764 15.179012 -1.005424
v 4.605325 15.179010 -1.014986
v 4.024081 15.179012 -0.447268
v 4.014519 15.179010 0.365172
v 4.582237 15.179012 0.946415
v 4.582238 15.179012 0.946415
v 3.394676 15.379012 0.955977
v 3.975919 15.379012 0.388259
v 3.985482 15.379010 -0.424180
v 3.417763 15.379012 -1.005423
v 2.605324 15.379010 -1.014985
v 2.605325 15.379010 -1.014985
v 2.024081 15.379012 -0.447267
v 2.014518 15.379010 0.365172
v 2.014519 15.379010 0.365172
v 2.582237 15.379012 0.946415
v 5.394676 15.379012 0.955977
v 5.975919 15.379012 0.388258
v 5.985482 15.379010 -0.424180
v 5.417763 15.379012 -1.005423
v 4.605325 15.379010 -1.014985
v 4.024081 15.379012 -0.447267
v 5.394677 15.379012 0.955977
v 5.975920 15.379012 0.388259
v 5.985483 15.379010 -0.424180
v 5.417764 15.379012 -1.005424
v 4.605325 15.379010 -1.014986
v 4.024081 15.379012 -0.447268
v 4.014519 15.379010 0.365172
v 4.582237 15.379012 0.946415
v 4.582238 15.379012 0.946415
v 3.355209 15.379012 0.857429
v 3.878327 15.379012 0.346483
v 3.878328 15.379012 0.346483
v 3.886934 15.379010 -0.384712
v 3.375987 15.379012 -0.907831
v 2.644792 15.379010 -0.916437
v 2.121673 15.379012 -0.405491
v 2.113067 15.379010 0.325705
v 2.624013 15.379012 0.848823
v 2.624014 15.379012 0.848823
v 5.355209 15.379012 0.857429
v 5.878327 15.379012 0.346482
v 5.886934 15.379010 -0.384713
v 5.878328 15.379012 0.346482
v 5.886935 15.379010 -0.384713
v 5.375987 15.379012 -0.907832
v 4.644792 15.379010 -0.916437
v 4.644793 15.379010 -0.916438
v 4.121673 15.379012 -0.405491
v 4.113067 15.379010 0.325704
v 4.624013 15.379012 0.848823
v 4.624014 15.379012 0.848823
v 3.000000 8.000000 -4.800000
v 3.000000 8.800000 -4.800000
v 3.565686 8.000000 -4.565685
@@ -504,29 +504,29 @@ v 4.434315 9.249737 -2.039999
v 4.200000 9.815423 -2.039998
v 4.434315 10.381108 -2.039999
v 2.200000 9.773436 -0.494458
v 5.379784 9.142219 -0.916704
v 5.379784 10.427595 -0.916704
v 3.379785 9.142219 -0.916703
v 5.379786 9.142220 -0.916704
v 5.379786 10.427595 -0.916704
v 3.379785 9.142220 -0.916704
v 3.379785 10.427595 -0.916703
v 4.200000 9.773436 -0.494459
v 2.641204 9.133761 -0.925396
v 2.641204 9.133760 -0.925396
v 2.434314 9.213968 -0.723321
v 2.641204 10.436524 -0.925396
v 2.434314 10.345339 -0.723321
v 2.434314 10.345339 -0.723320
v 5.000000 10.585028 -0.921174
v 5.000000 8.985029 -0.921174
v 4.641204 9.133760 -0.925396
v 4.641204 10.436524 -0.925396
v 4.434315 9.213968 -0.723321
v 4.434315 10.345339 -0.723321
v 4.641205 9.133760 -0.925396
v 4.641205 10.436525 -0.925396
v 4.434315 9.213968 -0.723320
v 4.434315 10.345339 -0.723320
v 3.565686 9.214050 -0.726374
v 3.800000 9.773219 -0.486477
v 3.800000 9.773219 -0.486478
v 3.565686 10.345422 -0.726374
v 3.000000 10.585028 -0.921173
v 3.000000 8.985029 -0.921173
v 5.800000 9.773219 -0.486478
v 5.565685 9.214050 -0.726374
v 5.565685 10.345422 -0.726374
v 5.565685 9.214050 -0.726375
v 5.565685 10.345422 -0.726375
vn 0.0118 0.0000 -0.9999
vn -0.6987 0.0000 -0.7154
vn -0.9999 0.0000 -0.0118
@@ -713,7 +713,7 @@ f 83//26 338//26 99//26
f 91//26 342//26 107//26
f 102//27 117//27 101//27
f 110//27 125//27 109//27
f 102//27 119//27 118//27
f 103//27 118//27 102//27
f 110//27 127//27 126//27
f 104//27 119//27 103//27
f 112//27 127//27 111//27
@@ -745,19 +745,19 @@ f 126//20 141//20 125//20
f 118//21 135//21 134//21
f 133//28 148//28 132//28
f 141//28 156//28 140//28
f 134//28 149//28 133//28
f 133//28 150//28 149//28
f 141//28 158//28 157//28
f 134//28 151//28 150//28
f 135//28 150//28 134//28
f 143//28 158//28 142//28
f 136//28 151//28 135//28
f 135//28 152//28 151//28
f 143//28 160//28 159//28
f 129//28 152//28 136//28
f 130//28 145//28 129//28
f 137//28 160//28 144//28
f 138//28 153//28 137//28
f 131//28 146//28 130//28
f 137//28 154//28 153//28
f 130//28 147//28 146//28
f 138//28 155//28 154//28
f 131//28 148//28 147//28
f 132//28 147//28 131//28
f 139//28 156//28 155//28
f 157//29 110//29 109//29
f 159//30 110//30 158//30
@@ -770,7 +770,7 @@ f 157//36 108//36 156//36
f 149//29 102//29 101//29
f 151//31 104//31 103//31
f 152//32 97//32 104//32
f 145//33 98//33 97//33
f 97//33 146//33 98//33
f 98//34 147//34 99//34
f 147//35 100//35 99//35
f 162//37 163//37 161//37
@@ -975,7 +975,7 @@ f 91//26 343//26 342//26
f 342//26 344//26 107//26
f 102//27 118//27 117//27
f 110//27 126//27 125//27
f 102//27 103//27 119//27
f 103//27 119//27 118//27
f 110//27 111//27 127//27
f 104//27 120//27 119//27
f 112//27 128//27 127//27
@@ -1007,19 +1007,19 @@ f 126//20 142//20 141//20
f 118//21 119//21 135//21
f 133//28 149//28 148//28
f 141//28 157//28 156//28
f 134//28 150//28 149//28
f 133//28 134//28 150//28
f 141//28 142//28 158//28
f 134//28 135//28 151//28
f 135//28 151//28 150//28
f 143//28 159//28 158//28
f 136//28 152//28 151//28
f 135//28 136//28 152//28
f 143//28 144//28 160//28
f 129//28 145//28 152//28
f 130//28 146//28 145//28
f 137//28 153//28 160//28
f 138//28 154//28 153//28
f 131//28 147//28 146//28
f 137//28 138//28 154//28
f 130//28 131//28 147//28
f 138//28 139//28 155//28
f 131//28 132//28 148//28
f 132//28 148//28 147//28
f 139//28 140//28 156//28
f 157//29 158//29 110//29
f 159//30 111//30 110//30
@@ -1036,7 +1036,7 @@ f 103//30 102//30 151//30
f 102//30 150//30 151//30
f 151//31 152//31 104//31
f 152//32 145//32 97//32
f 145//33 146//33 98//33
f 97//33 145//33 146//33
f 98//34 146//34 147//34
f 147//35 148//35 100//35
f 162//37 164//37 163//37
@@ -1216,46 +1216,35 @@ v 5.999997 0.000000 -5.999997
v 5.999997 0.000000 5.999997
v -5.999998 0.000000 5.999996
v -5.999995 0.000000 -5.999999
v -5.999999 12.000000 5.999995
v -5.999997 12.000000 -5.999997
v -5.999999 11.000000 5.999995
v -5.999997 10.000000 -5.999997
v 5.999997 0.000000 0.000000
v 2.000001 0.000000 -5.999998
v 5.999999 6.000000 -5.999995
v 2.000000 0.000000 5.999997
v 5.999995 6.000000 5.999999
v -5.999997 0.000000 -0.000002
v -5.999999 6.000000 5.999996
v -5.999996 6.000000 -5.999999
v 2.000001 12.000000 -5.999996
v 1.999997 12.000000 5.999998
v -5.999998 12.000000 -0.000001
v 2.000001 6.000000 -5.999997
v -5.999997 6.000000 -0.000001
v 1.999998 4.000000 5.999997
v 5.999997 6.000000 0.000002
v 1.999999 12.000000 0.000001
v 2.000001 10.000000 -5.999996
v 1.999997 11.000000 5.999998
v -5.999998 11.000000 -2.000001
v 1.999999 11.000000 -1.999999
v 2.000000 0.000000 -0.000001
v 3.999999 0.000000 -5.999997
v 3.999999 0.000000 5.999997
v 4.000000 6.000000 -5.999997
v 3.999996 4.000000 5.999998
v 3.999999 0.000000 -0.000000
v 0.000003 0.000000 -5.999999
v 0.000001 0.000000 5.999997
v 0.000002 12.000000 -5.999997
v -0.000001 12.000000 5.999997
v 0.000003 6.000000 -5.999998
v -0.000000 8.000000 5.999997
v 0.000001 12.000000 0.000000
v 1.000001 0.000000 5.999997
v 0.000002 10.000000 -5.999997
v -0.000001 11.000000 5.999997
v 1.000000 8.000000 5.999997
v 0.000001 12.000000 -2.000000
v 0.000002 0.000000 -0.000001
v -3.999996 0.000000 -5.999999
v -3.999999 0.000000 5.999997
v -3.999997 12.000000 -5.999997
v -4.000000 12.000000 5.999996
v -3.999996 6.000000 -5.999999
v -3.999999 8.000000 5.999996
v -4.999999 0.000000 5.999997
v -3.999997 10.000000 -5.999997
v -4.000000 11.000000 5.999996
v -4.999999 8.000000 5.999996
v -3.999997 0.000000 -0.000002
v -3.999999 12.000000 -0.000001
v -3.999999 12.000000 -2.000001
v 6.000000 8.000000 -5.999994
v 5.999993 8.000000 6.000000
v 5.999997 8.000000 0.000003
@@ -1265,183 +1254,157 @@ v 1.999999 8.000000 0.000001
v 4.000000 8.000000 -5.999995
v 3.999995 8.000000 5.999999
v 3.999998 8.000000 0.000002
v 0.000001 0.000000 6.199996
v -0.000000 8.000000 6.199996
v -3.999999 0.000000 6.199996
v -3.999999 8.000000 6.199996
v -0.400000 0.000000 6.200000
v -0.400000 7.606016 6.200000
v -3.600000 0.000000 6.200000
v -3.600000 7.606016 6.200000
v -0.400000 7.606016 6.000000
v -0.400000 0.000000 6.000000
v -3.600000 0.000000 6.000000
v -3.600000 7.606016 6.000000
v 2.000000 0.000000 6.199996
v 1.999998 4.000000 6.199997
v 3.999999 0.000000 6.199997
v 3.999996 4.000000 6.199997
v 2.200000 0.000000 6.200000
v 2.200000 3.800000 6.200000
v 3.800000 0.000000 6.200000
v 3.800000 3.800000 6.200000
v 3.800000 0.000000 6.000000
v 2.200000 0.000000 6.000000
v 3.800000 3.800000 6.000000
v 2.200000 3.800000 6.000000
v 1.000001 0.000000 6.199996
v 1.000000 8.000000 6.199996
v -4.999999 0.000000 6.199996
v -4.999999 8.000000 6.199996
v 0.600000 0.000000 6.200000
v 0.600000 7.606016 6.200000
v -4.600000 0.000000 6.200000
v -4.600000 7.606016 6.200000
v 0.600000 7.606016 6.000000
v 0.600000 0.000000 6.000000
v -4.600000 0.000000 6.000000
v -4.600000 7.606016 6.000000
v 4.550002 0.000000 5.999997
v 2.049999 0.000000 5.999997
v 3.999998 2.400000 5.999998
v 4.550001 2.400000 5.999998
v 2.049999 2.400000 5.999997
v -5.999999 11.000000 2.999997
v -0.000000 12.000000 2.999998
v 1.999998 11.000000 2.999999
v -3.999999 12.000000 2.999998
vn 0.0000 -1.0000 0.0000
vn 0.0000 1.0000 0.0000
vn -0.4472 0.8944 -0.0000
vn -0.0000 0.0000 1.0000
vn -1.0000 0.0000 -0.0000
vn 0.0000 0.0000 -1.0000
vn 1.0000 0.0000 0.0000
vn -0.4082 0.8165 -0.4082
vn 0.0000 0.9701 -0.2425
vn 0.4472 0.8944 0.0000
vn 0.0000 0.8944 -0.4472
vn 0.0000 1.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn -0.0000 0.9487 0.3162
vn -0.4286 0.8571 0.2857
vn 0.4082 0.8165 -0.4082
vn 0.4286 0.8571 0.2857
usemtl Material
s off
f 382//185 356//185 387//185
f 361//186 384//186 388//186
f 386//187 349//187 357//187
f 361//188 358//188 363//188
f 381//189 358//189 385//189
f 385//189 350//189 383//189
f 368//189 362//189 370//189
f 363//188 348//188 356//188
f 357//188 356//188 347//188
f 349//188 363//188 357//188
f 382//187 357//187 347//187
f 419//185 410//185 354//185
f 365//190 346//190 351//190
f 353//190 351//190 345//190
f 350//186 388//186 383//186
f 387//185 348//185 381//185
f 368//185 367//185 352//185
f 372//185 354//185 367//185
f 351//185 369//185 372//185
f 345//185 372//185 368//185
f 346//187 371//187 369//187
f 345//189 370//189 353//189
f 352//185 380//185 373//185
f 375//186 366//186 359//186
f 364//187 374//187 354//187
f 352//189 377//189 362//189
f 379//186 360//186 366//186
f 354//185 380//185 367//185
f 380//185 381//185 373//185
f 383//186 379//186 375//186
f 378//190 398//190 374//190
f 377//189 383//189 375//189
f 377//189 381//189 385//189
f 376//187 386//187 378//187
f 388//186 376//186 379//186
f 374//185 387//185 380//185
f 392//186 397//186 395//186
f 395//186 391//186 389//186
f 397//186 390//186 391//186
f 395//189 353//189 370//189
f 355//190 391//190 390//190
f 365//190 389//190 391//190
f 400//187 405//187 401//187
f 386//186 399//186 378//186
f 382//188 401//188 386//188
f 405//185 406//185 403//185
f 401//187 403//187 399//187
f 398//187 403//187 402//187
f 403//188 407//188 402//188
f 404//190 409//190 405//190
f 398//185 407//185 374//185
f 408//185 400//185 382//185
f 410//187 415//187 411//187
f 354//188 411//188 364//188
f 371//190 412//190 369//190
f 414//190 421//190 415//190
f 418//185 412//185 416//185
f 412//187 417//187 416//187
f 413//187 415//187 417//187
f 417//188 418//188 416//188
f 415//185 420//185 417//185
f 362//189 395//189 370//189
f 394//190 359//190 366//190
f 375//189 359//189 392//189
f 393//186 397//186 394//186
f 371//186 411//186 413//186
f 355//187 396//187 371//187
f 378//187 393//187 360//187
f 393//190 366//190 360//190
f 396//187 364//187 371//187
f 382//185 347//185 356//185
f 361//186 349//186 384//186
f 386//187 384//187 349//187
f 361//188 350//188 358//188
f 381//189 348//189 358//189
f 385//189 358//189 350//189
f 368//189 352//189 362//189
f 363//188 358//188 348//188
f 357//188 363//188 356//188
f 349//188 361//188 363//188
f 382//187 386//187 357//187
f 419//185 414//185 410//185
f 365//190 355//190 346//190
f 353//190 365//190 351//190
f 350//186 361//186 388//186
f 387//185 356//185 348//185
f 368//185 372//185 367//185
f 372//185 369//185 354//185
f 351//185 346//185 369//185
f 345//185 351//185 372//185
f 346//187 355//187 371//187
f 345//189 368//189 370//189
f 352//185 367//185 380//185
f 375//186 379//186 366//186
f 364//187 378//187 374//187
f 352//189 373//189 377//189
f 379//186 376//186 360//186
f 354//185 374//185 380//185
f 380//185 387//185 381//185
f 383//186 388//186 379//186
f 378//190 399//190 398//190
f 377//189 385//189 383//189
f 377//189 373//189 381//189
f 376//187 384//187 386//187
f 388//186 384//186 376//186
f 374//185 382//185 387//185
f 392//186 394//186 397//186
f 395//186 397//186 391//186
f 397//186 396//186 390//186
f 395//189 389//189 353//189
f 355//190 365//190 391//190
f 365//190 353//190 389//190
f 400//187 404//187 405//187
f 386//186 401//186 399//186
f 382//188 400//188 401//188
f 405//185 409//185 406//185
f 401//187 405//187 403//187
f 398//187 399//187 403//187
f 403//188 406//188 407//188
f 404//190 408//190 409//190
f 398//185 402//185 407//185
f 408//185 404//185 400//185
f 410//187 414//187 415//187
f 354//188 410//188 411//188
f 371//190 413//190 412//190
f 414//190 419//190 421//190
f 418//185 369//185 412//185
f 412//187 413//187 417//187
f 413//187 411//187 415//187
f 417//188 420//188 418//188
f 415//185 421//185 420//185
f 362//189 392//189 395//189
f 394//190 392//190 359//190
f 392//189 362//189 377//189
f 377//189 375//189 392//189
f 393//186 396//186 397//186
f 371//186 364//186 411//186
f 355//187 390//187 396//187
f 360//187 376//187 378//187
f 378//187 364//187 393//187
f 393//190 394//190 366//190
f 396//187 393//187 364//187
f 372//185 354//185 376//185
f 358//186 407//186 377//186
f 375//187 349//187 355//187
f 372//187 355//187 347//187
f 346//188 380//188 379//188
f 373//189 358//189 377//189
f 376//185 348//185 371//185
f 361//185 360//185 352//185
f 400//185 353//185 360//185
f 399//185 362//185 363//185
f 345//185 363//185 361//185
f 352//185 370//185 364//185
f 366//190 359//190 356//190
f 359//191 405//191 406//191
f 360//185 365//185 370//185
f 370//185 371//185 364//185
f 373//192 369//192 366//192
f 368//188 387//188 365//188
f 367//187 375//187 368//187
f 377//193 405//193 369//193
f 370//185 372//185 376//185
f 381//193 386//193 384//193
f 384//193 380//193 378//193
f 386//193 379//193 380//193
f 389//187 394//187 390//187
f 375//193 388//193 368//193
f 372//194 390//194 375//194
f 394//185 395//185 392//185
f 390//187 392//187 388//187
f 387//187 392//187 391//187
f 392//194 396//194 391//194
f 393//188 398//188 394//188
f 387//185 396//185 365//185
f 397//185 389//185 372//185
f 359//188 381//188 356//188
f 382//193 386//193 383//193
f 357//187 368//187 382//187
f 383//188 359//188 406//188
f 382//187 365//187 353//187
f 354//194 347//194 355//194
f 354//194 350//194 348//194
f 350//195 371//195 348//195
f 373//195 364//195 371//195
f 366//195 352//195 364//195
f 381//195 361//195 352//195
f 384//195 345//195 361//195
f 351//188 378//188 380//188
f 402//187 399//187 346//187
f 403//187 385//187 382//187
f 407//196 367//196 405//196
f 406//193 367//193 357//193
f 404//197 374//197 407//197
f 372//185 347//185 354//185
f 358//186 404//186 407//186
f 375//187 374//187 349//187
f 372//187 375//187 355//187
f 346//188 351//188 380//188
f 373//190 350//190 358//190
f 376//185 354//185 348//185
f 361//185 363//185 360//185
f 360//185 363//185 400//185
f 363//185 362//185 400//185
f 363//185 351//185 399//185
f 351//185 346//185 399//185
f 345//185 351//185 363//185
f 352//185 360//185 370//185
f 366//198 369//198 359//198
f 359//191 369//191 405//191
f 360//185 353//185 365//185
f 370//185 376//185 371//185
f 373//192 377//192 369//192
f 368//188 388//188 387//188
f 367//187 374//187 375//187
f 377//193 407//193 405//193
f 370//185 365//185 372//185
f 381//193 383//193 386//193
f 384//193 386//193 380//193
f 386//193 385//193 379//193
f 389//187 393//187 394//187
f 375//193 390//193 388//193
f 372//194 389//194 390//194
f 394//185 398//185 395//185
f 390//187 394//187 392//187
f 387//187 388//187 392//187
f 392//194 395//194 396//194
f 393//188 397//188 398//188
f 387//185 391//185 396//185
f 397//185 393//185 389//185
f 359//188 383//188 381//188
f 382//193 385//193 386//193
f 357//187 367//187 368//187
f 406//188 357//188 382//188
f 382//188 383//188 406//188
f 382//187 368//187 365//187
f 355//194 349//194 404//194
f 404//194 358//194 355//194
f 358//194 354//194 355//194
f 354//194 358//194 350//194
f 350//195 373//195 371//195
f 373//195 366//195 364//195
f 366//195 356//195 352//195
f 381//195 384//195 361//195
f 384//195 378//195 345//195
f 351//188 345//188 378//188
f 346//187 379//187 402//187
f 379//187 385//187 402//187
f 385//187 401//187 402//187
f 353//187 400//187 403//187
f 403//187 401//187 385//187
f 382//187 353//187 403//187
f 407//196 374//196 367//196
f 406//199 405//199 367//199
f 404//193 349//193 374//193
usemtl garage
f 406//187 408//187 407//187
f 406//187 409//187 408//187
usemtl door
f 420//187 419//187 418//187
f 420//187 421//187 419//187
f 395//187 397//187 396//187
f 395//187 398//187 397//187

View File

@@ -0,0 +1,13 @@
# frozen_string_literal: true
component(:building)
on.create do |event|
map.insert_entity("base", "purchase_terminal", event.entity.position + Vector.new(6, 1.5, 3), Vector.new(0, -90, 0), data: { team: nil })
map.insert_entity("base", "information_panel", event.entity.position + Vector.new(0.5, 0, 3), Vector.new(0, 90, 0))
map.insert_entity("base", "door", event.entity.position + Vector.new(3.3, 0, 6), Vector.new(0, 0, 0))
map.insert_entity("base", "door", event.entity.position + Vector.new(3.3, 0, 6), Vector.new(0, 180, 0))
# map.insert_particle_emitter(Vector.new(3.0, 15.379, 0.029), Texture.new(path: ["base", "shared", "particles", "smoke", "smoke.png"]))
# map.insert_particle_emitter(Vector.new(5.0, 15.379, 0.029), Texture.new(path: ["base", "shared", "particles", "smoke", "smoke.png"]))
end

BIN
blends/STD_cutters.blend Normal file

Binary file not shown.

BIN
blends/alternate_tank.blend Normal file

Binary file not shown.

Binary file not shown.

BIN
blends/character.blend Normal file

Binary file not shown.

BIN
blends/character.blend1 Normal file

Binary file not shown.

BIN
blends/door.blend Normal file

Binary file not shown.

BIN
blends/door.blend1 Normal file

Binary file not shown.

BIN
blends/editor.blend Normal file

Binary file not shown.

BIN
blends/editor.blend1 Normal file

Binary file not shown.

BIN
blends/evergreen_tree.blend Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
blends/power_plant.blend Normal file

Binary file not shown.

BIN
blends/power_plant.blend1 Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,13 +0,0 @@
# Blender MTL File: 'randomish_terrain.blend'
# Material Count: 1
newmtl Material.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2
map_Kd randomish_terrain.png

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

Binary file not shown.

Binary file not shown.

1
data/.gitkeep Normal file
View File

@@ -0,0 +1 @@

11
i-mic-fps-server.rb Normal file
View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
IMICFPS_SERVER_MODE = true
require_relative "i-mic-fps"
director = IMICFPS::Networking::Director.new(mode: :server, hostname: "0.0.0.0", port: 56_789, interface: IMICFPS::Networking::MemoryServer)
director.define_singleton_method(:tick) do |dt|
puts "Ticked: #{dt}"
end
director.run.join

View File

@@ -1,136 +1,114 @@
# frozen_string_literal: true
require "fiddle"
require "yaml"
require "json"
require "abbrev"
require "time"
require "socket"
require "tmpdir"
require "securerandom"
require "opengl"
require "glu"
require "nokogiri"
require "i18n"
begin
require_relative "../cyberarm_engine/lib/cyberarm_engine"
rescue LoadError
require_relative "../cyberarm_engine/lib/cyberarm_engine/opengl"
rescue LoadError => e
pp e
require "cyberarm_engine"
require "cyberarm_engine/opengl"
end
Dir.chdir(File.dirname(__FILE__))
case OpenGL.get_platform
when :OPENGL_PLATFORM_WINDOWS
OpenGL.load_lib("opengl32.dll", "C:/Windows/System32")
GLU.load_lib("GLU32.dll", "C:/Windows/System32")
when :OPENGL_PLATFORM_MACOSX
OpenGL.load_lib("libGL.dylib", "/System/Library/Frameworks/OpenGL.framework/Libraries")
GLU.load_lib("libGLU.dylib", "/System/Library/Frameworks/OpenGL.framework/Libraries")
when :OPENGL_PLATFORM_LINUX
# Black magic to get GLSL 3.30 support on older Intel hardware
# if `glxinfo | egrep "OpenGL vendor|OpenGL renderer"`.include?("Intel")
# ENV["MESA_GL_VERSION_OVERRIDE"] = "3.3"
# ENV["MESA_GLSL_VERSION_OVERRIDE"] = "330"
# end
gl_library_path = nil
if File.exist?("/usr/lib/x86_64-linux-gnu/libGL.so") # Ubuntu (Debian)
gl_library_path = "/usr/lib/x86_64-linux-gnu"
elsif File.exist?("/usr/lib/libGL.so") # Manjaro (ARCH)
gl_library_path = "/usr/lib"
elsif File.exist?("/usr/lib/arm-linux-gnueabihf/libGL.so") # Raspbian (ARM/Raspberry Pi)
gl_library_path = "/usr/lib/arm-linux-gnueabihf"
end
if gl_library_path
OpenGL.load_lib("libGL.so", gl_library_path)
GLU.load_lib("libGLU.so", gl_library_path)
else
raise RuntimeError, "Couldn't find GL libraries"
end
else
raise RuntimeError, "Unsupported platform."
end
if RUBY_VERSION < "2.5.0"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts "|NOTICE| Ruby is #{RUBY_VERSION} not 2.5.0+..............................|Notice|"
puts "|NOTICE| Monkey Patching Float to add required '.clamp' method.|Notice|"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts
class Float
def clamp(min, max)
if self < min
min
elsif self > max
max
else
return self
end
end
end
end
include CyberarmEngine
include OpenGL
include GLU
require_relative "lib/version"
require_relative "lib/constants"
require_relative "lib/common_methods"
def require_all(directory)
files = Dir["#{directory}/**/*.rb"].sort!
file_order = []
require_relative "lib/trees/aabb_tree_debug"
require_relative "lib/trees/aabb_tree"
require_relative "lib/trees/aabb_node"
loop do
failed = []
first_name_error = nil
require_relative "lib/managers/input_mapper"
require_relative "lib/managers/entity_manager"
require_relative "lib/managers/light_manager"
require_relative "lib/managers/network_manager"
require_relative "lib/managers/collision_manager"
require_relative "lib/managers/physics_manager"
files.each do |file|
begin
require_relative file
file_order << file
rescue NameError => e
failed << file
first_name_error ||= e
end
end
require_relative "lib/renderer/renderer"
require_relative "lib/renderer/opengl_renderer"
require_relative "lib/renderer/bounding_box_renderer"
require_relative "lib/states/game_state"
require_relative "lib/ui/menu"
require_relative "lib/ui/command"
require_relative "lib/ui/subcommand"
Dir.glob("#{IMICFPS::GAME_ROOT_PATH}/lib/ui/commands/*.rb").each do |cmd|
require_relative cmd
end
require_relative "lib/ui/console"
require_relative "lib/ui/menus/main_menu"
require_relative "lib/states/game_states/game"
require_relative "lib/states/game_states/loading_state"
require_relative "lib/objects/entity"
require_relative "lib/objects/model_loader"
require_relative "lib/objects/light"
require_relative "lib/objects/camera"
require_relative "lib/objects/entities/player"
require_relative "lib/objects/entities/tree"
require_relative "lib/objects/entities/skydome"
require_relative "lib/objects/entities/test_object"
require_relative "lib/objects/entities/terrain"
require_relative "lib/wavefront/model"
require_relative "lib/window"
if ARGV.join.include?("--profile")
begin
require "ruby-prof"
RubyProf.start
IMICFPS::Window.new.show
result = RubyProf.stop
printer = RubyProf::MultiPrinter.new(result)
printer.print(path: ".", profile: "profile", min_percent: 2)
rescue LoadError
puts "ruby-prof not installed!"
if failed.size == files.size
raise first_name_error
else
files = failed
end
break if failed.empty?
end
# pp file_order.map { |f| f.gsub(".rb", "")}
end
require_all "lib"
# Don't launch game if IMICFPS_SERVER_MODE is defined
# or if game is being packaged
def prevent_launch?
packaging_lockfile = File.expand_path("i-mic-fps-packaging.lock", Dir.tmpdir)
m = "Game client not launched"
return [true, "#{m}: Server is running"] if defined?(IMICFPS_SERVER_MODE) && IMICFPS_SERVER_MODE
return [true, "#{m}: Packaging is running"] if defined?(Ocra)
if File.exist?(packaging_lockfile) && File.read(packaging_lockfile).strip == IMICFPS::VERSION
return [true, "#{m}: Packaging lockfile is present (#{packaging_lockfile})"]
end
[false, ""]
end
if prevent_launch?[0]
puts prevent_launch?[1]
else
native = ARGV.join.include?("--native")
fps_target = ARGV.first.to_i != 0 ? ARGV.first.to_i : 60
window_width = native ? Gosu.screen_width : 1280
window_height = native ? Gosu.screen_height : 720
window_fullscreen = native ? true : false
window = IMICFPS::Window.new(
width: window_width,
height: window_height,
fullscreen: window_fullscreen,
resizable: !window_fullscreen,
update_interval: 1000.0 / fps_target
)
if ARGV.join.include?("--profile")
begin
require "ruby-prof"
RubyProf.start
window.show
result = RubyProf.stop
printer = RubyProf::MultiPrinter.new(result)
printer.print(path: ".", profile: "profile", min_percent: 2)
rescue LoadError
puts "ruby-prof not installed!"
raise
end
else
window.show
end
else
IMICFPS::Window.new.show
end

149
lib/camera_controller.rb Normal file
View File

@@ -0,0 +1,149 @@
# frozen_string_literal: true
class IMICFPS
class CameraController
include CommonMethods
attr_accessor :mode, :camera, :entity, :distance, :origin_distance,
:constant_pitch, :mouse_sensitivity, :mouse_captured
def initialize(camera:, entity: nil, mode: :fpv)
# :fpv - First Person View
# :tpv - Third Person View
@mode = mode
@camera = camera
@entity = entity
@distance = 4
@origin_distance = @distance
@constant_pitch = 20.0
window.mouse_x = window.width / 2
window.mouse_y = window.height / 2
@true_mouse = Point.new(window.width / 2, window.height / 2)
@mouse_sensitivity = 20.0 # Less is faster, more is slower
@mouse_captured = true
@mouse_checked = 0
end
def first_person_view?
@mode == :fpv
end
def distance_from_object
@distance
end
def horizontal_distance_from_object
distance_from_object * Math.cos(@constant_pitch)
end
def vertical_distance_from_object
distance_from_object * Math.sin(@constant_pitch)
end
def position_camera
@distance = if first_person_view?
0
else
@origin_distance
end
x_offset = horizontal_distance_from_object * Math.sin(@entity.orientation.y.degrees_to_radians)
z_offset = horizontal_distance_from_object * Math.cos(@entity.orientation.y.degrees_to_radians)
eye_height = @entity.normalize_bounding_box.max.y
@camera.position.x = @entity.position.x - x_offset
@camera.position.y = @entity.position.y + eye_height
@camera.position.z = @entity.position.z - z_offset
@camera.orientation.y = 180 - @entity.orientation.y
end
def update
position_camera if @entity
return unless @mouse_captured
delta = Float(@true_mouse.x - mouse_x) / (@mouse_sensitivity * @camera.field_of_view) * 70
@camera.orientation.y -= delta
@camera.orientation.y %= 360.0
@camera.orientation.x -= Float(@true_mouse.y - window.mouse_y) / (@mouse_sensitivity * @camera.field_of_view) * 70
@camera.orientation.x = @camera.orientation.x.clamp(-90.0, 90.0)
if @entity
@entity.orientation.y += delta
@entity.orientation.y %= 360.0
end
window.mouse_x = window.width / 2 if window.mouse_x <= 1 || window.mouse_x >= window.width - 1
window.mouse_y = window.height / 2 if window.mouse_y <= 1 || window.mouse_y >= window.height - 1
@true_mouse.x = window.mouse_x
@true_mouse.y = window.mouse_y
end
def button_down(id)
actions = InputMapper.actions(id)
if actions.include?(:release_mouse)
@mouse_captured = false
window.needs_cursor = true
elsif actions.include?(:capture_mouse)
@mouse_captured = true
window.needs_cursor = false
elsif actions.include?(:decrease_view_distance)
@camera.max_view_distance -= 0.5
elsif actions.include?(:increase_view_distance)
@camera.max_view_distance += 0.5
elsif actions.include?(:toggle_first_person_view)
@mode = first_person_view? ? :tpv : :fpv
@entity.visible = !first_person_view? if @entity
elsif actions.include?(:turn_180)
@entity.orientation.y += 180 if @entity
@entity.orientation.y %= 360.0 if @entity
end
end
def button_up(id)
end
def free_move
relative_y_rotation = (@camera.orientation.y + 180)
relative_speed = 2.5
relative_speed = 1.5 if InputMapper.down?(:sneak)
relative_speed = 10.0 if InputMapper.down?(:sprint)
relative_speed *= window.dt
if InputMapper.down?( :forward)
@camera.position.z += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@camera.position.x -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
if InputMapper.down?(:backward)
@camera.position.z -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@camera.position.x += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
if InputMapper.down?(:strife_left)
@camera.position.z += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@camera.position.x += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
if InputMapper.down?(:strife_right)
@camera.position.z -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@camera.position.x -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
if InputMapper.down?(:ascend)
@camera.position.y += relative_speed
end
if InputMapper.down?(:descend)
@camera.position.y -= relative_speed
end
end
end
end

View File

@@ -1,19 +1,38 @@
# frozen_string_literal: true
class IMICFPS
def self.assets_path
File.expand_path("./../../assets", __FILE__)
File.expand_path("../assets", __dir__)
end
module CommonMethods
def window
CyberarmEngine::Window.instance
end
def window; $window; end
def delta_time
window.delta_time
end
def delta_time; (Gosu.milliseconds - @delta_time) / 1000.0; end
def button_down?(id); window.button_down?(id); end
def button_down?(id)
window.button_down?(id)
end
def mouse_x; window.mouse_x; end
def mouse_y; window.mouse_y; end
def mouse_x=(int); window.mouse_x = int; end
def mouse_y=(int); window.mouse_y = int; end
def mouse_x
window.mouse_x
end
def mouse_y
window.mouse_y
end
def mouse_x=(int)
window.mouse_x = int
end
def mouse_y=(int)
window.mouse_y = int
end
def gl(&block)
window.gl do
@@ -24,32 +43,79 @@ class IMICFPS
def formatted_number(number)
string = number.to_s.reverse.scan(/\d{1,3}/).join(",").reverse
string.insert(0, "-") if number < 0
string.insert(0, "-") if number.negative?
return string
string
end
def control_down?; button_down?(Gosu::KbLeftControl) || button_down?(Gosu::KbRightControl); end
def shift_down?; button_down?(Gosu::KbLeftShift) || button_down?(Gosu::KbRightShift); end
def alt_down?; button_down?(Gosu::KbLeftAlt) || button_down?(Gosu::KbRightAlt); end
def control_down?
button_down?(Gosu::KbLeftControl) || button_down?(Gosu::KbRightControl)
end
def shift_down?
button_down?(Gosu::KbLeftShift) || button_down?(Gosu::KbRightShift)
end
def alt_down?
button_down?(Gosu::KbLeftAlt) || button_down?(Gosu::KbRightAlt)
end
def draw_rect(*args)
window.draw_rect(*args)
end
def draw_quad(*args)
window.draw_quad(*args)
end
def fill(color = Gosu::Color::WHITE)
draw_rect(0, 0, window.width, window.height, color)
def fill(color = Gosu::Color::WHITE, z = 0)
draw_rect(0, 0, window.width, window.height, color, z)
end
def handleGlError
e = glGetError()
if e != GL_NO_ERROR
$stderr.puts "OpenGL error detected by handler at: #{caller[0]}"
$stderr.puts " #{gluErrorString(e)} (#{e})\n"
exit
def fill_quad(x1, y1, x2, y2, x3, y3, x4, y4, color = Gosu::Color::WHITE, z = 0, mode = :default)
draw_quad(
x1, y1, color,
x2, y2, color,
x3, y3, color,
x4, y4, color,
z, mode
)
end
def menu_background(primary_color, accent_color, color_step, transparency, bar_size, slope)
((Gosu.screen_height + slope) / bar_size).times do |i|
color = Gosu::Color.rgba(
primary_color.red - i * color_step,
primary_color.green - i * color_step,
primary_color.blue - i * color_step,
transparency
)
fill_quad(
0, i * bar_size,
0, slope + (i * bar_size),
window.width / 2, (-slope) + (i * bar_size),
window.width / 2, i * bar_size,
color,
-2
)
fill_quad(
window.width, i * bar_size,
window.width, slope + (i * bar_size),
window.width / 2, (-slope) + (i * bar_size),
window.width / 2, i * bar_size,
color,
-2
)
end
Gosu.draw_quad(
0, 0, primary_color,
window.width, 0, primary_color,
window.width, window.height, accent_color,
0, window.height, accent_color,
-2
)
end
end
end

41
lib/component.rb Normal file
View File

@@ -0,0 +1,41 @@
# frozen_string_literal: true
class IMICFPS
class Component
@components = {}
def self.get(name)
@components[name]
end
def self.inherited(subclass)
@components["__pending"] ||= []
@components["__pending"] << subclass
end
def self.initiate
return unless @components["__pending"] # Already setup
@components["__pending"].each do |klass|
component = klass.new
@components[component.name] = component
end
@components.delete("__pending")
end
def initialize
setup
end
def name
string = self.class.name.split("::").last
split = string.scan(/[A-Z][a-z]*/)
split.map(&:downcase).join("_").to_s.to_sym
end
def setup
end
end
end

View File

@@ -0,0 +1,8 @@
# frozen_string_literal: true
class IMICFPS
class Components
class Building < Component
end
end
end

View File

@@ -1,16 +1,17 @@
# frozen_string_literal: true
class IMICFPS
GAME_ROOT_PATH = File.expand_path("..", File.dirname(__FILE__))
TextureCoordinate = Struct.new(:u, :v, :weight)
Point = Struct.new(:x, :y)
Color = Struct.new(:red, :green, :blue, :alpha)
Face = Struct.new(:vertices, :uvs, :normals, :colors, :material, :smoothing)
SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Regular.otf"
BOLD_SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Bold.otf"
MONOSPACE_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf"
# Objects exported from blender using the default or meter object scale will be close to 1 GL unit
MODEL_METER_SCALE = 1.0
# Earth
GRAVITY = 9.8 # m/s
EARTH_GRAVITY = 9.8 # m/s
# Moon
# GRAVITY = 1.625 # m/s
end
MOON_GRAVITY = 1.625 # m/s
end

35
lib/crosshair.rb Normal file
View File

@@ -0,0 +1,35 @@
# frozen_string_literal: true
class IMICFPS
class Crosshair
include CommonMethods
def initialize(color: Gosu::Color.rgb(255, 127, 0), size: 10, thickness: 3)
@color = color
@size = size
@thickness = thickness
end
def draw
draw_rect(
window.width / 2 - @size,
(window.height / 2 - @size) - @thickness / 2,
@size * 2,
@thickness,
@color,
0,
:default
)
draw_rect(
(window.width / 2) - @thickness / 2,
window.height / 2 - (@size * 2),
@thickness,
@size * 2,
@color,
0,
:default
)
end
end
end

114
lib/demo.rb Normal file
View File

@@ -0,0 +1,114 @@
# frozen_string_literal: true
class IMICFPS
class Demo
def initialize(camera:, player:, demo:, mode:)
@camera = camera
@player = player
@demo = demo
@mode = mode
@index = 0
@tick = 0
@changed = false
if ARGV.join.include?("--playdemo")
@data = File.exist?(demo) ? File.read("./demo.dat").lines : ""
elsif ARGV.join.include?("--savedemo")
@file = File.open(demo, "w")
@last_pitch = @camera.orientation.z
@last_yaw = @camera.orientation.y
at_exit { @file.close }
end
end
def button_down(id)
if recording?
unless @last_written_index == @index
@last_written_index = @index
@file.puts("tick #{@index}")
end
@file.puts("down #{InputMapper.actions(id)}")
@changed = true
end
end
def button_up(id)
if recording?
unless @last_written_index == @index
@last_written_index = @index
@file.puts("tick #{@index}")
end
@file.puts("up #{InputMapper.actions(id)}")
@changed = true
end
end
def update
play if playing?
record if recording?
@tick += 1
end
def playing?
@mode == :play
end
def recording?
!playing?
end
def play
if @data[@index]&.start_with?("tick")
if @tick == @data[@index].split(" ").last.to_i
@index += 1
until @data[@index]&.start_with?("tick")
break unless @data[@index]
data = @data[@index].split(" ")
case data.first
when "up"
input = InputMapper.get(data.last.to_sym)
key = input.is_a?(Array) ? input.first : input
CyberarmEngine::Window.instance.current_state.button_up(key) if key
when "down"
input = InputMapper.get(data.last.to_sym)
key = input.is_a?(Array) ? input.first : input
CyberarmEngine::Window.instance.current_state.button_down(key) if key
when "mouse"
@camera.orientation.z = data[1].to_f
@player.orientation.y = (data[2].to_f * -1) - 180
end
@index += 1
end
end
end
end
def record
if @camera.orientation.z != @last_pitch || @camera.orientation.y != @last_yaw
unless @last_written_index == @index
@last_written_index = @index
@file.puts("tick #{@index}")
end
@file.puts("mouse #{@camera.orientation.z} #{@camera.orientation.y}")
@last_pitch = @camera.orientation.z
@last_yaw = @camera.orientation.y
end
@changed = false
@index += 1
end
end
end

14
lib/event.rb Normal file
View File

@@ -0,0 +1,14 @@
# frozen_string_literal: true
class IMICFPS
class EventHandler
class Event
attr_reader :entity, :context
def initialize(entity:, context: nil)
@entity = entity
@context = context
end
end
end
end

41
lib/event_handler.rb Normal file
View File

@@ -0,0 +1,41 @@
# frozen_string_literal: true
class IMICFPS
class EventHandler
@@handlers = {}
def self.inherited(subclass)
@@handlers["__pending"] ||= []
@@handlers["__pending"] << subclass
end
def self.initiate
preserve = @@handlers["__pending"]
@@handlers.clear
@@handlers["__pending"] = preserve
@@handlers["__pending"].each do |handler|
instance = handler.new
instance.handles.each do |event|
@@handlers[event] = instance
end
end
end
def self.get(event)
@@handlers[event]
end
def initialize
end
def handlers
raise NotImplementedError
end
def handle(subscriber, context, *args)
raise NotImplementedError
end
end
end

View File

@@ -0,0 +1,19 @@
# frozen_string_literal: true
class IMICFPS
class EventHandler
class EntityLifeCycle < EventHandler
def handles
%i[create move destroy]
end
def handle(subscriber, context, *args)
return unless subscriber.entity == args.first.first
event = EventHandler::Event.new(entity: subscriber.entity, context: context)
subscriber.trigger(event)
end
end
end
end

View File

@@ -0,0 +1,17 @@
# frozen_string_literal: true
class IMICFPS
class EventHandler
class EntityMoved < EventHandler
def handles
[:entity_moved]
end
def handle(subscriber, _context, *args)
event = EventHandler::Event.new(entity: args.first.first)
subscriber.trigger(event)
end
end
end
end

View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
class IMICFPS
class EventHandler
class Input < EventHandler
def handles
%i[button_down button_up]
end
def handle(subscriber, context, *args)
action = subscriber.args.flatten.first
key = args.flatten.first
event = EventHandler::Event.new(entity: subscriber.entity, context: context)
if action.is_a?(Numeric) && action == key
subscriber.trigger(event)
elsif InputMapper.get(action) == key
subscriber.trigger(event)
end
end
end
end
end

13
lib/ext/element.rb Normal file
View File

@@ -0,0 +1,13 @@
module CyberarmEngine
class Element
alias enter_original enter
def enter(_sender)
if @block && is_a?(CyberarmEngine::Element::Link)
get_sample("#{IMICFPS::GAME_ROOT_PATH}/static/sounds/ui_hover.ogg").play
end
enter_original(_sender)
end
end
end

37
lib/ext/load_opengl.rb Normal file
View File

@@ -0,0 +1,37 @@
# frozen_string_literal: true
case OpenGL.get_platform
when :OPENGL_PLATFORM_WINDOWS
OpenGL.load_lib("opengl32.dll", "C:/Windows/System32")
GLU.load_lib("GLU32.dll", "C:/Windows/System32")
when :OPENGL_PLATFORM_MACOSX
OpenGL.load_lib("libGL.dylib", "/System/Library/Frameworks/OpenGL.framework/Libraries")
GLU.load_lib("libGLU.dylib", "/System/Library/Frameworks/OpenGL.framework/Libraries")
when :OPENGL_PLATFORM_LINUX
# Black magic to get GLSL 3.30 support on older Intel hardware
if ARGV.join.include?("--mesa-override") && `glxinfo | egrep "OpenGL vendor|OpenGL renderer"`.include?("Intel")
ENV["MESA_GL_VERSION_OVERRIDE"] = "3.3"
ENV["MESA_GLSL_VERSION_OVERRIDE"] = "330"
end
gl_library_path = nil
if File.exist?("/usr/lib/x86_64-linux-gnu/libGL.so") # Ubuntu (Debian)
gl_library_path = "/usr/lib/x86_64-linux-gnu"
elsif File.exist?("/usr/lib/libGL.so") # Manjaro (ARCH)
gl_library_path = "/usr/lib"
elsif File.exist?("/usr/lib/arm-linux-gnueabihf/libGL.so") # Raspbian (ARM/Raspberry Pi)
gl_library_path = "/usr/lib/arm-linux-gnueabihf"
end
if gl_library_path
OpenGL.load_lib("libGL.so", gl_library_path)
GLU.load_lib("libGLU.so", gl_library_path)
else
raise "Couldn't find GL libraries"
end
else
raise "Unsupported platform."
end

20
lib/ext/numeric.rb Normal file
View File

@@ -0,0 +1,20 @@
# frozen_string_literal: true
if RUBY_VERSION < "2.5.0"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts "|NOTICE| Ruby is #{RUBY_VERSION} not 2.5.0+..............................|Notice|"
puts "|NOTICE| Monkey Patching Numeric to add required '.clamp' method.|Notice|"
puts "-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-"
puts
class Numeric
def clamp(min, max)
if self < min
min
elsif self > max
max
else
self
end
end
end
end

View File

@@ -0,0 +1,83 @@
# frozen_string_literal: true
class IMICFPS
class Editor < Entity
attr_accessor :speed
attr_reader :bound_model, :first_person_view
def setup
bind_model
@speed = 2.5 # meter's per second
@running_speed = 5.0 # meter's per second
@turn_speed = 50.0
@old_speed = @speed
@mass = 72 # kg
@first_person_view = true
@visible = false
@drag = 0.9
end
def update
super
@position += @velocity * window.dt
@velocity *= @drag
end
def relative_speed
InputMapper.down?(:sprint) ? @running_speed : @speed
end
def relative_y_rotation
@orientation.y * -1
end
def forward
@velocity.z += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.y -= Math.sin(@orientation.x * Math::PI / 180) * relative_speed
@velocity.x -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
def backward
@velocity.z -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.y += Math.sin(@orientation.x * Math::PI / 180) * relative_speed
@velocity.x += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
def strife_left
@velocity.z += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
def strife_right
@velocity.z -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
def turn_left
@orientation.y += @turn_speed * delta_time
end
def turn_right
@orientation.y -= @turn_speed * delta_time
end
def ascend
@velocity.y += relative_speed
end
def descend
@velocity.y -= relative_speed
end
def toggle_first_person_view
@first_person_view = !@first_person_view
@visible = !@first_person_view
end
def turn_180
@orientation.y = @orientation.y + 180
@orientation.y %= 360
end
end
end

View File

@@ -0,0 +1,69 @@
# frozen_string_literal: true
class IMICFPS
class Player < Entity
attr_accessor :speed
attr_reader :name, :bound_model
def setup
bind_model
@speed = 2.5 # meter's per second
@running_speed = 5.0 # meter's per second
@turn_speed = 50.0
@old_speed = @speed
@mass = 72 # kg
@visible = false
@drag = 0.6
end
def update
# Do not handle movement if mouse is not captured
return if @camera && !@camera.mouse_captured
super
end
def relative_speed
InputMapper.down?(:sprint) ? @running_speed : @speed
end
def relative_y_rotation
@orientation.y * -1
end
def forward
@velocity.z += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
def backward
@velocity.z -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
end
def strife_left
@velocity.z += Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x += Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
def strife_right
@velocity.z -= Math.sin(relative_y_rotation * Math::PI / 180) * relative_speed
@velocity.x -= Math.cos(relative_y_rotation * Math::PI / 180) * relative_speed
end
def turn_left
@orientation.y += @turn_speed * delta_time
end
def turn_right
@orientation.y -= @turn_speed * delta_time
end
def jump
return unless InputMapper.down?(:jump) && window.director.map.collision_manager.on_ground?(self)
@velocity.y = 1.5
end
end
end

View File

@@ -1,7 +1,8 @@
# frozen_string_literal: true
class IMICFPS
class Skydome < Entity
def setup
bind_model("base", "skydome")
@collision = :none
end
@@ -12,8 +13,8 @@ class IMICFPS
end
def update
@rotation.y += 0.01
@rotation.y %= 360
@orientation.y += 0.01
@orientation.y %= 360
super
end
end

View File

@@ -0,0 +1,6 @@
# frozen_string_literal: true
class IMICFPS
class Terrain < Entity
end
end

120
lib/game_objects/entity.rb Normal file
View File

@@ -0,0 +1,120 @@
# frozen_string_literal: true
class IMICFPS
# A game object is any renderable thing
class Entity
include CommonMethods
attr_accessor :visible, :renderable, :backface_culling, :position, :orientation, :scale, :velocity, :debug_color
attr_reader :name, :bounding_box, :drag, :camera, :manifest, :model
def initialize(manifest:, map_entity: nil, spawnpoint: nil, backface_culling: true, run_scripts: true)
@manifest = manifest
if map_entity
@position = map_entity.position.clone
@orientation = map_entity.orientation.clone
@scale = map_entity.scale.clone
bind_model
elsif spawnpoint
@position = spawnpoint.position.clone
@orientation = spawnpoint.orientation.clone
@scale = Vector.new(1, 1, 1)
else
@position = Vector.new
@orientation = Vector.up
@scale = Vector.new(1, 1, 1)
end
@backface_culling = backface_culling
@name = @manifest.name
@visible = true
@renderable = true
@velocity = Vector.new(0, 0, 0)
@drag = 1.0
@debug_color = Color.new(0.0, 1.0, 0.0)
@last_position = Vector.new(@position.x, @position.y, @position.z)
@sandboxes = []
load_scripts if run_scripts
setup
if @model
@normalized_bounding_box = normalize_bounding_box_with_offset
normalize_bounding_box
end
@camera = nil
self
end
def load_scripts
@manifest.scripts.each do |script|
@sandboxes << Scripting::SandBox.new(entity: self, script: script)
end
end
def collidable?
@manifest.collision
end
def bind_model
model = ModelCache.find_or_cache(manifest: @manifest)
raise "model isn't a model!" unless model.is_a?(Model)
@model = model
@bounding_box = normalize_bounding_box_with_offset
end
def unbind_model
@model = nil
end
def attach_camera(camera)
@camera = camera
end
def detach_camera
@camera = nil
end
def setup
end
# Not advisable to put OpenGL code here, instead put it in Renderer.
def draw
end
def update
unless at_same_position?
Publisher.instance.publish(:entity_moved, nil, self)
@bounding_box = normalize_bounding_box_with_offset if model
end
@last_position = Vector.new(@position.x, @position.y, @position.z)
end
def at_same_position?
@position == @last_position
end
def normalize_bounding_box_with_offset
@model.bounding_box.normalize_with_offset(self)
end
def normalize_bounding_box
@model.bounding_box.normalize(self)
end
def model_matrix
Transform.rotate_3d(@orientation) * Transform.scale_3d(@scale) * Transform.translate_3d(@position)
end
end
end

Some files were not shown because too many files have changed in this diff Show More