├── .gitignore ├── README.md ├── client-game-app ├── .babelrc ├── .editorconfig ├── .postcssrc.js ├── build │ ├── build.js │ ├── check-versions.js │ ├── logo.png │ ├── utils.js │ ├── vue-loader.conf.js │ ├── webpack.base.conf.js │ ├── webpack.dev.conf.js │ └── webpack.prod.conf.js ├── config │ ├── dev.env.js │ ├── index.js │ └── prod.env.js ├── index.html ├── package-lock.json ├── package.json ├── src │ ├── App.vue │ ├── Desert.js │ ├── Game.js │ ├── admin.js │ ├── assets │ │ └── logo.png │ ├── components │ │ ├── Desert.vue │ │ ├── Edit.vue │ │ ├── EntityCreate.vue │ │ ├── Home.vue │ │ ├── Play.vue │ │ └── menu │ │ │ └── editor │ │ │ ├── EntityProperties │ │ │ ├── GeneralPropertiesComponent.vue │ │ │ ├── HeightMapEditComponentPropertiesComponent.vue │ │ │ ├── PhysicsComponentPropertiesComponent.vue │ │ │ ├── PlanePaintEditComponentPropertiesComponent.vue │ │ │ └── RenderComponentPropertiesComponent.vue │ │ │ ├── EntityPropertiesComponent.vue │ │ │ ├── EntityTreeComponent.vue │ │ │ ├── EntityTreeEntryComponent.vue │ │ │ ├── Generic │ │ │ ├── BooleanEditComponent.vue │ │ │ ├── EntitySelectComponent.vue │ │ │ ├── EntityTileComponent.vue │ │ │ ├── MaterialBrowserModalComponent.vue │ │ │ ├── MaterialPreviewComponent.vue │ │ │ ├── MaterialTileComponent.vue │ │ │ ├── NumberEditComponent.vue │ │ │ ├── TextureBrowserModalComponent.vue │ │ │ ├── Vector2EditComponent.vue │ │ │ └── Vector3EditComponent.vue │ │ │ ├── Header │ │ │ ├── HeaderButtonComponent.vue │ │ │ └── HeaderComponent.vue │ │ │ ├── Modal │ │ │ └── WorldBrowserComponent.vue │ │ │ └── Panel │ │ │ ├── BottomPanelComponent.vue │ │ │ ├── LeftPanelComponent.vue │ │ │ └── RightPanelComponent.vue │ ├── config │ │ ├── config.json │ │ └── external_cdn_libs.json │ ├── editor │ │ ├── edit │ │ │ └── Editor.js │ │ ├── entitycreate │ │ │ └── EntityCreate.js │ │ ├── mixins │ │ │ ├── EditNavBarControl.js │ │ │ ├── EditToolsControl.js │ │ │ ├── EntityPropertyManipulatorView.js │ │ │ ├── EntityTreeView.js │ │ │ ├── MaterialToolsControl.js │ │ │ └── WorldLoader.js │ │ └── views │ │ │ ├── component_modal_body.whtml │ │ │ ├── component_modal_tab.whtml │ │ │ ├── entity_edit_component_view.whtml │ │ │ ├── entity_edit_transform_view.whtml │ │ │ ├── entity_tree_list_view.whtml │ │ │ ├── entity_tree_list_view_world_root.whtml │ │ │ ├── texture-browser-image-tile-row.whtml │ │ │ └── texture-browser-image-tile.whtml │ ├── engine │ │ ├── Engine.js │ │ ├── Mouse.js │ │ ├── asset │ │ │ ├── AssetCache.js │ │ │ ├── AssetLoader.js │ │ │ ├── AssetRequest.js │ │ │ ├── GLTFRequest.js │ │ │ ├── JSONDataRequest.js │ │ │ ├── LoadState.js │ │ │ ├── MaterialRequest.js │ │ │ ├── OBJRequest.js │ │ │ └── TextureRequest.js │ │ ├── entity │ │ │ ├── World.js │ │ │ ├── components │ │ │ │ ├── BasicNodeComponent │ │ │ │ │ └── BasicNodeComponent.js │ │ │ │ ├── BasicTrainComponent │ │ │ │ │ └── BasicTrainComponent.js │ │ │ │ ├── Component.js │ │ │ │ ├── DebugComponent │ │ │ │ │ └── DebugComponent.js │ │ │ │ ├── DoorComponent │ │ │ │ │ ├── DoorComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ └── SlidingDoorComponent.js │ │ │ │ ├── FPSPlayerControl │ │ │ │ │ └── FPSPlayerControl.js │ │ │ │ ├── GRIDPlayerControlComponent │ │ │ │ │ └── GRIDPlayerControlComponent.js │ │ │ │ ├── HeightmapEditComponent │ │ │ │ │ └── HeightmapEditComponent.js │ │ │ │ ├── LightComponent │ │ │ │ │ ├── LightComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ └── PointLightComponent.js │ │ │ │ ├── MinigolfClientBallControlControlComponent │ │ │ │ │ └── MinigolfClientBallControlComponent.js │ │ │ │ ├── PathFindingNodeComponent │ │ │ │ │ └── PathFindingNodeComponent.js │ │ │ │ ├── PhysicsComponent │ │ │ │ │ ├── .PhysicsComponent.js.swn │ │ │ │ │ ├── .PhysicsComponent.js.swo │ │ │ │ │ ├── PhysicsComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ ├── BasicPhysicsComponent.js │ │ │ │ │ │ ├── HeightmapPhysicsComponent.js │ │ │ │ │ │ └── OBJPhysicsComponent.js │ │ │ │ ├── PlanePaintEditComponent │ │ │ │ │ └── PlanePaintEditComponent.js │ │ │ │ ├── PositionEditComponent │ │ │ │ │ └── PositionEditComponent.js │ │ │ │ ├── RenderComponent │ │ │ │ │ ├── RenderComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ ├── BasicBoxMeshRenderComponent.js │ │ │ │ │ │ ├── BasicCylinderMeshRenderComponent.js │ │ │ │ │ │ ├── BasicHullMeshRenderComponent.js │ │ │ │ │ │ ├── BasicShapeMeshRenderComponent.js │ │ │ │ │ │ ├── BasicSphereMeshRenderComponent.js │ │ │ │ │ │ ├── FlameRenderComponent.js │ │ │ │ │ │ ├── GLTFRenderComponent.js │ │ │ │ │ │ ├── HeightmapPlaneMeshRenderComponent.js │ │ │ │ │ │ ├── OBJRenderComponent.js │ │ │ │ │ │ └── VegetationMeshRenderComponent.js │ │ │ │ ├── RotateEditComponent │ │ │ │ │ └── RotateEditComponent.js │ │ │ │ ├── ScaleEditComponent │ │ │ │ │ └── ScaleEditComponent.js │ │ │ │ ├── TriggerComponent │ │ │ │ │ └── TriggerComponent.js │ │ │ │ ├── VehiclePassengerComponent │ │ │ │ │ └── VehiclePassengerComponent.js │ │ │ │ ├── WASDPlayerControlComponent │ │ │ │ │ ├── .WASDPlayerControlComponent.js.swo │ │ │ │ │ └── WASDPlayerControlComponent.js │ │ │ │ └── WorldPieceComponent │ │ │ │ │ └── WorldPieceComponent.js │ │ │ ├── entities │ │ │ │ ├── BaseObject.js │ │ │ │ ├── Entity.js │ │ │ │ └── FloorGrid.js │ │ │ ├── mixins │ │ │ │ ├── Clickable.js │ │ │ │ ├── Comms │ │ │ │ │ ├── Comms.js │ │ │ │ │ ├── CommsMessage.js │ │ │ │ │ ├── EntityTransportReference.js │ │ │ │ │ └── MessageTransportObject.js │ │ │ │ ├── Movable.js │ │ │ │ └── Savable.js │ │ │ └── models │ │ │ │ ├── ComponentModel.js │ │ │ │ └── EntityModel.js │ │ └── util │ │ │ └── global │ │ │ ├── entities.js │ │ │ ├── gmodel.js │ │ │ ├── json.js │ │ │ ├── material.js │ │ │ ├── model.js │ │ │ └── texture.js │ ├── home │ │ └── Home.js │ ├── libs │ │ ├── 87.three.min.js.old │ │ ├── CannonDebugRenderer.js.old │ │ ├── ConvexGeometry.js │ │ ├── DragControls.js │ │ ├── GLTFLoader.js │ │ ├── OBJLoader.js │ │ ├── OBJLoader.js.old │ │ ├── OrbitControls.js │ │ ├── PointerLockControls.js │ │ ├── QuickHull.js │ │ ├── cannon.min.js │ │ ├── cannon.min.js.old │ │ ├── lodash.min.js │ │ ├── three.min.js.old │ │ ├── three.min.js.wowbad │ │ └── whiskers.js │ ├── main.js │ └── router │ │ └── index.js └── static │ └── empty.js ├── client-game-app2 └── 3js-gev-2 │ ├── .eslintignore │ ├── .gitignore │ ├── README.md │ ├── babel.config.js │ ├── package-lock.json │ ├── package.json │ ├── public │ ├── favicon.ico │ └── index.html │ ├── src │ ├── App.vue │ ├── Desert.js │ ├── Game.js │ ├── admin.js │ ├── assets │ │ ├── logo.png │ │ ├── logo.svg │ │ └── main.css │ ├── components │ │ ├── Desert.vue │ │ ├── Edit.vue │ │ ├── EntityCreate.vue │ │ ├── HelloWorld.vue │ │ ├── Home.vue │ │ ├── Play.vue │ │ └── menu │ │ │ └── editor │ │ │ ├── EntityProperties │ │ │ ├── GeneralPropertiesComponent.vue │ │ │ ├── HeightMapEditComponentPropertiesComponent.vue │ │ │ ├── PhysicsComponentPropertiesComponent.vue │ │ │ ├── PlanePaintEditComponentPropertiesComponent.vue │ │ │ └── RenderComponentPropertiesComponent.vue │ │ │ ├── EntityPropertiesComponent.vue │ │ │ ├── EntityTreeComponent.vue │ │ │ ├── EntityTreeEntryComponent.vue │ │ │ ├── Generic │ │ │ ├── BooleanEditComponent.vue │ │ │ ├── EntitySelectComponent.vue │ │ │ ├── EntityTileComponent.vue │ │ │ ├── MaterialBrowserModalComponent.vue │ │ │ ├── MaterialPreviewComponent.vue │ │ │ ├── MaterialTileComponent.vue │ │ │ ├── NumberEditComponent.vue │ │ │ ├── TextureBrowserModalComponent.vue │ │ │ ├── Vector2EditComponent.vue │ │ │ └── Vector3EditComponent.vue │ │ │ ├── Header │ │ │ ├── HeaderButtonComponent.vue │ │ │ └── HeaderComponent.vue │ │ │ ├── Modal │ │ │ └── WorldBrowserComponent.vue │ │ │ └── Panel │ │ │ ├── BottomPanelComponent.vue │ │ │ ├── LeftPanelComponent.vue │ │ │ └── RightPanelComponent.vue │ ├── config │ │ ├── config.json │ │ └── external_cdn_libs.json │ ├── editor │ │ ├── edit │ │ │ └── Editor.js │ │ ├── entitycreate │ │ │ └── EntityCreate.js │ │ ├── mixins │ │ │ ├── EditNavBarControl.js │ │ │ ├── EditToolsControl.js │ │ │ ├── EntityPropertyManipulatorView.js │ │ │ ├── EntityTreeView.js │ │ │ ├── MaterialToolsControl.js │ │ │ └── WorldLoader.js │ │ └── views │ │ │ ├── component_modal_body.whtml │ │ │ ├── component_modal_tab.whtml │ │ │ ├── entity_edit_component_view.whtml │ │ │ ├── entity_edit_transform_view.whtml │ │ │ ├── entity_tree_list_view.whtml │ │ │ ├── entity_tree_list_view_world_root.whtml │ │ │ ├── texture-browser-image-tile-row.whtml │ │ │ └── texture-browser-image-tile.whtml │ ├── engine │ │ ├── Engine.js │ │ ├── Mouse.js │ │ ├── asset │ │ │ ├── AssetCache.js │ │ │ ├── AssetLoader.js │ │ │ ├── AssetRequest.js │ │ │ ├── GLTFRequest.js │ │ │ ├── JSONDataRequest.js │ │ │ ├── LoadState.js │ │ │ ├── MaterialRequest.js │ │ │ ├── OBJRequest.js │ │ │ └── TextureRequest.js │ │ ├── entity │ │ │ ├── World.js │ │ │ ├── components │ │ │ │ ├── BasicNodeComponent │ │ │ │ │ └── BasicNodeComponent.js │ │ │ │ ├── BasicTrainComponent │ │ │ │ │ └── BasicTrainComponent.js │ │ │ │ ├── Component.js │ │ │ │ ├── DebugComponent │ │ │ │ │ └── DebugComponent.js │ │ │ │ ├── DoorComponent │ │ │ │ │ ├── DoorComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ └── SlidingDoorComponent.js │ │ │ │ ├── FPSPlayerControl │ │ │ │ │ └── FPSPlayerControl.js │ │ │ │ ├── GRIDPlayerControlComponent │ │ │ │ │ └── GRIDPlayerControlComponent.js │ │ │ │ ├── HeightmapEditComponent │ │ │ │ │ └── HeightmapEditComponent.js │ │ │ │ ├── LightComponent │ │ │ │ │ ├── LightComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ └── PointLightComponent.js │ │ │ │ ├── MinigolfClientBallControlControlComponent │ │ │ │ │ └── MinigolfClientBallControlComponent.js │ │ │ │ ├── PathFindingNodeComponent │ │ │ │ │ └── PathFindingNodeComponent.js │ │ │ │ ├── PhysicsComponent │ │ │ │ │ ├── PhysicsComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ ├── BasicPhysicsComponent.js │ │ │ │ │ │ ├── HeightmapPhysicsComponent.js │ │ │ │ │ │ └── OBJPhysicsComponent.js │ │ │ │ ├── PlanePaintEditComponent │ │ │ │ │ └── PlanePaintEditComponent.js │ │ │ │ ├── PositionEditComponent │ │ │ │ │ └── PositionEditComponent.js │ │ │ │ ├── RenderComponent │ │ │ │ │ ├── RenderComponent.js │ │ │ │ │ └── mixins │ │ │ │ │ │ ├── BasicBoxMeshRenderComponent.js │ │ │ │ │ │ ├── BasicCylinderMeshRenderComponent.js │ │ │ │ │ │ ├── BasicHullMeshRenderComponent.js │ │ │ │ │ │ ├── BasicShapeMeshRenderComponent.js │ │ │ │ │ │ ├── BasicSphereMeshRenderComponent.js │ │ │ │ │ │ ├── FlameRenderComponent.js │ │ │ │ │ │ ├── GLTFRenderComponent.js │ │ │ │ │ │ ├── HeightmapPlaneMeshRenderComponent.js │ │ │ │ │ │ ├── OBJRenderComponent.js │ │ │ │ │ │ └── VegetationMeshRenderComponent.js │ │ │ │ ├── RotateEditComponent │ │ │ │ │ └── RotateEditComponent.js │ │ │ │ ├── ScaleEditComponent │ │ │ │ │ └── ScaleEditComponent.js │ │ │ │ ├── TriggerComponent │ │ │ │ │ └── TriggerComponent.js │ │ │ │ ├── VehiclePassengerComponent │ │ │ │ │ └── VehiclePassengerComponent.js │ │ │ │ ├── WASDPlayerControlComponent │ │ │ │ │ └── WASDPlayerControlComponent.js │ │ │ │ └── WorldPieceComponent │ │ │ │ │ └── WorldPieceComponent.js │ │ │ ├── entities │ │ │ │ ├── BaseObject.js │ │ │ │ ├── Entity.js │ │ │ │ └── FloorGrid.js │ │ │ ├── mixins │ │ │ │ ├── Clickable.js │ │ │ │ ├── Comms │ │ │ │ │ ├── Comms.js │ │ │ │ │ ├── CommsMessage.js │ │ │ │ │ ├── EntityTransportReference.js │ │ │ │ │ └── MessageTransportObject.js │ │ │ │ ├── Movable.js │ │ │ │ └── Savable.js │ │ │ └── models │ │ │ │ ├── ComponentModel.js │ │ │ │ └── EntityModel.js │ │ └── util │ │ │ └── global │ │ │ ├── entities.js │ │ │ ├── gmodel.js │ │ │ ├── json.js │ │ │ ├── material.js │ │ │ ├── model.js │ │ │ └── texture.js │ ├── home │ │ └── Home.js │ ├── libs │ │ ├── ConvexGeometry.js │ │ ├── ConvexHull.js │ │ ├── DragControls.js │ │ ├── GLTFLoader.js │ │ ├── OBJLoader.js │ │ ├── OrbitControls.js │ │ ├── PointerLockControls.js │ │ ├── bootstrap.css │ │ ├── lodash.min.js │ │ └── whiskers.js │ ├── main.js │ ├── quasar-user-options.js │ ├── router │ │ └── index.js │ └── views │ │ ├── About.vue │ │ └── Home.vue │ ├── static │ └── empty.js │ └── vue.config.js ├── resource-api ├── config.json ├── content │ ├── data │ │ ├── desert │ │ │ ├── 1 copy 2.json │ │ │ ├── 1 copy 3.json │ │ │ ├── 1 copy.json │ │ │ ├── 1.json │ │ │ ├── 1.json.old │ │ │ └── new.json │ │ ├── minigolf │ │ │ └── 0.json │ │ └── world │ │ │ ├── 0.heightmaptest.json │ │ │ ├── 0.json │ │ │ └── 1.json │ ├── entities │ │ ├── shapes │ │ │ ├── box │ │ │ │ ├── box.json │ │ │ │ └── box.png │ │ │ └── sphere │ │ │ │ ├── sphere.json │ │ │ │ └── sphere.png │ │ ├── terrain │ │ │ ├── PaintedTerrain │ │ │ │ ├── Painted Terrain.json │ │ │ │ └── Painted Terrain.png │ │ │ └── test01.json │ │ ├── test_models │ │ │ ├── boat01 │ │ │ │ ├── boat01.json │ │ │ │ └── crate.png │ │ │ ├── crate │ │ │ │ ├── crate.json │ │ │ │ └── crate.png │ │ │ ├── directors_chair │ │ │ │ ├── directors_chair.json │ │ │ │ ├── directors_chair.phys │ │ │ │ └── directors_chair.png │ │ │ ├── directors_chair_nophys │ │ │ │ ├── directors_chair_nophys.json │ │ │ │ └── directors_chair_nophys.png │ │ │ ├── door_a1 │ │ │ │ ├── door_a1.json │ │ │ │ └── door_a1.png │ │ │ ├── fence_01 │ │ │ │ ├── fence_01.json │ │ │ │ └── fence_01.png │ │ │ ├── fence_02 │ │ │ │ ├── fence_02.json │ │ │ │ └── fence_02.png │ │ │ ├── flame │ │ │ │ └── flame.json │ │ │ ├── gun │ │ │ │ └── gun.json │ │ │ ├── log_with_hole │ │ │ │ ├── log_with_hole.json │ │ │ │ └── log_with_hole.png │ │ │ ├── poker_chair │ │ │ │ └── poker_chair.json │ │ │ ├── rock_cliff_face_a │ │ │ │ ├── rock_cliff_face_a.json │ │ │ │ └── rock_cliff_face_a.png │ │ │ ├── spider_bush │ │ │ │ ├── spider_bush.json │ │ │ │ └── spider_bush.png │ │ │ ├── spider_bush_2 │ │ │ │ ├── spider_bush_2.json │ │ │ │ └── spider_bush_2.png │ │ │ ├── torch │ │ │ │ └── torch.json │ │ │ ├── tree exposed_roots │ │ │ │ ├── tree_exposed_roots.json │ │ │ │ └── tree_exposed_roots.png │ │ │ ├── tree │ │ │ │ ├── tree.json │ │ │ │ └── tree.png │ │ │ ├── tree2 │ │ │ │ ├── tree.png │ │ │ │ └── tree2.json │ │ │ ├── tree_swamp_A_leaves │ │ │ │ ├── tree_swamp_A_leaves.json │ │ │ │ └── tree_swamp_A_leaves.png │ │ │ ├── tree_tall_spider_base │ │ │ │ ├── tree_tall_spider_base.json │ │ │ │ └── tree_tall_spider_base.png │ │ │ ├── wall_vegetation_mess │ │ │ │ ├── wall_vegetation_mess.json │ │ │ │ └── wall_vegetation_mess.png │ │ │ ├── wall_vine_A │ │ │ │ ├── wall_vine_A.json │ │ │ │ └── wall_vine_A.png │ │ │ └── wood_pier │ │ │ │ ├── wood_pier.json │ │ │ │ ├── wood_pier.phys │ │ │ │ └── wood_pier.png │ │ └── vegetation seeds │ │ │ └── grass │ │ │ ├── grass_seed.json │ │ │ └── grass_seed.png │ ├── materials │ │ ├── check.json │ │ ├── default.json │ │ ├── flame.json │ │ ├── grass.json │ │ ├── marblefloor.json │ │ ├── stone1.json │ │ └── swirl.json │ ├── models │ │ ├── Directors_Chair │ │ │ ├── Directors_Chair.obj │ │ │ ├── Directors_Chair.phys │ │ │ └── old.kek │ │ ├── Man │ │ │ └── character.js │ │ ├── Tree │ │ │ ├── Tree.obj │ │ │ └── Tree_phys.json │ │ ├── boat01 │ │ │ ├── boat01.mtl │ │ │ └── boat01.obj │ │ ├── boat01_seat01 │ │ │ ├── boat01_seat01.mtl │ │ │ └── boat01_seat01.obj │ │ ├── boat01_windows │ │ │ ├── boat01_windows.mtl │ │ │ └── boat01_windows.obj │ │ ├── crate │ │ │ ├── crate.mtl │ │ │ ├── crate.obj │ │ │ └── crate.phys │ │ ├── door_a1 │ │ │ ├── door_a1.mtl │ │ │ ├── door_a1.obj │ │ │ └── door_a1.phys │ │ ├── fence_01 │ │ │ ├── fence_01.mtl │ │ │ ├── fence_01.obj │ │ │ └── fence_01.phys │ │ ├── fence_02 │ │ │ ├── fence_02.mtl │ │ │ ├── fence_02.obj │ │ │ └── fence_02.phys │ │ ├── flame │ │ │ ├── flame.mtl │ │ │ └── flame.obj │ │ ├── gun │ │ │ ├── gun.mtl │ │ │ └── gun.obj │ │ ├── gunflash │ │ │ └── gunflash.obj │ │ ├── humanoid_base01_rigtest │ │ │ ├── humanoid_base01_rigtest.mtl │ │ │ └── humanoid_base01_rigtest.obj │ │ ├── humanoid_base01_rigtest2 │ │ │ └── humanoid_base01_rigtest2.gltf │ │ ├── light01 │ │ │ └── light01.obj │ │ ├── log_with_hole │ │ │ ├── log_with_hole.mtl │ │ │ └── log_with_hole.obj │ │ ├── mushroom │ │ │ ├── mushroom.mtl │ │ │ └── mushroom.obj │ │ ├── poker_chair │ │ │ └── poker_chair.obj │ │ ├── rock_cliff_face_a │ │ │ ├── rock_cliff_face_a.mtl │ │ │ └── rock_cliff_face_a.obj │ │ ├── spider_bush │ │ │ └── spider_bush.obj │ │ ├── spider_bush_2 │ │ │ ├── spider_bush_2.mtl │ │ │ └── spider_bush_2.obj │ │ ├── torch │ │ │ ├── torch.mtl │ │ │ ├── torch.obj │ │ │ └── torch.phys │ │ ├── tree2 │ │ │ ├── tree2.mtl │ │ │ └── tree2.obj │ │ ├── tree_exposed_roots │ │ │ ├── tree_exposed_roots.mtl │ │ │ └── tree_exposed_roots.obj │ │ ├── tree_swamp_A_leaves │ │ │ ├── tree_swamp_A_leaves.obj │ │ │ └── tree_swamp_A_leaves_texture.png │ │ ├── tree_tall_spider_base │ │ │ └── tree_tall_spider_base.obj │ │ ├── wall_vegetation_mess │ │ │ ├── wall_vegetation_mess.mtl │ │ │ └── wall_vegetation_mess.obj │ │ ├── wall_vine_A │ │ │ ├── wall_vine_A.mtl │ │ │ └── wall_vine_A.obj │ │ └── wood_pier │ │ │ ├── wood_pier.mtl │ │ │ ├── wood_pier.obj │ │ │ └── wood_pier.phys │ ├── shaders │ │ ├── FlameShader │ │ │ ├── FlameShader_fragment.glsl │ │ │ └── FlameShader_vertex.glsl │ │ ├── TerrainMapMaterial │ │ │ ├── TerrainMapMaterial_fragment.glsl │ │ │ └── TerrainMapMaterial_vertex.glsl │ │ └── VegetationMaterial │ │ │ ├── VegetationMaterial_fragment.glsl │ │ │ └── VegetationMaterial_vertex.glsl │ └── textures │ │ ├── 1.png │ │ ├── 10.png │ │ ├── 11.png │ │ ├── 12.png │ │ ├── 2.png │ │ ├── 5.png │ │ ├── 6.png │ │ ├── 7.png │ │ ├── 8.png │ │ ├── 9.png │ │ ├── boat01_texture.png │ │ ├── concrete.png │ │ ├── crate_texture.png │ │ ├── cube │ │ └── skyboxsun │ │ │ ├── nx.jpg │ │ │ ├── ny.jpg │ │ │ ├── nz.jpg │ │ │ ├── px.jpg │ │ │ ├── py.jpg │ │ │ └── pz.jpg │ │ ├── default.jpg │ │ ├── dirt.jpg │ │ ├── door_a1_texture.png │ │ ├── fence_01_texture.png │ │ ├── fence_02_texture.png │ │ ├── grass.jpg │ │ ├── grass2.jpg │ │ ├── grass_2.jpg │ │ ├── grass_2.png │ │ ├── grass_bubbly.png │ │ ├── gun.png │ │ ├── layout2_Tree2.png │ │ ├── light01_texture.png │ │ ├── log_with_hole_texture.png │ │ ├── marblefloor.png │ │ ├── mushroom.png │ │ ├── poker_chair.jpg │ │ ├── private │ │ ├── check.png │ │ └── swirl.jpg │ │ ├── rock_cliff_face_a_texture.png │ │ ├── spider_bush_2_texture.png │ │ ├── spider_bush_texture.png │ │ ├── stone1.png │ │ ├── torch_texture.png │ │ ├── tree_exposed_roots_texture.png │ │ ├── tree_swamp_A_leaves_texture.png │ │ ├── tree_tall_spider_base_texture.png │ │ ├── vegetationseed.jpg │ │ ├── wall_vegetation_mess_texture.png │ │ ├── wall_vine_A_texture.png │ │ ├── warning.png │ │ ├── waternormals.jpg │ │ └── wood_pier_texture.png ├── middleware │ └── cors.js ├── package-lock.json ├── package.json └── server.js ├── three.js └── build │ └── three.js ├── vsCode.code-workspace └── ws.code-workspace /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | dist/ 4 | npm-debug.log* 5 | yarn-debug.log* 6 | yarn-error.log* 7 | resource-api/content/textures/clouds/* 8 | resource-api/content/textures/leather/* 9 | resource-api/content/textures/milmetal/* 10 | resource-api/content/textures/covering/* 11 | resource-api/content/textures/exmarble/* 12 | resource-api/content/textures/flower/* 13 | resource-api/content/textures/frames/* 14 | resource-api/content/textures/grabbag/* 15 | resource-api/content/textures/paper/* 16 | resource-api/content/textures/tiles/* 17 | 18 | # Editor directories and files 19 | .idea 20 | .vscode 21 | .vs/ 22 | *.suo 23 | *.ntvs* 24 | *.njsproj 25 | *.sln 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Thing I made for fun, game engine with three.js and vue.js, includes level editor and playable game 2 | 3 | Editor features are mostly all missing in latest commit because vue.js updated to 3.0 and broke a load of libs i.e. bootstrap, webpack even though vue claimed it is backwards compatabile. 4 | 5 | ![image](https://i.imgur.com/MJDE1jh.jpg) 6 | 7 | 8 | Video: https://files.catbox.moe/5ynwrw.webm 9 | 10 | 11 | Old video of editor: https://files.catbox.moe/q29nho.webm 12 | 13 | ![image](https://i.imgur.com/9msMG9f.png) 14 | ![image](https://i.imgur.com/qMJnxUE.png) 15 | ![image](https://i.imgur.com/jAi2P8H.jpg) 16 | # Installation & Use 17 | 18 | Download and install: git, node, npm 19 | 20 | >``` 21 | >> cd resource-api 22 | >> npm install 23 | >``` 24 | >``` 25 | > node server.js 26 | >``` 27 | >``` 28 | 29 | >``` 30 | >> cd client-game-app2\3js-gev-2 31 | >> npm install 32 | >``` 33 | >``` 34 | > npm run serve 35 | >``` 36 | >``` 37 | 38 | >go to http://localhost:8080/#/Desert 39 | 40 | -------------------------------------------------------------------------------- /client-game-app/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | 3 | } -------------------------------------------------------------------------------- /client-game-app/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | indent_style = space 6 | indent_size = 2 7 | end_of_line = lf 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | -------------------------------------------------------------------------------- /client-game-app/.postcssrc.js: -------------------------------------------------------------------------------- 1 | // https://github.com/michael-ciniawsky/postcss-load-config 2 | 3 | module.exports = { 4 | "plugins": { 5 | "postcss-import": {}, 6 | "postcss-url": {}, 7 | // to edit target browsers: use "browserslist" field in package.json 8 | "autoprefixer": {} 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /client-game-app/build/build.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | require('./check-versions')() 3 | 4 | process.env.NODE_ENV = 'production' 5 | 6 | const ora = require('ora') 7 | const rm = require('rimraf') 8 | const path = require('path') 9 | const chalk = require('chalk') 10 | const webpack = require('webpack') 11 | const config = require('../config') 12 | const webpackConfig = require('./webpack.prod.conf') 13 | 14 | const spinner = ora('building for production...') 15 | spinner.start() 16 | 17 | rm(path.join(config.build.assetsRoot, config.build.assetsSubDirectory), err => { 18 | if (err) throw err 19 | webpack(webpackConfig, (err, stats) => { 20 | spinner.stop() 21 | if (err) throw err 22 | process.stdout.write(stats.toString({ 23 | colors: true, 24 | modules: false, 25 | children: false, // If you are using ts-loader, setting this to true will make TypeScript errors show up during build. 26 | chunks: false, 27 | chunkModules: false 28 | }) + '\n\n') 29 | 30 | if (stats.hasErrors()) { 31 | console.log(chalk.red(' Build failed with errors.\n')) 32 | process.exit(1) 33 | } 34 | 35 | console.log(chalk.cyan(' Build complete.\n')) 36 | console.log(chalk.yellow( 37 | ' Tip: built files are meant to be served over an HTTP server.\n' + 38 | ' Opening index.html over file:// won\'t work.\n' 39 | )) 40 | }) 41 | }) 42 | -------------------------------------------------------------------------------- /client-game-app/build/check-versions.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const chalk = require('chalk') 3 | const semver = require('semver') 4 | const packageConfig = require('../package.json') 5 | const shell = require('shelljs') 6 | 7 | function exec (cmd) { 8 | return require('child_process').execSync(cmd).toString().trim() 9 | } 10 | 11 | const versionRequirements = [ 12 | { 13 | name: 'node', 14 | currentVersion: semver.clean(process.version), 15 | versionRequirement: packageConfig.engines.node 16 | } 17 | ] 18 | 19 | if (shell.which('npm')) { 20 | versionRequirements.push({ 21 | name: 'npm', 22 | currentVersion: exec('npm --version'), 23 | versionRequirement: packageConfig.engines.npm 24 | }) 25 | } 26 | 27 | module.exports = function () { 28 | const warnings = [] 29 | 30 | for (let i = 0; i < versionRequirements.length; i++) { 31 | const mod = versionRequirements[i] 32 | 33 | if (!semver.satisfies(mod.currentVersion, mod.versionRequirement)) { 34 | warnings.push(mod.name + ': ' + 35 | chalk.red(mod.currentVersion) + ' should be ' + 36 | chalk.green(mod.versionRequirement) 37 | ) 38 | } 39 | } 40 | 41 | if (warnings.length) { 42 | console.log('') 43 | console.log(chalk.yellow('To use this template, you must update following to modules:')) 44 | console.log() 45 | 46 | for (let i = 0; i < warnings.length; i++) { 47 | const warning = warnings[i] 48 | console.log(' ' + warning) 49 | } 50 | 51 | console.log() 52 | process.exit(1) 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /client-game-app/build/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/build/logo.png -------------------------------------------------------------------------------- /client-game-app/build/vue-loader.conf.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const utils = require('./utils') 3 | const config = require('../config') 4 | const isProduction = process.env.NODE_ENV === 'production' 5 | const sourceMapEnabled = isProduction 6 | ? config.build.productionSourceMap 7 | : config.dev.cssSourceMap 8 | 9 | module.exports = { 10 | loaders: utils.cssLoaders({ 11 | sourceMap: sourceMapEnabled, 12 | extract: isProduction 13 | }), 14 | cssSourceMap: sourceMapEnabled, 15 | cacheBusting: config.dev.cacheBusting, 16 | transformToRequire: { 17 | video: ['src', 'poster'], 18 | source: 'src', 19 | img: 'src', 20 | image: 'xlink:href' 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /client-game-app/config/dev.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | const { merge } = require('webpack-merge'); 3 | const prodEnv = require('./prod.env') 4 | 5 | module.exports = merge(prodEnv, { 6 | NODE_ENV: '"development"' 7 | }) 8 | -------------------------------------------------------------------------------- /client-game-app/config/prod.env.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | module.exports = { 3 | NODE_ENV: '"production"' 4 | } 5 | -------------------------------------------------------------------------------- /client-game-app/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 3js-gev 7 | 8 | 9 |
10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /client-game-app/src/App.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 12 | 13 | 38 | -------------------------------------------------------------------------------- /client-game-app/src/Desert.js: -------------------------------------------------------------------------------- 1 | import Entity from "./engine/entity/entities/Entity"; 2 | 3 | class Desert { 4 | constructor() { 5 | ENGINE.OnInitialised = () => this.Initialise(); 6 | } 7 | 8 | Initialise() { 9 | this.LoadWorld(); 10 | 11 | ENGINE.m_World.m_Camera.position.set(150, 170, -175); 12 | } 13 | 14 | LoadWorld() { 15 | try { 16 | let data = json(`/data/desert/1.json`); 17 | 18 | Entity.FromFile( 19 | data, 20 | null, 21 | new THREE.Vector3(0, 0, 0) 22 | ); 23 | 24 | Entity.FromFile( 25 | { 26 | "pos": { "x": 1200, "y": 100, "z": -535 }, 27 | "rot": { "x": 0, "y": 0, "z": 0, "w": 1 }, 28 | "scale": 29 | { 30 | "x": 10, 31 | "y": 10, 32 | "z": 10 33 | }, 34 | "parent": 0, 35 | "entities": [], 36 | "components": 37 | [ 38 | { 39 | "args": {}, 40 | "name":"BasicBoxMeshRenderComponent", 41 | "updateable":false 42 | }, 43 | { 44 | "args": 45 | { 46 | "Type": 1, 47 | "BodySettings": 48 | { 49 | "type": "sphere", 50 | "radius": 20, 51 | "material": 52 | { 53 | "friction": 0, 54 | "restitution": 3, 55 | "stiffness": 1e8, 56 | "relaxation": 3, 57 | "frictionstiffness": 1e12 58 | }, 59 | "mass": 2, 60 | "angularDamping": 0.1, 61 | "linearDamping": 0.925, 62 | "fixedRotation": true 63 | } 64 | }, 65 | "name": "BasicPhysicsComponent" 66 | }, 67 | { 68 | "args": {}, 69 | "name": "FPSPlayerControl" 70 | } 71 | ], 72 | }, entities()[0], new THREE.Vector3(0, 0, 0)); 73 | } 74 | catch (Exception) { 75 | setTimeout(this.LoadWorld.bind(this), 50); 76 | } 77 | } 78 | 79 | Update() { 80 | } 81 | } 82 | 83 | export default Desert; -------------------------------------------------------------------------------- /client-game-app/src/Game.js: -------------------------------------------------------------------------------- 1 | import Entity from "./engine/entity/entities/Entity"; 2 | 3 | class Game { 4 | constructor() { 5 | ENGINE.OnInitialised = () => this.Initialise(); 6 | } 7 | 8 | Initialise() { 9 | this.LoadWorld(); 10 | 11 | ENGINE.m_World.m_Camera.position.set(-120.65558286328287, 151.31431689725994, 49.16004438380608); 12 | ENGINE.m_World.m_Camera.quaternion.set(-0.313321793870273, -0.638001400182456, -0.2988145120070227, 0.6570095484000732); 13 | 14 | ENGINE.m_World.m_Controls = new THREE.OrbitControls(ENGINE.m_World.m_Camera, ENGINE.m_World.m_Renderer.domElement); 15 | } 16 | 17 | LoadWorld() { 18 | try { 19 | let data = json(`/data/world/0.json`); 20 | 21 | Entity.FromFile( 22 | data, 23 | null, 24 | new THREE.Vector3(0, 0, 0) 25 | ); 26 | 27 | Entity.FromFile( 28 | { 29 | "pos": { "x": 0, "y": 150, "z": 50 }, 30 | "rot": { "x": 0, "y": 0, "z": 0, "w": 1 }, 31 | "parent": 0, 32 | "entities": [], 33 | "components": 34 | [ 35 | { 36 | "args": 37 | { 38 | "Radius": 2, 39 | "Segments": 36 40 | }, 41 | "name": "BasicSphereMeshRenderComponent" 42 | }, 43 | { 44 | "args": { "Type": 1, "BodySettings": { "type": "sphere", "radius": 2 } }, 45 | "name": "BasicPhysicsComponent" 46 | }, 47 | { 48 | "args": {}, 49 | "name": "MinigolfClientBallControlComponent" 50 | } 51 | ], 52 | }, entities()[0], new THREE.Vector3(0, 0, 0)); 53 | } 54 | catch (Exception) { 55 | setTimeout(this.LoadWorld.bind(this), 500); 56 | } 57 | } 58 | 59 | Update() { 60 | this.m_Controls.update(); 61 | } 62 | } 63 | 64 | export default Game; -------------------------------------------------------------------------------- /client-game-app/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/src/assets/logo.png -------------------------------------------------------------------------------- /client-game-app/src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 64 | 65 | -------------------------------------------------------------------------------- /client-game-app/src/components/Play.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | 24 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/EntityTreeComponent.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 42 | 43 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/Generic/BooleanEditComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 51 | 52 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/Generic/EntityTileComponent.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 48 | 49 | 85 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/Panel/BottomPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | 31 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/Panel/LeftPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 35 | 36 | -------------------------------------------------------------------------------- /client-game-app/src/components/menu/editor/Panel/RightPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 33 | 34 | -------------------------------------------------------------------------------- /client-game-app/src/config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "host2": "217.155.7.240:9090", 3 | "host": "localhost:9090" 4 | } 5 | -------------------------------------------------------------------------------- /client-game-app/src/config/external_cdn_libs.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://code.jquery.com/jquery-1.12.4.min.js", 3 | "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js", 4 | "https://cdnjs.cloudflare.com/ajax/libs/cannon.js/0.6.2/cannon.min.js" 5 | ] 6 | -------------------------------------------------------------------------------- /client-game-app/src/editor/mixins/EntityTreeView.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Dependencies 4 | // @Engine@ 5 | // @World@ 6 | // @Entity@ 7 | // @Component@ 8 | 9 | let EntityTreeView = (Main) => class extends Main 10 | { 11 | constructor() 12 | { 13 | super(); 14 | 15 | this.m_TreeViewElement = $("#EntityTreeViewView"); 16 | } 17 | 18 | render() 19 | { 20 | this.m_TreeViewElement.empty(); 21 | let ents_html = []; 22 | ENGINE.m_World.m_Entities.forEach(e => 23 | { 24 | ents_html.push(e.DataModel().ToHTML()); 25 | }); 26 | 27 | let tree_html = whiskers.render(WHTML["entity_tree_list_view_world_root"], 28 | { 29 | WorldEntities: ents_html 30 | }); 31 | 32 | this.m_TreeViewElement.append(tree_html); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /client-game-app/src/editor/mixins/MaterialToolsControl.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let MaterialToolsControl = (Main) => class extends Main 4 | { 5 | constructor() 6 | { 7 | super(); 8 | 9 | this.m_SelectedTexture = ""; 10 | this.m_TextureBrowserIndex = 0; 11 | } 12 | 13 | SelectTexture(src) 14 | { 15 | this.m_SelectedTexture = src.replace("/textures/",""); 16 | } 17 | 18 | ApplyTexture() 19 | { 20 | this.m_ref_SelectedEntity.m_Components.RenderComponent.SetTexture(this.m_SelectedTexture); 21 | 22 | setTimeout(() => 23 | { 24 | this.FillMaterialEditor(this.m_SelectedTexture); 25 | }, 300); 26 | } 27 | 28 | OpenTextureBrowser() 29 | { 30 | $("#texture-select-modal").modal(); 31 | if(this.m_TextureBrowserIndex === 0) 32 | { 33 | this.LoadAndAppendTextureBrowserRow(0); 34 | this.LoadAndAppendTextureBrowserRow(1); 35 | 36 | this.m_TextureBrowserIndex = 1; 37 | } 38 | 39 | let container = $("#texture-browser-container"); 40 | 41 | container.bind('scroll', () => 42 | { 43 | if (Math.round(container.scrollTop() + container.innerHeight(), 10) >= 44 | Math.round(container[0].scrollHeight, 10)) 45 | { 46 | this.m_TextureBrowserIndex++; 47 | this.LoadAndAppendTextureBrowserRow(this.m_TextureBrowserIndex); 48 | } 49 | }); 50 | } 51 | 52 | LoadAndAppendTextureBrowserRow(row) 53 | { 54 | let texture_URIs = AssetCache.TextureList.slice(row*4, (row*4)+4); 55 | if(texture_URIs.length === 0) { return; } 56 | let texture_tiles = []; 57 | 58 | texture_URIs.forEach(URI => 59 | { 60 | texture_tiles.push(whiskers.render(WHTML["texture-browser-image-tile"], 61 | { 62 | ImageSrc: "/textures/" + URI.path 63 | })); 64 | }); 65 | 66 | $("#texture-browser-container").append(whiskers.render(WHTML["texture-browser-image-tile-row"], 67 | { 68 | ImageTiles: texture_tiles 69 | })); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /client-game-app/src/editor/mixins/WorldLoader.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../engine/entity/entities/Entity"; 4 | import {mix, Mixin} from "mixwith"; 5 | 6 | let WorldLoader = Mixin((superclass) => class extends superclass 7 | { 8 | constructor() 9 | { 10 | super(); 11 | } 12 | 13 | LoadWorld() 14 | { 15 | try 16 | { 17 | let data = json(`/data/world/0.json`); 18 | Entity.FromFile( 19 | data, 20 | null, 21 | new THREE.Vector3(0,0,0) 22 | ); 23 | } 24 | catch(Exception) 25 | { 26 | setTimeout(this.LoadWorld.bind(this), 50); 27 | } 28 | } 29 | }); 30 | 31 | export default WorldLoader; 32 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/component_modal_body.whtml: -------------------------------------------------------------------------------- 1 |
4 | {else} 5 | class="tab-pane fade"> 6 | {/if} 7 |
8 | {for key in componentKeys} 9 |
10 | 11 | {key} 12 | 13 |
14 | {/for} 15 |
16 |
17 | {for value in componentValues} 18 | 19 | {/for} 20 |
21 |
22 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/component_modal_tab.whtml: -------------------------------------------------------------------------------- 1 | {if firstComponent} 2 |
  • 3 | {else} 4 |
  • 5 | {/if} 6 | 7 | 8 | 9 | {componentName} 10 | 11 | 12 |
  • 13 | 14 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/entity_edit_transform_view.whtml: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |

    5 | Position 6 |

    7 |
    8 |
    9 |
    x: 0
    10 |
    y: 0
    11 |
    z: 0
    12 |
    13 |
    14 |
    15 |
    16 |

    17 | Scale 18 |

    19 |
    20 |
    21 |
    x: 0
    22 |
    y: 0
    23 |
    z: 0
    24 |
    25 |
    26 |
    27 |
    28 |

    29 | Rotation 30 |

    31 |
    32 |
    33 |
    x,y,z,w
    34 |
    35 |
    36 |
    37 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/entity_tree_list_view.whtml: -------------------------------------------------------------------------------- 1 | {if EntityHasChildren} 2 |
  • 3 |
    4 | 10 | 13 |
      {>EntityChildren}
    14 |
  • 15 | {else} 16 |
  • 17 |
    18 | 19 | {>EntityString} 20 | 23 | 24 |
  • 25 | {/if} 26 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/entity_tree_list_view_world_root.whtml: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 | 6 | 8 |
      {>WorldEntities}
    9 |
  • 10 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/texture-browser-image-tile-row.whtml: -------------------------------------------------------------------------------- 1 |
    2 | {for tile in ImageTiles} 3 | {tile} 4 | {/for} 5 |
    6 | -------------------------------------------------------------------------------- /client-game-app/src/editor/views/texture-browser-image-tile.whtml: -------------------------------------------------------------------------------- 1 |
    2 | 7 |
    8 | -------------------------------------------------------------------------------- /client-game-app/src/engine/Engine.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import BaseObject from "./entity/entities/BaseObject"; 4 | import Entity from "./entity/entities/Entity"; 5 | import World from "./entity/World"; 6 | import Comms from "./entity/mixins/Comms/Comms"; 7 | 8 | import AssetCache from "./asset/AssetCache"; 9 | import Mouse from "./Mouse"; 10 | 11 | import {mix} from "mixwith"; 12 | 13 | require("./util/global/entities"); 14 | require("./util/global/json"); 15 | require("./util/global/material"); 16 | require("./util/global/model"); 17 | require("./util/global/texture"); 18 | require("./util/global/gmodel"); 19 | 20 | class Engine extends mix(BaseObject).with() 21 | { 22 | constructor() 23 | { 24 | super(); 25 | 26 | this.m_UpdateIntervalID = null; 27 | this.m_UpdateArray = []; 28 | 29 | this.m_AssetCache = null; 30 | this.m_World = null; 31 | this.m_Mouse = null; 32 | 33 | this.m_Initialised = false; 34 | 35 | this.m_LastUpdate = 0; 36 | 37 | this.OnInitialised = () => console.log("ENGINE INITIALISED"); 38 | } 39 | 40 | Initialise() 41 | { 42 | this.m_AssetCache = new AssetCache(); 43 | this.m_World = new World(); 44 | this.m_World.Initialise(); 45 | this.m_Mouse = new Mouse(); 46 | 47 | this.BeginUpdating(0, () => ENGINE.m_AssetCache.Update()); 48 | this.BeginUpdating(1, (dt) => ENGINE.m_World.Update(dt)); 49 | 50 | this.m_UpdateIntervalID = setInterval(this.Update.bind(this), 1000/30); 51 | this.OnInitialised(); 52 | this.m_Initialised = true; 53 | } 54 | 55 | BeginUpdating(num, func) 56 | { 57 | this.m_UpdateArray.push( 58 | { 59 | ref: num, 60 | x: func 61 | }); 62 | } 63 | 64 | StopUpdating(obj, func) 65 | { 66 | this.m_UpdateArray.splice( 67 | this.m_UpdateArray.indexOf( 68 | this.m_UpdateArray.find(f => 69 | f.ref === obj 70 | ) 71 | ), 1 72 | ); 73 | } 74 | 75 | Update() 76 | { 77 | this.m_UpdateArray.forEach( 78 | f => f.x( 79 | Math.max((performance.now() - this.m_LastUpdate)/1000, 0) 80 | ) 81 | ); 82 | } 83 | } 84 | 85 | export default Engine; 86 | -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/AssetLoader.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import LOADSTATE from "./LoadState"; 4 | 5 | class AssetLoader 6 | { 7 | constructor() 8 | { 9 | this.m_DequeuedRequests = []; 10 | this.m_AssetRequestQueue = []; 11 | this.m_AssetDisposalQueue = []; 12 | } 13 | 14 | Queued(assetRequest) 15 | { 16 | if(this.m_DequeuedRequests.find(r => r.m_URI === assetRequest.m_URI)) return true; 17 | if(this.m_AssetRequestQueue.find(r => r.m_URI === assetRequest.m_URI)) return true; 18 | if(this.m_AssetDisposalQueue.find(r => r.m_URI === assetRequest.m_URI)) return true; 19 | 20 | return false; 21 | } 22 | 23 | Enqueue(assetRequest) 24 | { 25 | if(this.Queued(assetRequest)) return; 26 | this.m_DequeuedRequests.push(assetRequest); 27 | assetRequest.OnQueued(); 28 | } 29 | 30 | ProcessRequest(assetRequest) 31 | { 32 | switch(assetRequest.m_LoadState) 33 | { 34 | case LOADSTATE.QUEUED: 35 | assetRequest.Initialise(); 36 | break; 37 | case LOADSTATE.INITIALISED: 38 | assetRequest.Download(); 39 | break; 40 | case LOADSTATE.PROCESS: 41 | assetRequest.Process(); 42 | break; 43 | case LOADSTATE.FINISHED: 44 | if(assetRequest.m_NoCache) return; 45 | ENGINE.m_AssetCache.RequestCache(assetRequest); 46 | break; 47 | } 48 | } 49 | 50 | Update() 51 | { 52 | // Queue newly added requests in process queue 53 | this.m_AssetRequestQueue = this.m_AssetRequestQueue.concat(this.m_DequeuedRequests); 54 | this.m_DequeuedRequests = []; 55 | 56 | // Begin request download 57 | this.m_AssetRequestQueue.forEach(x => {try{this.ProcessRequest(x);}catch(e){console.error(e)}}); 58 | 59 | // Get rid of errored or completed requests 60 | this.m_AssetDisposalQueue = this.m_AssetRequestQueue.filter(x => x.ShouldDispose()); 61 | this.m_AssetDisposalQueue.forEach(x => this.m_AssetRequestQueue.splice(this.m_AssetRequestQueue.indexOf(x), 1)); 62 | this.m_AssetDisposalQueue.forEach(x => { x.Dispose(); }); 63 | this.m_AssetDisposalQueue = []; 64 | } 65 | } 66 | 67 | export default AssetLoader; -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/GLTFRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import AssetRequest from "./AssetRequest"; 4 | import LOADSTATE from "./LoadState"; 5 | import {mix} from "mixwith"; 6 | 7 | 8 | class GLTFRequest extends mix(AssetRequest).with() 9 | { 10 | constructor(uri) 11 | { 12 | super(uri); 13 | } 14 | 15 | Initialise() 16 | { 17 | this.m_LoadState = LOADSTATE.INITIALISING; 18 | 19 | this.m_Loader = new THREE.GLTFLoader(); 20 | 21 | this.m_Loader.setPath(`http://${CONFIG.host}/models/`); 22 | //this.m_Loader.setCrossOrigin(""); 23 | //this.m_Loader.crossOrigin = ""; 24 | 25 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 26 | // - This should be issued by the web server.js 27 | // - Should expire after 5minutes or something 28 | // - Prevents ddos/spam/chinese theives 29 | 30 | this.OnInitialised(); 31 | } 32 | 33 | Download() 34 | { 35 | try 36 | { 37 | this.m_Loader.load 38 | ( 39 | this.m_FileName + "/" + this.m_URI, 40 | this.OnFinished.bind(this), 41 | this.OnProgress.bind(this), 42 | this.OnError.bind(this) 43 | ); 44 | this.OnDownloading(); 45 | } 46 | catch(Exception) 47 | { 48 | this.OnError(); 49 | } 50 | } 51 | 52 | OnFinished(gltf) 53 | { 54 | this.m_Asset = gltf; 55 | super.OnFinished(); 56 | } 57 | } 58 | 59 | export default GLTFRequest; -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/JSONDataRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import AssetRequest from "./AssetRequest"; 4 | import LOADSTATE from "./LoadState"; 5 | import {mix} from "mixwith"; 6 | 7 | const axios = require('axios'); 8 | 9 | class JSONDataRequest extends mix(AssetRequest).with() 10 | { 11 | constructor(uri) 12 | { 13 | super(uri); 14 | } 15 | 16 | Initialise() 17 | { 18 | this.m_LoadState = LOADSTATE.INITIALISING; 19 | 20 | this.OnInitialised(); 21 | } 22 | 23 | Download() 24 | { 25 | try 26 | { 27 | this.OnDownloading(); 28 | axios.get(`http://${CONFIG.host}${this.m_URI}`) 29 | .then((data) => this.OnFinished(data.data)) 30 | .catch((error) => this.OnError(error)); 31 | } 32 | catch(Exception) 33 | { 34 | this.OnError(Exception); 35 | } 36 | } 37 | 38 | OnFinished(json) 39 | { 40 | this.m_Asset = json; 41 | super.OnFinished(); 42 | } 43 | } 44 | 45 | export default JSONDataRequest; -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/LoadState.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let LOADSTATE = {}; 4 | 5 | LOADSTATE.ERROR = 0; 6 | 7 | LOADSTATE.INACTIVE = 1; 8 | LOADSTATE.INITIALISING = 2; 9 | LOADSTATE.QUEUED = 4; 10 | LOADSTATE.INITIALISED = 8; 11 | LOADSTATE.DOWNLOADING = 16; 12 | LOADSTATE.COMPLETE = 32; 13 | LOADSTATE.PROCESS = 64; 14 | LOADSTATE.FINISHED = 128; 15 | LOADSTATE.CACHED = 256; 16 | LOADSTATE.DISPOSE = 512; 17 | 18 | export default LOADSTATE; -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/OBJRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import AssetRequest from "./AssetRequest"; 4 | import LOADSTATE from "./LoadState"; 5 | import {mix} from "mixwith"; 6 | 7 | class OBJRequest extends mix(AssetRequest).with() 8 | { 9 | constructor(uri) 10 | { 11 | super(uri); 12 | } 13 | 14 | Initialise() 15 | { 16 | this.m_LoadState = LOADSTATE.INITIALISING; 17 | 18 | this.m_Loader = new THREE.OBJLoader(); 19 | 20 | this.m_Loader.setPath(`http://${CONFIG.host}/models/`); 21 | //this.m_Loader.setCrossOrigin(""); 22 | //this.m_Loader.crossOrigin = ""; 23 | 24 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 25 | // - This should be issued by the web server.js 26 | // - Should expire after 5minutes or something 27 | // - Prevents ddos/spam/chinese theives 28 | 29 | this.OnInitialised(); 30 | } 31 | 32 | Download() 33 | { 34 | try 35 | { 36 | this.m_Loader.load 37 | ( 38 | this.m_FileName + "/" + this.m_URI, 39 | this.OnFinished.bind(this), 40 | this.OnProgress.bind(this), 41 | this.OnError.bind(this) 42 | ); 43 | this.OnDownloading(); 44 | } 45 | catch(Exception) 46 | { 47 | this.OnError(); 48 | } 49 | } 50 | 51 | OnFinished(obj) 52 | { 53 | this.m_Asset = obj; 54 | super.OnFinished(); 55 | } 56 | } 57 | 58 | export default OBJRequest; -------------------------------------------------------------------------------- /client-game-app/src/engine/asset/TextureRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import AssetRequest from "./AssetRequest"; 4 | import LOADSTATE from "./LoadState"; 5 | import {mix} from "mixwith"; 6 | 7 | class TextureRequest extends mix(AssetRequest).with() 8 | { 9 | constructor(uri) 10 | { 11 | super(uri); 12 | } 13 | 14 | Initialise() 15 | { 16 | this.m_LoadState = LOADSTATE.INITIALISING; 17 | 18 | THREE.ImageUtils.crossOrigin = ""; 19 | THREE.TextureLoader.prototype.crossOrigin = ""; 20 | this.m_Loader = new THREE.TextureLoader(); 21 | 22 | this.m_Loader.setPath(`http://${CONFIG.host}/textures`); 23 | this.m_Loader.setCrossOrigin(""); 24 | this.m_Loader.crossOrigin = ""; 25 | 26 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 27 | // - This should be issued by the web server.js 28 | // - Should expire after 5minutes or something 29 | // - Prevents ddos/spam/chinese theives 30 | 31 | this.OnInitialised(); 32 | } 33 | 34 | Download() 35 | { 36 | try 37 | { 38 | this.m_Loader.load 39 | ( 40 | this.m_URI, 41 | this.OnFinished.bind(this), 42 | this.OnProgress.bind(this), 43 | this.OnError.bind(this) 44 | ); 45 | 46 | this.OnDownloading(); 47 | } 48 | catch(Exception) 49 | { 50 | this.OnError(); 51 | } 52 | } 53 | 54 | OnFinished(texture) 55 | { 56 | texture.format = THREE.RGBAFormat; 57 | texture.needsUpdate = true; 58 | this.m_Asset = texture; 59 | super.OnFinished(); 60 | } 61 | } 62 | 63 | export default TextureRequest; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/Component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import ComponentModel from "./../models/ComponentModel"; 4 | 5 | class Component 6 | { 7 | constructor(args) 8 | { 9 | this.m_Args = args; 10 | 11 | this.m_Name = Component; 12 | this.m_Parent = args.Parent || null; 13 | this.m_Updateable = args.Updateable || false; 14 | 15 | this.m_LastInitialisedTime = 0; 16 | this.m_IsInitialised = false; 17 | } 18 | 19 | LoadAssets() 20 | { 21 | 22 | } 23 | 24 | Initialise() 25 | { 26 | } 27 | 28 | OnInitialised() 29 | { 30 | this.m_IsInitialised = true; 31 | } 32 | 33 | DataModel() { return new ComponentModel(this); } 34 | 35 | Name() { return this.constructor.name; } 36 | 37 | Update() 38 | { 39 | } 40 | 41 | Remove() 42 | { 43 | 44 | } 45 | } 46 | 47 | export default Component; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/DoorComponent/DoorComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class DoorComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Debuggable = false; 14 | 15 | this.m_Name = "DoorComponent"; 16 | 17 | this.m_IsLocked = false; 18 | this.m_IsOpen = false; 19 | this.m_IsClosed = false; 20 | 21 | } 22 | 23 | Initialise() 24 | { 25 | super.Initialise(); 26 | } 27 | 28 | OnInitialised() 29 | { 30 | 31 | this.m_IsInitialised = true; 32 | } 33 | 34 | Remove() 35 | { 36 | 37 | } 38 | 39 | Update() 40 | { 41 | } 42 | } 43 | 44 | export default DoorComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/LightComponent/LightComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class LightComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Debuggable = false; 14 | 15 | this.m_Name = "LightComponent"; 16 | 17 | this.m_Colour = new THREE.Color(1,1,1); 18 | 19 | this.m_Light = null; 20 | } 21 | 22 | Initialise() 23 | { 24 | super.Initialise(); 25 | } 26 | 27 | OnInitialised() 28 | { 29 | this.SetPosition( 30 | this.m_Parent.m_Position.x, 31 | this.m_Parent.m_Position.y, 32 | this.m_Parent.m_Position.z 33 | ); 34 | 35 | // this.m_Light.m_ParentEntity = this.m_Parent || null; 36 | 37 | this.m_Light.castShadow = this.m_Args.castShadow == void(0) ? true : this.m_Args.castShadow; 38 | 39 | this.m_Light.shadow.mapSize.width = 1024; 40 | this.m_Light.shadow.mapSize.height = 1024; 41 | this.m_Light.shadow.camera.near = 0.05; 42 | this.m_Light.shadow.camera.far = 750; 43 | this.m_Light.shadow.bias = -0.005; 44 | 45 | ENGINE.m_World.m_Scene.add(this.m_Light); 46 | this.m_IsInitialised = true; 47 | } 48 | 49 | SetColor(c) 50 | { 51 | this.m_Colour = c; 52 | this.m_Light.color.set(c); 53 | } 54 | 55 | SetPosition(x,y,z) 56 | { 57 | this.m_Light.position.set(x,y,z); 58 | } 59 | 60 | Remove() 61 | { 62 | ENGINE.m_World.m_Scene.remove(this.m_Light); 63 | delete this.m_Light; 64 | } 65 | 66 | Update() 67 | { 68 | } 69 | } 70 | 71 | export default LightComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/LightComponent/mixins/PointLightComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import LightComponent from "./../LightComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class PointLightComponent extends mix(LightComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | } 12 | 13 | Initialise() 14 | { 15 | super.Initialise(); 16 | 17 | this.m_Light = new THREE.PointLight( 18 | this.m_Args.color || 0xFF4400, 19 | this.m_Args.intensity || 0.9, 20 | this.m_Args.distance || 520, 21 | this.m_Args.decay || 2 22 | ); 23 | 24 | this.SetColor(new THREE.Color( 25 | this.m_Args.color || 0xFF4400 26 | )); 27 | 28 | this.OnInitialised(); 29 | } 30 | 31 | Update() 32 | { 33 | } 34 | } 35 | 36 | export default PointLightComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/MinigolfClientBallControlControlComponent/MinigolfClientBallControlComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class MinigolfClientBallControlComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Canvas = document.querySelector("canvas"); 14 | this.m_Canvas.addEventListener("click", this.MouseClick.bind(this), false); 15 | this.m_Dir = null; 16 | this.m_Length = null; 17 | this.m_Name = "MinigolfClientBallControlComponent"; 18 | } 19 | 20 | Initialise() 21 | { 22 | console.log("minigolf comp init"); 23 | super.Initialise(); 24 | 25 | this.OnInitialised(); 26 | } 27 | 28 | OnInitialised() 29 | { 30 | this.m_Arrow = new THREE.ArrowHelper(new THREE.Vector3(0,0,0), new THREE.Vector3(0,0,0), 15, 0x000000, 0); 31 | ENGINE.m_World.m_Scene.add(this.m_Arrow); 32 | this.m_IsInitialised = true; 33 | } 34 | 35 | MouseClick() 36 | { 37 | const force = this.m_Length ** 2; 38 | this.m_Parent.m_Components.PhysicsComponent.ApplyForce( 39 | this.m_Dir.x*force, 0, this.m_Dir.z*force 40 | ); 41 | } 42 | 43 | Update() 44 | { 45 | let m = ENGINE.m_Mouse.m_WorldPosition.clone(); 46 | const mworld = ENGINE.m_Mouse.m_WorldPosition.clone(); 47 | m.y = this.m_Parent.m_Position.y; 48 | this.m_Dir = m.sub(this.m_Parent.m_Position).normalize(); 49 | this.m_Length = Math.min(Math.max(mworld.distanceTo(this.m_Parent.m_Position), 0), 110); 50 | this.m_Arrow.setLength(this.m_Length, 0, 0); 51 | this.m_Arrow.setDirection(this.m_Dir); 52 | this.m_Arrow.position.set(this.m_Parent.m_Position.x, this.m_Parent.m_Position.y, this.m_Parent.m_Position.z); 53 | } 54 | } 55 | 56 | export default MinigolfClientBallControlComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/PathFindingNodeComponent/PathFindingNodeComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class PathFindingNodeComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Name = "PathFindingNodeComponent"; 14 | 15 | this.m_NodeID = args.NodeID !== undefined ? args.NodeID : -1; 16 | this.m_Neighbours = []; 17 | this.m_Previous = {}; 18 | this.m_Visited = false; 19 | this.m_Closed = false; 20 | 21 | this.t_G = 0; 22 | this.t_H = 0; 23 | this.t_F = 0; 24 | 25 | this.m_G = 0; 26 | this.m_H = 0; 27 | this.m_F = 0; 28 | } 29 | 30 | Reset() 31 | { 32 | this.m_Visited = false; 33 | this.m_Closed = false; 34 | this.m_Previous = {}; 35 | this.m_G = 0; 36 | this.m_H = 0; 37 | this.m_F = 0; 38 | this.t_G = 0; 39 | this.t_H = 0; 40 | this.t_F = 0; 41 | } 42 | 43 | GetNeighbours() 44 | { 45 | return this.m_Neighbours; 46 | } 47 | 48 | TG(Node) { this.t_G = Node.m_G + 2.5; return this.t_G; } 49 | 50 | G() 51 | { 52 | this.m_G = (this.m_Previous.m_G || 0) + 2.5; 53 | return this.m_G; 54 | } 55 | 56 | H(Node) 57 | { 58 | this.m_H = this.m_Parent.m_Position.distanceTo(Node.m_Parent.m_Position); 59 | return this.m_H || 0; 60 | } 61 | 62 | TH(Node) { this.t_H = this.m_Parent.m_Position.distanceTo(Node.m_Parent.m_Position); return this.t_H; } 63 | F(Node) { this.m_F = (this.G()||0) + (this.H(Node)||0); return this.m_F; } 64 | TF(Goal, Node) { this.t_F = (this.TG(Node)||0) + (this.TH(Goal)||0); return this.t_F; } 65 | 66 | Initialise() 67 | { 68 | super.Initialise(); 69 | this.m_IsInitialised = true; 70 | } 71 | 72 | Update() 73 | { 74 | super.Update(); 75 | } 76 | } 77 | 78 | export default PathFindingNodeComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/PhysicsComponent/.PhysicsComponent.js.swn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/src/engine/entity/components/PhysicsComponent/.PhysicsComponent.js.swn -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/PhysicsComponent/.PhysicsComponent.js.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/src/engine/entity/components/PhysicsComponent/.PhysicsComponent.js.swo -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/BasicBoxMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class BasicBoxMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | } 12 | 13 | Initialise() 14 | { 15 | super.Initialise(); 16 | var geoBox = new THREE.BoxGeometry(1,1,1); 17 | geoBox.center(); 18 | 19 | var mshBox = new THREE.Mesh(geoBox, material(this.m_Args.material || "default")); 20 | mshBox.material.needsUpdate = true; 21 | mshBox.material.map.needsUpdate = true; 22 | 23 | this.m_Mesh = mshBox; 24 | this.m_Meshes = mshBox; 25 | this.OnInitialised(); 26 | } 27 | 28 | Update() 29 | { 30 | } 31 | } 32 | 33 | export default BasicBoxMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/BasicCylinderMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class BasicCylinderMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | } 12 | 13 | Initialise() 14 | { 15 | super.Initialise(); 16 | 17 | var geoBox = new THREE.CylinderGeometry(25,25,25,8); 18 | geoBox.center(); 19 | 20 | var mshBox = new THREE.Mesh(geoBox, material("default")); 21 | mshBox.material.needsUpdate = true; 22 | mshBox.material.map.needsUpdate = true; 23 | 24 | this.m_Mesh = mshBox; 25 | this.m_Meshes = mshBox; 26 | this.OnInitialised(); 27 | } 28 | 29 | Update() 30 | { 31 | } 32 | } 33 | 34 | export default BasicCylinderMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/BasicHullMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class BasicHullMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | 12 | this.m_Debuggable = true; 13 | 14 | var points = []; 15 | 16 | this.m_Points = args.Points; 17 | this.m_Points = this.m_Points.map(p => {return p.isVector3 ? p : new THREE.Vector3(p.x, p.y, p.z);}); 18 | } 19 | 20 | Initialise() 21 | { 22 | super.Initialise(); 23 | var geometry = new THREE.ConvexBufferGeometry(this.m_Points); 24 | geometry.center(); 25 | 26 | var mesh = new THREE.Mesh(geometry, material("check")); 27 | mesh.material.needsUpdate = true; 28 | mesh.material.map.needsUpdate = true; 29 | 30 | this.m_Mesh = mesh; 31 | this.m_Meshes = mesh; 32 | this.OnInitialised(); 33 | } 34 | 35 | Update() 36 | { 37 | } 38 | } 39 | 40 | export default BasicHullMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/BasicShapeMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class BasicShapeMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | 12 | this.m_Debuggable = false; 13 | 14 | var points = []; 15 | 16 | points[0] = new THREE.Vector2(0, 0); 17 | points[1] = new THREE.Vector2(100, 0); 18 | points[2] = new THREE.Vector2(100, 300); 19 | points[3] = new THREE.Vector2(300, 300); 20 | points[4] = new THREE.Vector2(300, 400); 21 | points[5] = new THREE.Vector2(100, 400); 22 | points[6] = new THREE.Vector2(100, 800); 23 | points[7] = new THREE.Vector2(0, 800); 24 | points[8] = new THREE.Vector2(0, 500); 25 | points[9] = new THREE.Vector2(-400, 500); 26 | points[10] = new THREE.Vector2(-400, 400); 27 | points[11] = new THREE.Vector2(0, 400); 28 | points[12] = new THREE.Vector2(0, 0); 29 | 30 | 31 | this.m_Points = args.Points || points; 32 | } 33 | 34 | Initialise() 35 | { 36 | super.Initialise(); 37 | 38 | let shape = new THREE.Shape(this.m_Points); 39 | let geometry = new THREE.ShapeBufferGeometry(shape); 40 | geometry.center(); 41 | let mesh = new THREE.Mesh(geometry, material("check")); 42 | mesh.material.needsUpdate = true; 43 | mesh.material.map.needsUpdate = true; 44 | 45 | mesh.rotateX(-Math.PI/2); 46 | 47 | this.m_Mesh = mesh; 48 | this.m_Meshes = mesh; 49 | this.OnInitialised(); 50 | } 51 | 52 | Update() 53 | { 54 | } 55 | } 56 | 57 | export default BasicShapeMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/BasicSphereMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class BasicSphereMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | } 12 | 13 | Initialise() 14 | { 15 | super.Initialise(); 16 | 17 | var geoBox = new THREE.SphereGeometry( 18 | this.m_Args.Radius ? this.m_Args.Radius : 25, 19 | this.m_Args.Segments ? this.m_Args.Segments : 25, 20 | this.m_Args.Segments ? this.m_Args.Segments : 25 21 | ); 22 | geoBox.center(); 23 | 24 | var mshBox = new THREE.Mesh(geoBox, material(this.m_Args.material || "default")); 25 | mshBox.material.needsUpdate = true; 26 | mshBox.material.map.needsUpdate = true; 27 | 28 | this.m_Mesh = mshBox; 29 | this.m_Meshes = mshBox; 30 | this.OnInitialised(); 31 | } 32 | 33 | Update() 34 | { 35 | } 36 | } 37 | 38 | export default BasicSphereMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/FlameRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class FlameRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | } 12 | 13 | Initialise() 14 | { 15 | super.Initialise(); 16 | 17 | var geoBox = new THREE.SphereGeometry( 18 | 25, 25, 100 19 | ); 20 | 21 | geoBox.center(); 22 | 23 | const mat = material("flame"); 24 | if(mat == void(0)) throw new Error(); 25 | var mshBox = new THREE.Mesh(geoBox, mat); 26 | 27 | this.m_Mesh = mshBox; 28 | this.m_Meshes = mshBox; 29 | this.OnInitialised(); 30 | 31 | this.m_LastGreen = 1.0; 32 | } 33 | 34 | Update(dt) 35 | { 36 | const now = performance.now(); 37 | const delta = (now - (((now/1000) << 2 >> 2) * 1000)) / 1000; 38 | this.m_Mesh.material.uniforms.delta.value = delta; 39 | 40 | const light = this.m_Parent.m_Components.LightComponent; 41 | if(light) 42 | { 43 | this.m_LastGreen += (Math.random() - 0.5) * 0.05; 44 | this.m_LastGreen = this.m_LastGreen % 1; 45 | light.SetColor(new THREE.Color( 46 | 1.0, 47 | Math.min(Math.max(this.m_LastGreen, 0.25), 0.75), 48 | 0.0 49 | ).getHex()); 50 | } 51 | } 52 | } 53 | 54 | export default FlameRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/RenderComponent/mixins/HeightmapPlaneMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import RenderComponent from "./../RenderComponent"; 4 | import {mix} from "mixwith"; 5 | 6 | class HeightmapPlaneMeshRenderComponent extends mix(RenderComponent).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | console.log(args) 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | var geometry = new THREE.PlaneGeometry( 18 | this.m_Args.Size, 19 | this.m_Args.Size, 20 | this.m_Args.Divisions, 21 | this.m_Args.Divisions 22 | ); 23 | 24 | console.log(geometry) 25 | geometry.center(); 26 | 27 | console.log(this.m_Args.material); 28 | var mshBox = new THREE.Mesh(geometry, material(this.m_Args.material || "default")); 29 | mshBox.material.needsUpdate = true; 30 | //mshBox.material.map.needsUpdate = true; 31 | console.log(mshBox) 32 | this.m_Mesh = mshBox; 33 | this.m_Meshes = mshBox; 34 | this.OnInitialised(); 35 | } 36 | 37 | Update() 38 | { 39 | } 40 | } 41 | 42 | export default HeightmapPlaneMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/TriggerComponent/TriggerComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class TriggerComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Name = "TriggerComponent"; 14 | 15 | this.m_TriggerFunctions = []; 16 | 17 | this.m_TriggerByPlayerOnly = false; 18 | } 19 | 20 | Initialise() 21 | { 22 | super.Initialise(); 23 | 24 | this.m_TriggerByPlayerOnly = this.m_Args.playeronly || false; 25 | 26 | this.m_Parent.m_Components.PhysicsComponent.AddEventListener("collide", evt => 27 | { 28 | if(evt.body.m_ParentEntity.m_ID === this.m_Parent.m_ID) return; 29 | if(this.m_TriggerByPlayerOnly && evt.body.m_ParentEntity.m_Components.FPSPlayerControl) 30 | { 31 | this.OnTrigger(evt); 32 | } 33 | else if(!this.m_TriggerByPlayerOnly) 34 | { 35 | this.OnTrigger(evt); 36 | } 37 | }); 38 | 39 | this.OnInitialised(); 40 | } 41 | 42 | OnTrigger(evt) 43 | { 44 | if(this.m_TriggerFunctions !== null && Array.isArray(this.m_TriggerFunctions)) 45 | { 46 | this.m_TriggerFunctions.forEach(f => f(evt)); 47 | } 48 | } 49 | 50 | Update() 51 | { 52 | } 53 | } 54 | 55 | export default TriggerComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/WASDPlayerControlComponent/.WASDPlayerControlComponent.js.swo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/src/engine/entity/components/WASDPlayerControlComponent/.WASDPlayerControlComponent.js.swo -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/components/WorldPieceComponent/WorldPieceComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Component from "./../Component"; 4 | import {mix} from "mixwith"; 5 | 6 | class WorldPieceComponent extends mix(Component).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | 12 | this.m_Name = "WorldPieceComponent"; 13 | this.m_PieceOrigin = this.m_Parent.m_Position; 14 | } 15 | 16 | Initialise() 17 | { 18 | super.Initialise(); 19 | 20 | 21 | this.OnInitialised(); 22 | } 23 | 24 | Update() 25 | { 26 | } 27 | } 28 | 29 | export default WorldPieceComponent; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/entities/BaseObject.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | class BaseObject 4 | { 5 | constructor() 6 | { 7 | } 8 | } 9 | 10 | export default BaseObject; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Clickable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | let Clickable = Mixin((superclass) => class extends superclass 5 | { 6 | constructor() 7 | { 8 | super(); 9 | 10 | this.m_IsClickable = true; 11 | this.m_ClickFunctions = []; 12 | } 13 | 14 | Click() 15 | { 16 | if(this.m_ClickFunctions && this.m_ClickFunctions[0]) 17 | { 18 | this.m_ClickFunctions[0](this); 19 | } 20 | } 21 | }); 22 | 23 | export default Clickable; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Comms/CommsMessage.js: -------------------------------------------------------------------------------- 1 | class CommsMessage 2 | { 3 | constructor(data) 4 | { 5 | this.Data = data.data || null; 6 | this.Function = data.function; 7 | } 8 | } 9 | 10 | module.exports = CommsMessage; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Comms/EntityTransportReference.js: -------------------------------------------------------------------------------- 1 | class EntityTransportReference 2 | { 3 | constructor(data) 4 | { 5 | this.ID = data.ID; 6 | this.Reference = data.Reference; 7 | this.Component = data.Component; 8 | } 9 | } 10 | 11 | module.exports = EntityTransportReference; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Comms/MessageTransportObject.js: -------------------------------------------------------------------------------- 1 | class MessageTransportObject 2 | { 3 | constructor(data) 4 | { 5 | this.Origin = data.Origin; 6 | this.Destination = data.Destination; 7 | this.Message = data.Message; 8 | this.Delay = data.Delay; 9 | this.Sent = Date.now(); 10 | this.Received = 0; 11 | } 12 | } 13 | 14 | module.exports = MessageTransportObject; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Movable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | let Movable = Mixin((superclass) => class extends superclass 5 | { 6 | constructor() 7 | { 8 | super(); 9 | } 10 | 11 | move() 12 | { 13 | } 14 | }); 15 | 16 | export default Movable; -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/mixins/Savable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | 5 | let Savable = Mixin((superclass) => class extends superclass 6 | { 7 | constructor() 8 | { 9 | super(); 10 | 11 | this.m_IsSavable = true; 12 | } 13 | 14 | GetSavableData() 15 | { 16 | return this.DataModel().ToJSON(); 17 | } 18 | }); 19 | 20 | export default Savable; 21 | -------------------------------------------------------------------------------- /client-game-app/src/engine/entity/models/ComponentModel.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | class ComponentModel 4 | { 5 | constructor(object) 6 | { 7 | this.ARGS = object.m_Args || {}; 8 | this.ARGS.Parent = this.ARGS.Parent ? this.ARGS.Parent.m_ID : object.m_Parent ? object.m_Parent.m_ID : -1; 9 | this.NAME = object.constructor.name || "Component"; 10 | this.UPDATEABLE = object.m_Updateable || false; 11 | } 12 | 13 | ToJSON() 14 | { 15 | return {args:this.ARGS, name:this.NAME, updateable:this.UPDATEABLE}; 16 | } 17 | } 18 | 19 | export default ComponentModel; 20 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/entities.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.entities = () => ENGINE.m_World.m_FlatEntities; 6 | let entities = window.entities; 7 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/gmodel.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.gmodel = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "gmodel"); 6 | let gmodel = window.gmodel; 7 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/json.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.json = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "json"); 6 | let json = window.json; 7 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/material.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.material = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "material"); 6 | let material = window.material; 7 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/model.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.model = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "model"); 6 | let model = window.model; 7 | -------------------------------------------------------------------------------- /client-game-app/src/engine/util/global/texture.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.texture = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "texture"); 6 | let texture = window.texture; 7 | -------------------------------------------------------------------------------- /client-game-app/src/home/Home.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../engine/entity/entities/Entity"; 4 | 5 | class Home 6 | { 7 | constructor() 8 | { 9 | this.m_UpdateIntervalID = -1; 10 | ENGINE.OnInitialised = () => this.Initialise(); 11 | } 12 | 13 | Initialise() 14 | { 15 | ENGINE.m_World.m_Camera.position.set(-140.65558286328287, 101.31431689725994, 149.16004438380608); 16 | ENGINE.m_World.m_Camera.quaternion.set(-0.313321793870273, 0.638001400182456, 1.2988145120070227, 0.6570095484000732); 17 | Entity.FromFile( 18 | { 19 | "pos": 20 | { 21 | "x":15, 22 | "y":45, 23 | "z":125 24 | }, 25 | "rot": 26 | { 27 | "x":0, 28 | "y":0, 29 | "z":0, 30 | "w":1 31 | }, 32 | "scale": 33 | { 34 | "x": 25, 35 | "y": 25, 36 | "z": 25 37 | }, 38 | "parent":0, 39 | "entities":[], 40 | "components": 41 | [ 42 | { 43 | "args": 44 | { 45 | }, 46 | "name":"BasicBoxMeshRenderComponent", 47 | "updateable":false 48 | } 49 | ] 50 | }, entities()[0], new THREE.Vector3(0,0,0)); 51 | this.m_UpdateIntervalID = setInterval(this.Update, 1000/60); 52 | } 53 | 54 | Destroy() 55 | { 56 | clearInterval(this.m_UpdateIntervalID); 57 | } 58 | 59 | Update() 60 | { 61 | try 62 | { 63 | entities()[0].SetRotationY(entities()[0].m_Rotation.y + 0.01); 64 | entities()[0].SetRotationZ(entities()[0].m_Rotation.z + 0.01); 65 | } 66 | catch(e) {} 67 | } 68 | } 69 | 70 | export default Home; -------------------------------------------------------------------------------- /client-game-app/src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue'; 4 | 5 | //import BootstrapVue from 'bootstrap-vue'; 6 | //import 'bootstrap/dist/css/bootstrap.css'; 7 | //import 'bootstrap-vue/dist/bootstrap-vue.css'; 8 | //Vue.use(BootstrapVue); 9 | 10 | 11 | import 'vue-awesome/icons'; 12 | import Icon from 'vue-awesome/components/Icon' 13 | Vue.component('icon', Icon); 14 | 15 | 16 | import router from './router'; 17 | 18 | 19 | 20 | import Engine from "./engine/Engine"; 21 | import * as THREE from "three"; 22 | 23 | //window.THREE = require("./libs/three.min.js"); 24 | //window.THREE = require("./../../../three.js/build/three.js"); 25 | 26 | require("./libs/PointerLockControls"); 27 | import * as CANNON from 'cannon-es'; 28 | //window.CANNON = require("./libs/cannon.min.js"); 29 | window.CannonDebugRenderer = require("./libs/CannonDebugRenderer.js.old"); 30 | window.OrbitControls = require("./libs/OrbitControls"); 31 | window.OBJLoader = require("./libs/OBJLoader.js.old"); 32 | window.QuickHull = require("./libs/QuickHull"); 33 | window.DragControls = require("./libs/DragControls"); 34 | window.ConvexGeometry = require("./libs/ConvexGeometry"); 35 | window._ = require("./libs/lodash.min.js"); 36 | window.CONFIG = require("./config/config.json"); 37 | require("./libs/GLTFLoader"); 38 | 39 | window.ENGINE = new Engine(); 40 | 41 | import App from './App'; 42 | Vue.config.productionTip = false 43 | 44 | /* eslint-disable no-new */ 45 | new Vue({ 46 | el: '#app', 47 | router, 48 | components: { App }, 49 | template: '' 50 | }) 51 | -------------------------------------------------------------------------------- /client-game-app/src/router/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue'; 2 | import Router from 'vue-router'; 3 | 4 | import Home from '@/components/Home'; 5 | import Play from '@/components/Play'; 6 | import Desert from '@/components/Desert'; 7 | import Edit from '@/components/Edit'; 8 | import EntityCreate from '@/components/EntityCreate'; 9 | 10 | Vue.use(Router) 11 | 12 | export default new Router({ 13 | routes: [ 14 | { 15 | path: '/', 16 | name: 'Home', 17 | component: Home 18 | }, 19 | { 20 | path: '/Play', 21 | name: 'Play', 22 | component: Play 23 | }, 24 | { 25 | path: '/Desert', 26 | name: 'Desert', 27 | component: Desert 28 | }, 29 | { 30 | path: '/Editor', 31 | name: 'Edit', 32 | component: Edit 33 | }, 34 | { 35 | path: '/EntityCreator', 36 | name: 'EntityCreate', 37 | component: EntityCreate 38 | } 39 | ] 40 | }) 41 | -------------------------------------------------------------------------------- /client-game-app/static/empty.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app/static/empty.js -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/.eslintignore: -------------------------------------------------------------------------------- 1 | **/* -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | 6 | # local env files 7 | .env.local 8 | .env.*.local 9 | 10 | # Log files 11 | npm-debug.log* 12 | yarn-debug.log* 13 | yarn-error.log* 14 | pnpm-debug.log* 15 | 16 | # Editor directories and files 17 | .idea 18 | .vscode 19 | *.suo 20 | *.ntvs* 21 | *.njsproj 22 | *.sln 23 | *.sw? 24 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/README.md: -------------------------------------------------------------------------------- 1 | # 3js-gev-2 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "3js-gev-2", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "serve": "vue-cli-service serve --skip-plugins @vue/cli-plugin-eslint", 7 | "build": "vue-cli-service build", 8 | "lint": "vue-cli-service lint" 9 | }, 10 | "dependencies": { 11 | "@quasar/extras": "^1.0.0", 12 | "axios": "^0.21.1", 13 | "cannon-es": "^0.18.0", 14 | "cannon-es-debugger": "^0.1.4", 15 | "core-js": "^3.6.5", 16 | "jquery": "^3.6.0", 17 | "mixwith": "^0.1.1", 18 | "quasar": "^2.0.0", 19 | "three": "^0.130.0", 20 | "vue": "^3.0.0", 21 | "vue-color": "^2.8.1", 22 | "vue-router": "^4.0.0-0", 23 | "vue-unique-id": "^3.2.1" 24 | }, 25 | "devDependencies": { 26 | "@vue/cli-plugin-babel": "~4.5.0", 27 | "@vue/cli-plugin-eslint": "~4.5.0", 28 | "@vue/cli-plugin-router": "~4.5.0", 29 | "@vue/cli-service": "~4.5.0", 30 | "@vue/compiler-sfc": "^3.0.0", 31 | "babel-eslint": "^10.1.0", 32 | "eslint": "^6.7.2", 33 | "eslint-plugin-vue": "^7.0.0", 34 | "vue-cli-plugin-quasar": "~4.0.1" 35 | }, 36 | "eslintConfig": { 37 | "root": true, 38 | "env": { 39 | "node": true 40 | }, 41 | "extends": [ 42 | "plugin:vue/vue3-essential", 43 | "eslint:recommended" 44 | ], 45 | "parserOptions": { 46 | "parser": "babel-eslint" 47 | }, 48 | "rules": {} 49 | }, 50 | "browserslist": [ 51 | "> 1%", 52 | "last 2 versions", 53 | "not dead" 54 | ] 55 | } 56 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app2/3js-gev-2/public/favicon.ico -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | <%= htmlWebpackPlugin.options.title %> 9 | 10 | 11 | 14 |
    15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/App.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 35 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/Game.js: -------------------------------------------------------------------------------- 1 | import Entity from "./engine/entity/entities/Entity"; 2 | 3 | class Game { 4 | constructor() { 5 | ENGINE.OnInitialised = () => this.Initialise(); 6 | } 7 | 8 | Initialise() { 9 | this.LoadWorld(); 10 | 11 | ENGINE.m_World.m_Camera.position.set(-120.65558286328287, 151.31431689725994, 49.16004438380608); 12 | ENGINE.m_World.m_Camera.quaternion.set(-0.313321793870273, -0.638001400182456, -0.2988145120070227, 0.6570095484000732); 13 | 14 | ENGINE.m_World.m_Controls = new THREE.OrbitControls(ENGINE.m_World.m_Camera, ENGINE.m_World.m_Renderer.domElement); 15 | } 16 | 17 | LoadWorld() { 18 | try { 19 | let data = json(`/data/world/0.json`); 20 | 21 | Entity.FromFile( 22 | data, 23 | null, 24 | new THREE.Vector3(0, 0, 0) 25 | ); 26 | 27 | Entity.FromFile( 28 | { 29 | "pos": { "x": 0, "y": 150, "z": 50 }, 30 | "rot": { "x": 0, "y": 0, "z": 0, "w": 1 }, 31 | "parent": 0, 32 | "entities": [], 33 | "components": 34 | [ 35 | { 36 | "args": 37 | { 38 | "Radius": 2, 39 | "Segments": 36 40 | }, 41 | "name": "BasicSphereMeshRenderComponent" 42 | }, 43 | { 44 | "args": { "Type": 1, "BodySettings": { "type": "sphere", "radius": 2 } }, 45 | "name": "BasicPhysicsComponent" 46 | }, 47 | { 48 | "args": {}, 49 | "name": "MinigolfClientBallControlComponent" 50 | } 51 | ], 52 | }, entities()[0], new THREE.Vector3(0, 0, 0)); 53 | } 54 | catch (Exception) { 55 | setTimeout(this.LoadWorld.bind(this), 500); 56 | } 57 | } 58 | 59 | Update() { 60 | this.m_Controls.update(); 61 | } 62 | } 63 | 64 | export default Game; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app2/3js-gev-2/src/assets/logo.png -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/assets/main.css: -------------------------------------------------------------------------------- 1 | 2 | .q-tree__node-collapsible { 3 | overflow: hidden !important; 4 | } -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/Home.vue: -------------------------------------------------------------------------------- 1 | 28 | 29 | 64 | 65 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/Play.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 23 | 24 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/menu/editor/Generic/BooleanEditComponent.vue: -------------------------------------------------------------------------------- 1 | 16 | 17 | 51 | 52 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/menu/editor/Generic/EntityTileComponent.vue: -------------------------------------------------------------------------------- 1 | 15 | 16 | 53 | 54 | 90 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/menu/editor/Panel/BottomPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 30 | 31 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/menu/editor/Panel/LeftPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 35 | 36 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/components/menu/editor/Panel/RightPanelComponent.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 33 | 34 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/config/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "host2": "217.155.7.240:9090", 3 | "host": "localhost:9090" 4 | } 5 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/config/external_cdn_libs.json: -------------------------------------------------------------------------------- 1 | [ 2 | "https://code.jquery.com/jquery-1.12.4.min.js", 3 | "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js", 4 | "https://cdnjs.cloudflare.com/ajax/libs/cannon.js/0.6.2/cannon.min.js" 5 | ] 6 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/mixins/EntityTreeView.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | // Dependencies 4 | // @Engine@ 5 | // @World@ 6 | // @Entity@ 7 | // @Component@ 8 | 9 | let EntityTreeView = (Main) => class extends Main 10 | { 11 | constructor() 12 | { 13 | super(); 14 | 15 | this.m_TreeViewElement = $("#EntityTreeViewView"); 16 | } 17 | 18 | render() 19 | { 20 | this.m_TreeViewElement.empty(); 21 | let ents_html = []; 22 | ENGINE.m_World.m_Entities.forEach(e => 23 | { 24 | ents_html.push(e.DataModel().ToHTML()); 25 | }); 26 | 27 | let tree_html = whiskers.render(WHTML["entity_tree_list_view_world_root"], 28 | { 29 | WorldEntities: ents_html 30 | }); 31 | 32 | this.m_TreeViewElement.append(tree_html); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/mixins/MaterialToolsControl.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let MaterialToolsControl = (Main) => class extends Main 4 | { 5 | constructor() 6 | { 7 | super(); 8 | 9 | this.m_SelectedTexture = ""; 10 | this.m_TextureBrowserIndex = 0; 11 | } 12 | 13 | SelectTexture(src) 14 | { 15 | this.m_SelectedTexture = src.replace("/textures/",""); 16 | } 17 | 18 | ApplyTexture() 19 | { 20 | this.m_ref_SelectedEntity.m_Components.RenderComponent.SetTexture(this.m_SelectedTexture); 21 | 22 | setTimeout(() => 23 | { 24 | this.FillMaterialEditor(this.m_SelectedTexture); 25 | }, 300); 26 | } 27 | 28 | OpenTextureBrowser() 29 | { 30 | $("#texture-select-modal").modal(); 31 | if(this.m_TextureBrowserIndex === 0) 32 | { 33 | this.LoadAndAppendTextureBrowserRow(0); 34 | this.LoadAndAppendTextureBrowserRow(1); 35 | 36 | this.m_TextureBrowserIndex = 1; 37 | } 38 | 39 | let container = $("#texture-browser-container"); 40 | 41 | container.bind('scroll', () => 42 | { 43 | if (Math.round(container.scrollTop() + container.innerHeight(), 10) >= 44 | Math.round(container[0].scrollHeight, 10)) 45 | { 46 | this.m_TextureBrowserIndex++; 47 | this.LoadAndAppendTextureBrowserRow(this.m_TextureBrowserIndex); 48 | } 49 | }); 50 | } 51 | 52 | LoadAndAppendTextureBrowserRow(row) 53 | { 54 | let texture_URIs = AssetCache.TextureList.slice(row*4, (row*4)+4); 55 | if(texture_URIs.length === 0) { return; } 56 | let texture_tiles = []; 57 | 58 | texture_URIs.forEach(URI => 59 | { 60 | texture_tiles.push(whiskers.render(WHTML["texture-browser-image-tile"], 61 | { 62 | ImageSrc: "/textures/" + URI.path 63 | })); 64 | }); 65 | 66 | $("#texture-browser-container").append(whiskers.render(WHTML["texture-browser-image-tile-row"], 67 | { 68 | ImageTiles: texture_tiles 69 | })); 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/mixins/WorldLoader.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../engine/entity/entities/Entity"; 4 | import {mix, Mixin} from "mixwith"; 5 | 6 | let WorldLoader = Mixin((superclass) => class extends superclass 7 | { 8 | constructor() 9 | { 10 | super(); 11 | } 12 | 13 | LoadWorld() 14 | { 15 | try 16 | { 17 | let data = json(`/data/world/0.json`); 18 | Entity.FromFile( 19 | data, 20 | null, 21 | new THREE.Vector3(0,0,0) 22 | ); 23 | } 24 | catch(Exception) 25 | { 26 | setTimeout(this.LoadWorld.bind(this), 50); 27 | } 28 | } 29 | }); 30 | 31 | export default WorldLoader; 32 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/component_modal_body.whtml: -------------------------------------------------------------------------------- 1 |
    4 | {else} 5 | class="tab-pane fade"> 6 | {/if} 7 |
    8 | {for key in componentKeys} 9 |
    10 | 11 | {key} 12 | 13 |
    14 | {/for} 15 |
    16 |
    17 | {for value in componentValues} 18 | 19 | {/for} 20 |
    21 |
    22 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/component_modal_tab.whtml: -------------------------------------------------------------------------------- 1 | {if firstComponent} 2 |
  • 3 | {else} 4 |
  • 5 | {/if} 6 | 7 | 8 | 9 | {componentName} 10 | 11 | 12 |
  • 13 | 14 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/entity_edit_transform_view.whtml: -------------------------------------------------------------------------------- 1 |
    2 |
    3 |
    4 |

    5 | Position 6 |

    7 |
    8 |
    9 |
    x: 0
    10 |
    y: 0
    11 |
    z: 0
    12 |
    13 |
    14 |
    15 |
    16 |

    17 | Scale 18 |

    19 |
    20 |
    21 |
    x: 0
    22 |
    y: 0
    23 |
    z: 0
    24 |
    25 |
    26 |
    27 |
    28 |

    29 | Rotation 30 |

    31 |
    32 |
    33 |
    x,y,z,w
    34 |
    35 |
    36 |
    37 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/entity_tree_list_view.whtml: -------------------------------------------------------------------------------- 1 | {if EntityHasChildren} 2 |
  • 3 |
    4 | 10 | 13 |
      {>EntityChildren}
    14 |
  • 15 | {else} 16 |
  • 17 |
    18 | 19 | {>EntityString} 20 | 23 | 24 |
  • 25 | {/if} 26 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/entity_tree_list_view_world_root.whtml: -------------------------------------------------------------------------------- 1 |
  • 2 |
    3 | 6 | 8 |
      {>WorldEntities}
    9 |
  • 10 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/texture-browser-image-tile-row.whtml: -------------------------------------------------------------------------------- 1 |
    2 | {for tile in ImageTiles} 3 | {tile} 4 | {/for} 5 |
    6 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/editor/views/texture-browser-image-tile.whtml: -------------------------------------------------------------------------------- 1 |
    2 | 7 |
    8 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/asset/GLTFRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import AssetRequest from "./AssetRequest"; 5 | import LOADSTATE from "./LoadState"; 6 | import {mix} from "mixwith"; 7 | 8 | 9 | class GLTFRequest extends mix(AssetRequest).with() 10 | { 11 | constructor(uri) 12 | { 13 | super(uri); 14 | } 15 | 16 | Initialise() 17 | { 18 | this.m_LoadState = LOADSTATE.INITIALISING; 19 | 20 | this.m_Loader = new THREE.GLTFLoader(); 21 | 22 | this.m_Loader.setPath(`http://${CONFIG.host}/models/`); 23 | //this.m_Loader.setCrossOrigin(""); 24 | //this.m_Loader.crossOrigin = ""; 25 | 26 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 27 | // - This should be issued by the web server.js 28 | // - Should expire after 5minutes or something 29 | // - Prevents ddos/spam/chinese theives 30 | 31 | this.OnInitialised(); 32 | } 33 | 34 | Download() 35 | { 36 | try 37 | { 38 | this.m_Loader.load 39 | ( 40 | this.m_FileName + "/" + this.m_URI, 41 | this.OnFinished.bind(this), 42 | this.OnProgress.bind(this), 43 | this.OnError.bind(this) 44 | ); 45 | this.OnDownloading(); 46 | } 47 | catch(Exception) 48 | { 49 | this.OnError(); 50 | } 51 | } 52 | 53 | OnFinished(gltf) 54 | { 55 | this.m_Asset = gltf; 56 | super.OnFinished(); 57 | } 58 | } 59 | 60 | export default GLTFRequest; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/asset/JSONDataRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import AssetRequest from "./AssetRequest"; 4 | import LOADSTATE from "./LoadState"; 5 | import {mix} from "mixwith"; 6 | 7 | const axios = require('axios'); 8 | 9 | class JSONDataRequest extends mix(AssetRequest).with() 10 | { 11 | constructor(uri) 12 | { 13 | super(uri); 14 | } 15 | 16 | Initialise() 17 | { 18 | this.m_LoadState = LOADSTATE.INITIALISING; 19 | 20 | this.OnInitialised(); 21 | } 22 | 23 | Download() 24 | { 25 | try 26 | { 27 | this.OnDownloading(); 28 | axios.get(`http://${CONFIG.host}${this.m_URI}`) 29 | .then((data) => this.OnFinished(data.data)) 30 | .catch((error) => this.OnError(error)); 31 | } 32 | catch(Exception) 33 | { 34 | this.OnError(Exception); 35 | } 36 | } 37 | 38 | OnFinished(json) 39 | { 40 | this.m_Asset = json; 41 | super.OnFinished(); 42 | } 43 | } 44 | 45 | export default JSONDataRequest; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/asset/LoadState.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | let LOADSTATE = {}; 4 | 5 | LOADSTATE.ERROR = 0; 6 | 7 | LOADSTATE.INACTIVE = 1; 8 | LOADSTATE.INITIALISING = 2; 9 | LOADSTATE.QUEUED = 4; 10 | LOADSTATE.INITIALISED = 8; 11 | LOADSTATE.DOWNLOADING = 16; 12 | LOADSTATE.COMPLETE = 32; 13 | LOADSTATE.PROCESS = 64; 14 | LOADSTATE.FINISHED = 128; 15 | LOADSTATE.CACHED = 256; 16 | LOADSTATE.DISPOSE = 512; 17 | 18 | export default LOADSTATE; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/asset/OBJRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import { OBJLoader } from "./../../libs/OBJLoader.js"; 5 | import AssetRequest from "./AssetRequest"; 6 | import LOADSTATE from "./LoadState"; 7 | import {mix} from "mixwith"; 8 | 9 | class OBJRequest extends mix(AssetRequest).with() 10 | { 11 | constructor(uri) 12 | { 13 | super(uri); 14 | } 15 | 16 | Initialise() 17 | { 18 | this.m_LoadState = LOADSTATE.INITIALISING; 19 | 20 | this.m_Loader = new OBJLoader(); 21 | 22 | this.m_Loader.setPath(`http://${CONFIG.host}/models/`); 23 | //this.m_Loader.setCrossOrigin(""); 24 | //this.m_Loader.crossOrigin = ""; 25 | 26 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 27 | // - This should be issued by the web server.js 28 | // - Should expire after 5minutes or something 29 | // - Prevents ddos/spam/chinese theives 30 | 31 | this.OnInitialised(); 32 | } 33 | 34 | Download() 35 | { 36 | try 37 | { 38 | this.m_Loader.load 39 | ( 40 | this.m_FileName + "/" + this.m_URI, 41 | this.OnFinished.bind(this), 42 | this.OnProgress.bind(this), 43 | this.OnError.bind(this) 44 | ); 45 | this.OnDownloading(); 46 | } 47 | catch(Exception) 48 | { 49 | this.OnError(); 50 | } 51 | } 52 | 53 | OnFinished(obj) 54 | { 55 | this.m_Asset = obj; 56 | super.OnFinished(); 57 | } 58 | } 59 | 60 | export default OBJRequest; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/asset/TextureRequest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import AssetRequest from "./AssetRequest"; 5 | import LOADSTATE from "./LoadState"; 6 | import {mix} from "mixwith"; 7 | 8 | class TextureRequest extends mix(AssetRequest).with() 9 | { 10 | constructor(uri) 11 | { 12 | super(uri); 13 | } 14 | 15 | Initialise() 16 | { 17 | this.m_LoadState = LOADSTATE.INITIALISING; 18 | 19 | THREE.ImageUtils.crossOrigin = ""; 20 | THREE.TextureLoader.prototype.crossOrigin = ""; 21 | this.m_Loader = new THREE.TextureLoader(); 22 | 23 | this.m_Loader.setPath(`http://${CONFIG.host}/textures`); 24 | this.m_Loader.setCrossOrigin(""); 25 | this.m_Loader.crossOrigin = ""; 26 | 27 | // TODO: Use .setWithCredentials with a server generated request key/token/idk 28 | // - This should be issued by the web server.js 29 | // - Should expire after 5minutes or something 30 | // - Prevents ddos/spam/chinese theives 31 | 32 | this.OnInitialised(); 33 | } 34 | 35 | Download() 36 | { 37 | try 38 | { 39 | this.m_Loader.load 40 | ( 41 | this.m_URI, 42 | this.OnFinished.bind(this), 43 | this.OnProgress.bind(this), 44 | this.OnError.bind(this) 45 | ); 46 | 47 | this.OnDownloading(); 48 | } 49 | catch(Exception) 50 | { 51 | this.OnError(); 52 | } 53 | } 54 | 55 | OnFinished(texture) 56 | { 57 | texture.format = THREE.RGBAFormat; 58 | texture.needsUpdate = true; 59 | this.m_Asset = texture; 60 | super.OnFinished(); 61 | } 62 | } 63 | 64 | export default TextureRequest; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/Component.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import ComponentModel from "./../models/ComponentModel"; 4 | 5 | class Component 6 | { 7 | constructor(args) 8 | { 9 | this.m_Args = args; 10 | 11 | this.m_Name = Component; 12 | this.m_Parent = args.Parent || null; 13 | this.m_Updateable = args.Updateable || false; 14 | 15 | this.m_LastInitialisedTime = 0; 16 | this.m_IsInitialised = false; 17 | } 18 | 19 | LoadAssets() 20 | { 21 | 22 | } 23 | 24 | Initialise() 25 | { 26 | } 27 | 28 | OnInitialised() 29 | { 30 | this.m_IsInitialised = true; 31 | } 32 | 33 | DataModel() { return new ComponentModel(this); } 34 | 35 | Name() { return this.constructor.name; } 36 | 37 | Update() 38 | { 39 | } 40 | 41 | Remove() 42 | { 43 | 44 | } 45 | } 46 | 47 | export default Component; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/DoorComponent/DoorComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class DoorComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Debuggable = false; 14 | 15 | this.m_Name = "DoorComponent"; 16 | 17 | this.m_IsLocked = false; 18 | this.m_IsOpen = false; 19 | this.m_IsClosed = false; 20 | 21 | } 22 | 23 | Initialise() 24 | { 25 | super.Initialise(); 26 | } 27 | 28 | OnInitialised() 29 | { 30 | 31 | this.m_IsInitialised = true; 32 | } 33 | 34 | Remove() 35 | { 36 | 37 | } 38 | 39 | Update() 40 | { 41 | } 42 | } 43 | 44 | export default DoorComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/LightComponent/LightComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import Entity from "./../../entities/Entity"; 5 | import Component from "./../Component"; 6 | import {mix} from "mixwith"; 7 | 8 | class LightComponent extends mix(Component).with() 9 | { 10 | constructor(args) 11 | { 12 | super(args); 13 | 14 | this.m_Debuggable = false; 15 | 16 | this.m_Name = "LightComponent"; 17 | 18 | this.m_Colour = new THREE.Color(1,1,1); 19 | 20 | this.m_Light = null; 21 | } 22 | 23 | Initialise() 24 | { 25 | super.Initialise(); 26 | } 27 | 28 | OnInitialised() 29 | { 30 | this.SetPosition( 31 | this.m_Parent.m_Position.x, 32 | this.m_Parent.m_Position.y, 33 | this.m_Parent.m_Position.z 34 | ); 35 | 36 | // this.m_Light.m_ParentEntity = this.m_Parent || null; 37 | 38 | this.m_Light.castShadow = this.m_Args.castShadow == void(0) ? true : this.m_Args.castShadow; 39 | 40 | this.m_Light.shadow.mapSize.width = 1024; 41 | this.m_Light.shadow.mapSize.height = 1024; 42 | this.m_Light.shadow.camera.near = 0.05; 43 | this.m_Light.shadow.camera.far = 750; 44 | this.m_Light.shadow.bias = -0.005; 45 | 46 | ENGINE.m_World.m_Scene.add(this.m_Light); 47 | this.m_IsInitialised = true; 48 | } 49 | 50 | SetColor(c) 51 | { 52 | this.m_Colour = c; 53 | this.m_Light.color.set(c); 54 | } 55 | 56 | SetPosition(x,y,z) 57 | { 58 | this.m_Light.position.set(x,y,z); 59 | } 60 | 61 | Remove() 62 | { 63 | ENGINE.m_World.m_Scene.remove(this.m_Light); 64 | delete this.m_Light; 65 | } 66 | 67 | Update() 68 | { 69 | } 70 | } 71 | 72 | export default LightComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/LightComponent/mixins/PointLightComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import LightComponent from "./../LightComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class PointLightComponent extends mix(LightComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | 18 | this.m_Light = new THREE.PointLight( 19 | Number(this.m_Args.color) || 0xFF4400, 20 | this.m_Args.intensity || 0.9, 21 | this.m_Args.distance || 520, 22 | this.m_Args.decay || 2 23 | ); 24 | 25 | 26 | this.OnInitialised(); 27 | } 28 | 29 | Update() 30 | { 31 | } 32 | } 33 | 34 | export default PointLightComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/MinigolfClientBallControlControlComponent/MinigolfClientBallControlComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class MinigolfClientBallControlComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Canvas = document.querySelector("canvas"); 14 | this.m_Canvas.addEventListener("click", this.MouseClick.bind(this), false); 15 | this.m_Dir = null; 16 | this.m_Length = null; 17 | this.m_Name = "MinigolfClientBallControlComponent"; 18 | } 19 | 20 | Initialise() 21 | { 22 | console.log("minigolf comp init"); 23 | super.Initialise(); 24 | 25 | this.OnInitialised(); 26 | } 27 | 28 | OnInitialised() 29 | { 30 | this.m_Arrow = new THREE.ArrowHelper(new THREE.Vector3(0,0,0), new THREE.Vector3(0,0,0), 15, 0x000000, 0); 31 | ENGINE.m_World.m_Scene.add(this.m_Arrow); 32 | this.m_IsInitialised = true; 33 | } 34 | 35 | MouseClick() 36 | { 37 | const force = this.m_Length ** 2; 38 | this.m_Parent.m_Components.PhysicsComponent.ApplyForce( 39 | this.m_Dir.x*force, 0, this.m_Dir.z*force 40 | ); 41 | } 42 | 43 | Update() 44 | { 45 | let m = ENGINE.m_Mouse.m_WorldPosition.clone(); 46 | const mworld = ENGINE.m_Mouse.m_WorldPosition.clone(); 47 | m.y = this.m_Parent.m_Position.y; 48 | this.m_Dir = m.sub(this.m_Parent.m_Position).normalize(); 49 | this.m_Length = Math.min(Math.max(mworld.distanceTo(this.m_Parent.m_Position), 0), 110); 50 | this.m_Arrow.setLength(this.m_Length, 0, 0); 51 | this.m_Arrow.setDirection(this.m_Dir); 52 | this.m_Arrow.position.set(this.m_Parent.m_Position.x, this.m_Parent.m_Position.y, this.m_Parent.m_Position.z); 53 | } 54 | } 55 | 56 | export default MinigolfClientBallControlComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/PathFindingNodeComponent/PathFindingNodeComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class PathFindingNodeComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Name = "PathFindingNodeComponent"; 14 | 15 | this.m_NodeID = args.NodeID !== undefined ? args.NodeID : -1; 16 | this.m_Neighbours = []; 17 | this.m_Previous = {}; 18 | this.m_Visited = false; 19 | this.m_Closed = false; 20 | 21 | this.t_G = 0; 22 | this.t_H = 0; 23 | this.t_F = 0; 24 | 25 | this.m_G = 0; 26 | this.m_H = 0; 27 | this.m_F = 0; 28 | } 29 | 30 | Reset() 31 | { 32 | this.m_Visited = false; 33 | this.m_Closed = false; 34 | this.m_Previous = {}; 35 | this.m_G = 0; 36 | this.m_H = 0; 37 | this.m_F = 0; 38 | this.t_G = 0; 39 | this.t_H = 0; 40 | this.t_F = 0; 41 | } 42 | 43 | GetNeighbours() 44 | { 45 | return this.m_Neighbours; 46 | } 47 | 48 | TG(Node) { this.t_G = Node.m_G + 2.5; return this.t_G; } 49 | 50 | G() 51 | { 52 | this.m_G = (this.m_Previous.m_G || 0) + 2.5; 53 | return this.m_G; 54 | } 55 | 56 | H(Node) 57 | { 58 | this.m_H = this.m_Parent.m_Position.distanceTo(Node.m_Parent.m_Position); 59 | return this.m_H || 0; 60 | } 61 | 62 | TH(Node) { this.t_H = this.m_Parent.m_Position.distanceTo(Node.m_Parent.m_Position); return this.t_H; } 63 | F(Node) { this.m_F = (this.G()||0) + (this.H(Node)||0); return this.m_F; } 64 | TF(Goal, Node) { this.t_F = (this.TG(Node)||0) + (this.TH(Goal)||0); return this.t_F; } 65 | 66 | Initialise() 67 | { 68 | super.Initialise(); 69 | this.m_IsInitialised = true; 70 | } 71 | 72 | Update() 73 | { 74 | super.Update(); 75 | } 76 | } 77 | 78 | export default PathFindingNodeComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/BasicBoxMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class BasicBoxMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | var geoBox = new THREE.BoxGeometry(1,1,1); 18 | geoBox.center(); 19 | 20 | var mshBox = new THREE.Mesh(geoBox, material(this.m_Args.material || "default")); 21 | mshBox.material.needsUpdate = true; 22 | mshBox.material.map.needsUpdate = true; 23 | 24 | this.m_Mesh = mshBox; 25 | this.m_Meshes = mshBox; 26 | this.OnInitialised(); 27 | } 28 | 29 | Update() 30 | { 31 | } 32 | } 33 | 34 | export default BasicBoxMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/BasicCylinderMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class BasicCylinderMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | 18 | var geoBox = new THREE.CylinderGeometry(25,25,25,8); 19 | geoBox.center(); 20 | 21 | var mshBox = new THREE.Mesh(geoBox, material("default")); 22 | mshBox.material.needsUpdate = true; 23 | mshBox.material.map.needsUpdate = true; 24 | 25 | this.m_Mesh = mshBox; 26 | this.m_Meshes = mshBox; 27 | this.OnInitialised(); 28 | } 29 | 30 | Update() 31 | { 32 | } 33 | } 34 | 35 | export default BasicCylinderMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/BasicHullMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class BasicHullMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Debuggable = true; 14 | 15 | var points = []; 16 | 17 | this.m_Points = args.Points; 18 | this.m_Points = this.m_Points.map(p => {return p.isVector3 ? p : new THREE.Vector3(p.x, p.y, p.z);}); 19 | } 20 | 21 | Initialise() 22 | { 23 | super.Initialise(); 24 | // var geometry = new THREE.ConvexBufferGeometry(this.m_Points); 25 | // geometry.center(); 26 | 27 | // var mesh = new THREE.Mesh(geometry, material("check"));/ 28 | // mesh.material.needsUpdate = true; 29 | // mesh.material.map.needsUpdate = true; 30 | 31 | // this.m_Mesh = mesh; 32 | // this.m_Meshes = mesh; 33 | this.OnInitialised(); 34 | } 35 | 36 | Update() 37 | { 38 | } 39 | } 40 | 41 | export default BasicHullMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/BasicShapeMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class BasicShapeMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Debuggable = false; 14 | 15 | var points = []; 16 | 17 | points[0] = new THREE.Vector2(0, 0); 18 | points[1] = new THREE.Vector2(100, 0); 19 | points[2] = new THREE.Vector2(100, 300); 20 | points[3] = new THREE.Vector2(300, 300); 21 | points[4] = new THREE.Vector2(300, 400); 22 | points[5] = new THREE.Vector2(100, 400); 23 | points[6] = new THREE.Vector2(100, 800); 24 | points[7] = new THREE.Vector2(0, 800); 25 | points[8] = new THREE.Vector2(0, 500); 26 | points[9] = new THREE.Vector2(-400, 500); 27 | points[10] = new THREE.Vector2(-400, 400); 28 | points[11] = new THREE.Vector2(0, 400); 29 | points[12] = new THREE.Vector2(0, 0); 30 | 31 | 32 | this.m_Points = args.Points || points; 33 | } 34 | 35 | Initialise() 36 | { 37 | super.Initialise(); 38 | 39 | let shape = new THREE.Shape(this.m_Points); 40 | let geometry = new THREE.ShapeBufferGeometry(shape); 41 | geometry.center(); 42 | let mesh = new THREE.Mesh(geometry, material("check")); 43 | mesh.material.needsUpdate = true; 44 | mesh.material.map.needsUpdate = true; 45 | 46 | mesh.rotateX(-Math.PI/2); 47 | 48 | this.m_Mesh = mesh; 49 | this.m_Meshes = mesh; 50 | this.OnInitialised(); 51 | } 52 | 53 | Update() 54 | { 55 | } 56 | } 57 | 58 | export default BasicShapeMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/BasicSphereMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class BasicSphereMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | 18 | var geoBox = new THREE.SphereGeometry( 19 | this.m_Args.Radius ? this.m_Args.Radius : 25, 20 | this.m_Args.Segments ? this.m_Args.Segments : 25, 21 | this.m_Args.Segments ? this.m_Args.Segments : 25 22 | ); 23 | geoBox.center(); 24 | 25 | var mshBox = new THREE.Mesh(geoBox, material(this.m_Args.material || "default")); 26 | mshBox.material.needsUpdate = true; 27 | mshBox.material.map.needsUpdate = true; 28 | 29 | this.m_Mesh = mshBox; 30 | this.m_Meshes = mshBox; 31 | this.OnInitialised(); 32 | } 33 | 34 | Update() 35 | { 36 | } 37 | } 38 | 39 | export default BasicSphereMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/FlameRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class FlameRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | } 13 | 14 | Initialise() 15 | { 16 | super.Initialise(); 17 | 18 | var geoBox = new THREE.SphereGeometry( 19 | 25, 25, 100 20 | ); 21 | 22 | geoBox.center(); 23 | 24 | const mat = material("flame"); 25 | if(mat == void(0)) throw new Error(); 26 | var mshBox = new THREE.Mesh(geoBox, mat); 27 | 28 | this.m_Mesh = mshBox; 29 | this.m_Meshes = mshBox; 30 | this.OnInitialised(); 31 | 32 | this.m_LastGreen = 1.0; 33 | } 34 | 35 | Update(dt) 36 | { 37 | const now = performance.now(); 38 | const delta = (now - (((now/1000) << 2 >> 2) * 1000)) / 1000; 39 | this.m_Mesh.material.uniforms.delta.value = delta; 40 | 41 | const light = this.m_Parent.m_Components.LightComponent; 42 | if(light) 43 | { 44 | this.m_LastGreen += (Math.random() - 0.5) * 0.05; 45 | this.m_LastGreen = this.m_LastGreen % 1; 46 | light.SetColor(new THREE.Color( 47 | 1.0, 48 | Math.min(Math.max(this.m_LastGreen, 0.25), 0.75), 49 | 0.0 50 | ).getHex()); 51 | } 52 | } 53 | } 54 | 55 | export default FlameRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/RenderComponent/mixins/HeightmapPlaneMeshRenderComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import RenderComponent from "./../RenderComponent"; 5 | import {mix} from "mixwith"; 6 | 7 | class HeightmapPlaneMeshRenderComponent extends mix(RenderComponent).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | console.log(args) 13 | } 14 | 15 | Initialise() 16 | { 17 | super.Initialise(); 18 | var geometry = new THREE.PlaneGeometry( 19 | this.m_Args.Size, 20 | this.m_Args.Size, 21 | this.m_Args.Divisions, 22 | this.m_Args.Divisions 23 | ); 24 | 25 | console.log(geometry) 26 | geometry.center(); 27 | 28 | console.log(this.m_Args.material); 29 | const material = window.material(this.m_Args.material || "default"); 30 | if(material == void(0)) throw "Not loaded"; 31 | var mshBox = new THREE.Mesh(geometry, material); 32 | //mshBox.material.needsUpdate = true; 33 | //mshBox.material.map.needsUpdate = true; 34 | console.log(mshBox) 35 | this.m_Mesh = mshBox; 36 | this.m_Meshes = mshBox; 37 | this.OnInitialised(); 38 | } 39 | 40 | Update() 41 | { 42 | } 43 | } 44 | 45 | export default HeightmapPlaneMeshRenderComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/TriggerComponent/TriggerComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Entity from "./../../entities/Entity"; 4 | import Component from "./../Component"; 5 | import {mix} from "mixwith"; 6 | 7 | class TriggerComponent extends mix(Component).with() 8 | { 9 | constructor(args) 10 | { 11 | super(args); 12 | 13 | this.m_Name = "TriggerComponent"; 14 | 15 | this.m_TriggerFunctions = []; 16 | 17 | this.m_TriggerByPlayerOnly = false; 18 | } 19 | 20 | Initialise() 21 | { 22 | super.Initialise(); 23 | 24 | this.m_TriggerByPlayerOnly = this.m_Args.playeronly || false; 25 | 26 | this.m_Parent.m_Components.PhysicsComponent.AddEventListener("collide", evt => 27 | { 28 | if(evt.body.m_ParentEntity.m_ID === this.m_Parent.m_ID) return; 29 | if(this.m_TriggerByPlayerOnly && evt.body.m_ParentEntity.m_Components.FPSPlayerControl) 30 | { 31 | this.OnTrigger(evt); 32 | } 33 | else if(!this.m_TriggerByPlayerOnly) 34 | { 35 | this.OnTrigger(evt); 36 | } 37 | }); 38 | 39 | this.OnInitialised(); 40 | } 41 | 42 | OnTrigger(evt) 43 | { 44 | if(this.m_TriggerFunctions !== null && Array.isArray(this.m_TriggerFunctions)) 45 | { 46 | this.m_TriggerFunctions.forEach(f => f(evt)); 47 | } 48 | } 49 | 50 | Update() 51 | { 52 | } 53 | } 54 | 55 | export default TriggerComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/components/WorldPieceComponent/WorldPieceComponent.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import Component from "./../Component"; 4 | import {mix} from "mixwith"; 5 | 6 | class WorldPieceComponent extends mix(Component).with() 7 | { 8 | constructor(args) 9 | { 10 | super(args); 11 | 12 | this.m_Name = "WorldPieceComponent"; 13 | this.m_PieceOrigin = this.m_Parent.m_Position; 14 | } 15 | 16 | Initialise() 17 | { 18 | super.Initialise(); 19 | 20 | 21 | this.OnInitialised(); 22 | } 23 | 24 | Update() 25 | { 26 | } 27 | } 28 | 29 | export default WorldPieceComponent; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/entities/BaseObject.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | class BaseObject 4 | { 5 | constructor() 6 | { 7 | } 8 | } 9 | 10 | export default BaseObject; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Clickable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | let Clickable = Mixin((superclass) => class extends superclass 5 | { 6 | constructor() 7 | { 8 | super(); 9 | 10 | this.m_IsClickable = true; 11 | this.m_ClickFunctions = []; 12 | } 13 | 14 | Click() 15 | { 16 | if(this.m_ClickFunctions && this.m_ClickFunctions[0]) 17 | { 18 | this.m_ClickFunctions[0](this); 19 | } 20 | } 21 | }); 22 | 23 | export default Clickable; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Comms/CommsMessage.js: -------------------------------------------------------------------------------- 1 | class CommsMessage 2 | { 3 | constructor(data) 4 | { 5 | this.Data = data.data || null; 6 | this.Function = data.function; 7 | } 8 | } 9 | 10 | module.exports = CommsMessage; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Comms/EntityTransportReference.js: -------------------------------------------------------------------------------- 1 | class EntityTransportReference 2 | { 3 | constructor(data) 4 | { 5 | this.ID = data.ID; 6 | this.Reference = data.Reference; 7 | this.Component = data.Component; 8 | } 9 | } 10 | 11 | module.exports = EntityTransportReference; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Comms/MessageTransportObject.js: -------------------------------------------------------------------------------- 1 | class MessageTransportObject 2 | { 3 | constructor(data) 4 | { 5 | this.Origin = data.Origin; 6 | this.Destination = data.Destination; 7 | this.Message = data.Message; 8 | this.Delay = data.Delay; 9 | this.Sent = Date.now(); 10 | this.Received = 0; 11 | } 12 | } 13 | 14 | module.exports = MessageTransportObject; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Movable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | let Movable = Mixin((superclass) => class extends superclass 5 | { 6 | constructor() 7 | { 8 | super(); 9 | } 10 | 11 | move() 12 | { 13 | } 14 | }); 15 | 16 | export default Movable; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/mixins/Savable.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import {mix, Mixin} from "mixwith"; 4 | 5 | let Savable = Mixin((superclass) => class extends superclass 6 | { 7 | constructor() 8 | { 9 | super(); 10 | 11 | this.m_IsSavable = true; 12 | } 13 | 14 | GetSavableData() 15 | { 16 | return this.DataModel().ToJSON(); 17 | } 18 | }); 19 | 20 | export default Savable; 21 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/entity/models/ComponentModel.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | class ComponentModel 4 | { 5 | constructor(object) 6 | { 7 | this.ARGS = object.m_Args || {}; 8 | this.ARGS.Parent = this.ARGS.Parent ? this.ARGS.Parent.m_ID : object.m_Parent ? object.m_Parent.m_ID : -1; 9 | this.NAME = object.constructor.name || "Component"; 10 | this.UPDATEABLE = object.m_Updateable || false; 11 | } 12 | 13 | ToJSON() 14 | { 15 | return {args:this.ARGS, name:this.NAME, updateable:this.UPDATEABLE}; 16 | } 17 | } 18 | 19 | export default ComponentModel; 20 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/entities.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.entities = () => ENGINE.m_World.m_FlatEntities; 6 | let entities = window.entities; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/gmodel.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.gmodel = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "gmodel"); 6 | let gmodel = window.gmodel; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/json.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.json = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "json"); 6 | let json = window.json; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/material.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.material = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "material"); 6 | let material = window.material; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/model.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.model = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "model"); 6 | let model = window.model; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/engine/util/global/texture.js: -------------------------------------------------------------------------------- 1 | // Dependencies 2 | // @Engine@ 3 | // @World@ 4 | 5 | window.texture = (uri) => window.ENGINE.m_AssetCache.GetAsset(uri, "texture"); 6 | let texture = window.texture; 7 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/home/Home.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | import * as THREE from "three"; 4 | import Entity from "./../engine/entity/entities/Entity"; 5 | 6 | class Home 7 | { 8 | constructor() 9 | { 10 | this.m_UpdateIntervalID = -1; 11 | ENGINE.OnInitialised = () => this.Initialise(); 12 | } 13 | 14 | Initialise() 15 | { 16 | ENGINE.m_World.m_Camera.position.set(-140.65558286328287, 101.31431689725994, 149.16004438380608); 17 | ENGINE.m_World.m_Camera.quaternion.set(-0.313321793870273, 0.638001400182456, 1.2988145120070227, 0.6570095484000732); 18 | Entity.FromFile( 19 | { 20 | "pos": 21 | { 22 | "x":15, 23 | "y":45, 24 | "z":125 25 | }, 26 | "rot": 27 | { 28 | "x":0, 29 | "y":0, 30 | "z":0, 31 | "w":1 32 | }, 33 | "scale": 34 | { 35 | "x": 25, 36 | "y": 25, 37 | "z": 25 38 | }, 39 | "parent":0, 40 | "entities":[], 41 | "components": 42 | [ 43 | { 44 | "args": 45 | { 46 | }, 47 | "name":"BasicBoxMeshRenderComponent", 48 | "updateable":false 49 | } 50 | ] 51 | }, entities()[0], new THREE.Vector3(0,0,0)); 52 | this.m_UpdateIntervalID = setInterval(this.Update, 1000/60); 53 | } 54 | 55 | Destroy() 56 | { 57 | clearInterval(this.m_UpdateIntervalID); 58 | } 59 | 60 | Update() 61 | { 62 | try 63 | { 64 | entities()[0].SetRotationY(entities()[0].m_Rotation.y + 0.01); 65 | entities()[0].SetRotationZ(entities()[0].m_Rotation.z + 0.01); 66 | } 67 | catch(e) {} 68 | } 69 | } 70 | 71 | export default Home; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/libs/ConvexGeometry.js: -------------------------------------------------------------------------------- 1 | import { 2 | BufferGeometry, 3 | Float32BufferAttribute 4 | } from 'three'; 5 | 6 | import { ConvexHull } from './ConvexHull'; 7 | 8 | class ConvexGeometry extends BufferGeometry { 9 | 10 | constructor( points ) { 11 | 12 | super(); 13 | 14 | // buffers 15 | 16 | const vertices = []; 17 | const normals = []; 18 | 19 | if ( ConvexHull === undefined ) { 20 | 21 | console.error( 'THREE.ConvexBufferGeometry: ConvexBufferGeometry relies on ConvexHull' ); 22 | 23 | } 24 | 25 | const convexHull = new ConvexHull().setFromPoints( points ); 26 | 27 | // generate vertices and normals 28 | 29 | const faces = convexHull.faces; 30 | 31 | for ( let i = 0; i < faces.length; i ++ ) { 32 | 33 | const face = faces[ i ]; 34 | let edge = face.edge; 35 | 36 | // we move along a doubly-connected edge list to access all face points (see HalfEdge docs) 37 | 38 | do { 39 | 40 | const point = edge.head().point; 41 | 42 | vertices.push( point.x, point.y, point.z ); 43 | normals.push( face.normal.x, face.normal.y, face.normal.z ); 44 | 45 | edge = edge.next; 46 | 47 | } while ( edge !== face.edge ); 48 | 49 | } 50 | 51 | // build geometry 52 | 53 | this.setAttribute( 'position', new Float32BufferAttribute( vertices, 3 ) ); 54 | this.setAttribute( 'normal', new Float32BufferAttribute( normals, 3 ) ); 55 | 56 | } 57 | 58 | } 59 | 60 | export { ConvexGeometry }; -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/main.js: -------------------------------------------------------------------------------- 1 | import { createApp } from 'vue' 2 | import App from './App.vue' 3 | 4 | import router from './router'; 5 | import "./libs/bootstrap.css"; 6 | import './../src/assets/main.css'; 7 | 8 | import Engine from "./engine/Engine"; 9 | import * as THREE from "three"; 10 | 11 | import * as CANNON from 'cannon-es'; 12 | import { Quasar } from 'quasar' 13 | import quasarUserOptions from './quasar-user-options' 14 | 15 | 16 | window.OrbitControls = require("./libs/OrbitControls"); 17 | window.OBJLoader = require("./libs/OBJLoader.js"); 18 | window.ConvexHull = require("./libs/ConvexHull"); 19 | window.DragControls = require("./libs/DragControls"); 20 | window.ConvexGeometry = require("./libs/ConvexGeometry"); 21 | window._ = require("./libs/lodash.min.js"); 22 | window.CONFIG = require("./config/config.json"); 23 | require("./libs/GLTFLoader"); 24 | 25 | window.ENGINE = new Engine(); 26 | 27 | createApp(App).use(Quasar, quasarUserOptions).use(router).mount('#app') 28 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/quasar-user-options.js: -------------------------------------------------------------------------------- 1 | 2 | import 'quasar/dist/quasar.css' 3 | import '@quasar/extras/material-icons/material-icons.css' 4 | 5 | // To be used on app.use(Quasar, { ... }) 6 | export default { 7 | config: {}, 8 | plugins: { 9 | } 10 | } -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/router/index.js: -------------------------------------------------------------------------------- 1 | import { createRouter, createWebHashHistory } from 'vue-router' 2 | 3 | import Home from '@/components/Home'; 4 | import Play from '@/components/Play'; 5 | import Desert from '@/components/Desert'; 6 | import Edit from '@/components/Edit'; 7 | import EntityCreate from '@/components/EntityCreate'; 8 | 9 | const routes = [ 10 | { 11 | path: '/', 12 | name: 'Home', 13 | component: Home 14 | }, 15 | { 16 | path: '/Play', 17 | name: 'Play', 18 | component: Play 19 | }, 20 | { 21 | path: '/Desert', 22 | name: 'Desert', 23 | component: Desert 24 | }, 25 | { 26 | path: '/Editor', 27 | name: 'Edit', 28 | component: Edit 29 | }, 30 | { 31 | path: '/EntityCreator', 32 | name: 'EntityCreate', 33 | component: EntityCreate 34 | } 35 | ] 36 | 37 | const router = createRouter({ 38 | history: createWebHashHistory(), 39 | routes 40 | }) 41 | 42 | export default router 43 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/views/About.vue: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/src/views/Home.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 19 | -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/static/empty.js: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/client-game-app2/3js-gev-2/static/empty.js -------------------------------------------------------------------------------- /client-game-app2/3js-gev-2/vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | pluginOptions: { 3 | quasar: { 4 | importStrategy: 'kebab', 5 | rtlSupport: false 6 | } 7 | }, 8 | transpileDependencies: [ 9 | 'quasar' 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /resource-api/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 9090 3 | } -------------------------------------------------------------------------------- /resource-api/content/entities/shapes/box/box.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | }, 29 | "name":"BasicBoxMeshRenderComponent", 30 | "updateable":false 31 | }, 32 | { 33 | "args": 34 | { 35 | "Type": 2, 36 | "BodySettings": 37 | { 38 | "type": "box", 39 | "material": 40 | { 41 | "friction": 400, 42 | "restitution": 3, 43 | "stiffness": 1e8, 44 | "relaxation": 3, 45 | "frictionstiffness": 1e8 46 | }, 47 | "mass": 3, 48 | "angularDamping": 0.1, 49 | "linearDamping": 0.9, 50 | "fixedRotation": false 51 | } 52 | }, 53 | "name":"BasicPhysicsComponent", 54 | "updateable":false 55 | } 56 | ] 57 | } -------------------------------------------------------------------------------- /resource-api/content/entities/shapes/box/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/shapes/box/box.png -------------------------------------------------------------------------------- /resource-api/content/entities/shapes/sphere/sphere.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": {"x":0,"y":150,"z":0}, 3 | "rot": {"x":0,"y":0,"z":0,"w":1}, 4 | "scale": 5 | { 6 | "x": 1, 7 | "y": 1, 8 | "z": 1 9 | }, 10 | "parent":0, 11 | "entities":[], 12 | "components": 13 | [ 14 | { 15 | "args": 16 | { 17 | "Radius": 25, 18 | "Segments": 36 19 | }, 20 | "name": "BasicSphereMeshRenderComponent" 21 | }, 22 | { 23 | "args": 24 | { 25 | "Type": 2, 26 | "BodySettings": 27 | { 28 | "type":"sphere", 29 | "radius":25, 30 | "material": 31 | { 32 | "friction": 400, 33 | "restitution": 3, 34 | "stiffness": 1e8, 35 | "relaxation": 3, 36 | "frictionstiffness": 1e8 37 | }, 38 | "mass": 3, 39 | "angularDamping": 0.1, 40 | "linearDamping": 0.9, 41 | "fixedRotation": false 42 | } 43 | }, 44 | "name": "BasicPhysicsComponent" 45 | } 46 | ] 47 | } 48 | -------------------------------------------------------------------------------- /resource-api/content/entities/shapes/sphere/sphere.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/shapes/sphere/sphere.png -------------------------------------------------------------------------------- /resource-api/content/entities/terrain/PaintedTerrain/Painted Terrain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/terrain/PaintedTerrain/Painted Terrain.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/boat01/boat01.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":0, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "boat01.obj", 29 | "texture": "/boat01_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/boat01/crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/boat01/crate.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/crate/crate.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":0, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "crate.obj", 29 | "texture": "/crate_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | }, 34 | { 35 | "args": 36 | { 37 | "model": "/models/crate/crate.phys", 38 | "type": 1, 39 | "mass": 10 40 | }, 41 | "name":"OBJPhysicsComponent", 42 | "updateable":false 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/crate/crate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/crate/crate.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/directors_chair/directors_chair.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "Directors_Chair.obj" 29 | }, 30 | "name":"OBJRenderComponent", 31 | "updateable":false 32 | }, 33 | { 34 | "args": 35 | { 36 | "model": "/models/Directors_Chair/Directors_Chair.phys" 37 | }, 38 | "name":"OBJPhysicsComponent", 39 | "updateable":false 40 | } 41 | ] 42 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/directors_chair/directors_chair.phys: -------------------------------------------------------------------------------- 1 | {"backrest":{"type":1,"pos":{"x":0,"y":204,"z":-28.5},"scale":{"x":37.5,"y":11,"z":1},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat":{"type":1,"pos":{"x":0,"y":149,"z":0},"scale":{"x":34,"y":1,"z":25},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_frame_l":{"type":1,"pos":{"x":38.5,"y":150,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_arm_l":{"type":1,"pos":{"x":38.5,"y":180,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_frame_r":{"type":1,"pos":{"x":-38.5,"y":150,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_arm_r":{"type":1,"pos":{"x":-38.5,"y":180,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_leg_fr":{"type":1,"pos":{"x":0,"y":115,"z":22},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":0.9999999999999998},"r":0.8267349088394195}},"seat_leg_fl":{"type":1,"pos":{"x":0,"y":114,"z":19.5},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":-0.9999999999999998},"r":0.8267349088394195}},"seat_leg_br":{"type":1,"pos":{"x":0,"y":115,"z":-22},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":0.9999999999999998},"r":0.8267349088394195}},"seat_leg_bl":{"type":1,"pos":{"x":0,"y":114,"z":-19.5},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":-0.9999999999999998},"r":0.8267349088394195}}} -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/directors_chair/directors_chair.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/directors_chair/directors_chair.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/directors_chair_nophys/directors_chair_nophys.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "Directors_Chair.obj" 29 | }, 30 | "name":"OBJRenderComponent", 31 | "updateable":false 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/directors_chair_nophys/directors_chair_nophys.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/directors_chair_nophys/directors_chair_nophys.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/door_a1/door_a1.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":0, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "door_a1.obj", 29 | "texture": "/door_a1_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | }, 34 | { 35 | "args": 36 | { 37 | "model": "/models/door_a1/door_a1.phys", 38 | "type": 2, 39 | "mass": 0 40 | }, 41 | "name":"OBJPhysicsComponent", 42 | "updateable":false 43 | } 44 | ] 45 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/door_a1/door_a1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/door_a1/door_a1.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/fence_01/fence_01.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "fence_01.obj", 29 | "texture": "/fence_01_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/fence_01/fence_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/fence_01/fence_01.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/fence_02/fence_02.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "fence_02.obj", 29 | "texture": "/fence_02_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/fence_02/fence_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/fence_02/fence_02.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/flame/flame.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | }, 29 | "name":"FlameRenderComponent", 30 | "updateable":false 31 | } 32 | ] 33 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/gun/gun.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 40, 18 | "y": 40, 19 | "z": 40 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "gun.obj", 29 | "texture": "/poker_chair.jpg" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/log_with_hole/log_with_hole.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "log_with_hole.obj", 29 | "texture": "/log_with_hole_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/log_with_hole/log_with_hole.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/log_with_hole/log_with_hole.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/poker_chair/poker_chair.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 40, 18 | "y": 40, 19 | "z": 40 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "poker_chair.obj", 29 | "texture": "/poker_chair.jpg" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/rock_cliff_face_a/rock_cliff_face_a.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":0, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "rock_cliff_face_a.obj", 29 | "texture": "/rock_cliff_face_a_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/rock_cliff_face_a/rock_cliff_face_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/rock_cliff_face_a/rock_cliff_face_a.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/spider_bush/spider_bush.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "spider_bush.obj", 29 | "texture": "/spider_bush_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/spider_bush/spider_bush.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/spider_bush/spider_bush.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/spider_bush_2/spider_bush_2.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "spider_bush_2.obj", 29 | "texture": "/spider_bush_2_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/spider_bush_2/spider_bush_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/spider_bush_2/spider_bush_2.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/torch/torch.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":475, 5 | "y":0, 6 | "z":-900 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 7.5, 18 | "y": 7.5, 19 | "z": 7.5 20 | }, 21 | "entities": 22 | [ 23 | { 24 | "pos": 25 | { 26 | "x":0.5, 27 | "y":64, 28 | "z":-1.5 29 | }, 30 | "rot": 31 | { 32 | "x":0, 33 | "y":0, 34 | "z":0, 35 | "w":1 36 | }, 37 | "scale": 38 | { 39 | "x": 0.175, 40 | "y": 0.175, 41 | "z": 0.175 42 | }, 43 | "entities": [], 44 | "components": 45 | [ 46 | { 47 | "args": 48 | { 49 | "castShadow":false 50 | }, 51 | "name":"FlameRenderComponent", 52 | "updateable":false 53 | }, 54 | { 55 | "args": 56 | { 57 | "color": "#FF0000", 58 | "intensity": 0.7, 59 | "distance": 320, 60 | "decay": 2 61 | }, 62 | "name": "PointLightComponent", 63 | "updateable":false 64 | } 65 | ] 66 | } 67 | ], 68 | "components": 69 | [ 70 | { 71 | "args": 72 | { 73 | "model": "torch.obj", 74 | "texture": "/torch_texture.png" 75 | }, 76 | "name":"OBJRenderComponent", 77 | "updateable":false 78 | } 79 | ] 80 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree exposed_roots/tree_exposed_roots.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "tree_exposed_roots.obj", 29 | "texture": "/tree_exposed_roots_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree exposed_roots/tree_exposed_roots.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/tree exposed_roots/tree_exposed_roots.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree/tree.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "tree.obj" 29 | }, 30 | "name":"OBJRenderComponent", 31 | "updateable":false 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/tree/tree.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree2/tree.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/tree2/tree.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree2/tree2.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "tree2.obj", 29 | "texture": "/layout2_Tree2.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree_swamp_A_leaves/tree_swamp_A_leaves.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "tree_swamp_A_leaves.obj", 29 | "texture": "/tree_swamp_A_leaves_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree_swamp_A_leaves/tree_swamp_A_leaves.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/tree_swamp_A_leaves/tree_swamp_A_leaves.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree_tall_spider_base/tree_tall_spider_base.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "tree_tall_spider_base.obj", 29 | "texture": "/tree_tall_spider_base_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/tree_tall_spider_base/tree_tall_spider_base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/tree_tall_spider_base/tree_tall_spider_base.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wall_vegetation_mess/wall_vegetation_mess.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "wall_vegetation_mess.obj", 29 | "texture": "/wall_vegetation_mess_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wall_vegetation_mess/wall_vegetation_mess.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/wall_vegetation_mess/wall_vegetation_mess.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wall_vine_A/wall_vine_A.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "wall_vine_A.obj", 29 | "texture": "wall_vine_A_texture.obj" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wall_vine_A/wall_vine_A.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/wall_vine_A/wall_vine_A.png -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wood_pier/wood_pier.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "model": "wood_pier.obj", 29 | "texture": "/wood_pier_texture.png" 30 | }, 31 | "name":"OBJRenderComponent", 32 | "updateable":false 33 | } 34 | ] 35 | } -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wood_pier/wood_pier.phys: -------------------------------------------------------------------------------- 1 | {"rigid_shape":{"type":1,"pos":{"x":-0.25,"y":-0.015,"z":-0.5},"scale":{"x":3.75,"y":0.3,"z":9},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"rigid_shape_1":{"type":1,"pos":{"x":1.8,"y":-0.19,"z":-0.25},"scale":{"x":0.5,"y":3,"z":0.5},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}}} -------------------------------------------------------------------------------- /resource-api/content/entities/test_models/wood_pier/wood_pier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/test_models/wood_pier/wood_pier.png -------------------------------------------------------------------------------- /resource-api/content/entities/vegetation seeds/grass/grass_seed.json: -------------------------------------------------------------------------------- 1 | { 2 | "pos": 3 | { 4 | "x":0, 5 | "y":150, 6 | "z":0 7 | }, 8 | "rot": 9 | { 10 | "x":0, 11 | "y":0, 12 | "z":0, 13 | "w":1 14 | }, 15 | "scale": 16 | { 17 | "x": 1, 18 | "y": 1, 19 | "z": 1 20 | }, 21 | "parent": 0, 22 | "entities": [], 23 | "components": 24 | [ 25 | { 26 | "args": 27 | { 28 | "castShadow": false, 29 | "count": 1000, 30 | "distribution": "uniform", 31 | "lathe": { 32 | "heightSegments": 1, 33 | "vegHeight": 25, 34 | "vegWidth": 8.5 35 | }, 36 | "material": { 37 | "type": "VegetationMaterial", 38 | "texture": "/grass_2.png", 39 | "color": "0xFFFFFF", 40 | "repeat": [ 41 | 1, 42 | 1 43 | ] 44 | } 45 | }, 46 | "name":"VegetationMeshRenderComponent", 47 | "updateable":false 48 | } 49 | ] 50 | } -------------------------------------------------------------------------------- /resource-api/content/entities/vegetation seeds/grass/grass_seed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/entities/vegetation seeds/grass/grass_seed.png -------------------------------------------------------------------------------- /resource-api/content/materials/check.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/private/check.png", 4 | "color": "0x00FF00" 5 | } 6 | -------------------------------------------------------------------------------- /resource-api/content/materials/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/default.jpg", 4 | "color": "0xFFFFFF" 5 | } 6 | -------------------------------------------------------------------------------- /resource-api/content/materials/flame.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "FlameShader" 3 | } 4 | -------------------------------------------------------------------------------- /resource-api/content/materials/grass.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/grass2.jpg", 4 | "color": "0xFFFFFF", 5 | "repeat": [5, 2] 6 | } -------------------------------------------------------------------------------- /resource-api/content/materials/marblefloor.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/marblefloor.png", 4 | "color": "0xFFFFFF", 5 | "repeat": [4, 4] 6 | } -------------------------------------------------------------------------------- /resource-api/content/materials/stone1.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/stone1.png", 4 | "color": "0xFFFFFF", 5 | "repeat": [4, 4] 6 | } -------------------------------------------------------------------------------- /resource-api/content/materials/swirl.json: -------------------------------------------------------------------------------- 1 | { 2 | "type": "THREE.MeshPhongMaterial", 3 | "texture": "/private/swirl.jpg", 4 | "color": "0xFFFFFF" 5 | } 6 | -------------------------------------------------------------------------------- /resource-api/content/models/Directors_Chair/Directors_Chair.phys: -------------------------------------------------------------------------------- 1 | {"backrest":{"type":1,"pos":{"x":0,"y":54,"z":-28.5},"scale":{"x":37.5,"y":11,"z":1},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat":{"type":1,"pos":{"x":0,"y":-1,"z":0},"scale":{"x":34,"y":1,"z":25},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_frame_l":{"type":1,"pos":{"x":38.5,"y":0,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_arm_l":{"type":1,"pos":{"x":38.5,"y":30,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_frame_r":{"type":1,"pos":{"x":-38.5,"y":0,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_arm_r":{"type":1,"pos":{"x":-38.5,"y":30,"z":0},"scale":{"x":4,"y":2,"z":31},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"seat_leg_fr":{"type":1,"pos":{"x":0,"y":-35,"z":22},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":0.9999999999999998},"r":0.8267349088394195}},"seat_leg_fl":{"type":1,"pos":{"x":0,"y":-36,"z":19.5},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":-0.9999999999999998},"r":0.8267349088394195}},"seat_leg_br":{"type":1,"pos":{"x":0,"y":-35,"z":-22},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":0.9999999999999998},"r":0.8267349088394195}},"seat_leg_bl":{"type":1,"pos":{"x":0,"y":-36,"z":-19.5},"scale":{"x":1.5,"y":50,"z":1.5},"rot":{"axis":{"x":0,"y":0,"z":-0.9999999999999998},"r":0.8267349088394195}},"arm_cyl_l":{"type":2,"pos":{"x":38.5,"y":15,"z":26},"scale":{"rt":1.5,"rb":1.5,"h":27.5,"s":6},"rot":{"axis":{"x":0.9999999999999997,"y":0,"z":0},"r":1.653469817678839}},"arm_cyl_r":{"type":2,"pos":{"x":-38.5,"y":15,"z":26.75},"scale":{"rt":1.5,"rb":1.5,"h":27.5,"s":6},"rot":{"axis":{"x":0.9999999999999997,"y":0,"z":0},"r":1.653469817678839}},"back_cyl_l":{"type":2,"pos":{"x":38.5,"y":34,"z":-27.75},"scale":{"rt":1.5,"rb":1.5,"h":65,"s":6},"rot":{"axis":{"x":-1,"y":0,"z":0},"r":4.752665809276866}},"back_cyl_r":{"type":2,"pos":{"x":-38.5,"y":34,"z":-27.75},"scale":{"rt":1.5,"rb":1.5,"h":65,"s":6},"rot":{"axis":{"x":-1,"y":0,"z":0},"r":4.752665809276866}}} 2 | -------------------------------------------------------------------------------- /resource-api/content/models/Tree/Tree_phys.json: -------------------------------------------------------------------------------- 1 | { 2 | "cone": 3 | { 4 | "type":2, 5 | "pos":{"x":0,"y":0,"z":0}, 6 | "scale":{"rt":0,"rb":1,"h":2,"s":8}, 7 | "rot":{"axis":{"x":0,"y":0,"z":0},"r":1.5} 8 | }, 9 | "trunk": 10 | { 11 | "type":2, 12 | "pos":{"x":0,"y":-1.35,"z":0}, 13 | "scale":{"rt":0.1,"rb":0.1,"h":1,"s":8}, 14 | "rot":{"axis":{"x":0,"y":0,"z":0},"r":1.5} 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /resource-api/content/models/boat01/boat01.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'boat01.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 500 6 | Ka 0.8 0.8 0.8 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/boat01_seat01/boat01_seat01.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'boat01.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 500 6 | Ka 0.8 0.8 0.8 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/boat01_seat01/boat01_seat01.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.92.0 OBJ File: 'boat01.blend' 2 | # www.blender.org 3 | mtllib boat01_seat01.mtl 4 | o Chair_Cube.004 5 | v 1.947915 -0.170705 4.396491 6 | v -0.052085 -0.170705 4.396491 7 | v 1.947915 -0.170705 2.601105 8 | v 1.947915 1.829295 2.286845 9 | v -0.052085 -0.170705 2.601105 10 | v -0.052085 1.829295 2.286845 11 | v -0.052085 -0.170705 3.025532 12 | v -0.052085 1.829295 2.711272 13 | v 1.947915 -0.170705 3.025532 14 | v 1.947915 1.829295 2.711272 15 | v 1.947915 0.254337 4.396491 16 | v -0.052085 0.254337 4.396491 17 | v -0.052085 0.254337 2.601105 18 | v 1.947915 0.254337 2.601105 19 | v 1.947915 0.254337 3.025532 20 | v -0.052085 0.254337 3.025532 21 | vt 0.428130 0.446947 22 | vt 0.428130 0.250000 23 | vt 0.428130 0.000000 24 | vt 0.428130 0.803053 25 | vt 0.625000 0.446947 26 | vt 0.625000 0.500000 27 | vt 0.428130 0.500000 28 | vt 0.625000 0.750000 29 | vt 0.428130 0.750000 30 | vt 0.625000 0.803053 31 | vt 0.321947 0.500000 32 | vt 0.375000 0.500000 33 | vt 0.375000 0.750000 34 | vt 0.321947 0.750000 35 | vt 0.678053 0.500000 36 | vt 0.678053 0.750000 37 | vt 0.125000 0.500000 38 | vt 0.125000 0.750000 39 | vt 0.375000 0.250000 40 | vt 0.375000 0.446947 41 | vt 0.375000 0.803053 42 | vt 0.428130 1.000000 43 | vt 0.375000 1.000000 44 | vt 0.375000 0.000000 45 | vn 0.0000 1.0000 0.0000 46 | vn -1.0000 0.0000 0.0000 47 | vn 0.0000 -0.1957 -0.9807 48 | vn 0.0000 0.1957 0.9807 49 | vn 0.0000 -1.0000 0.0000 50 | vn 1.0000 0.0000 0.0000 51 | vn 0.0000 0.0000 -1.0000 52 | vn 0.0000 0.0000 1.0000 53 | usemtl None 54 | s off 55 | f 16/1/1 12/2/1 11/3/1 15/4/1 56 | f 16/1/2 8/5/2 6/6/2 13/7/2 57 | f 13/7/3 6/6/3 4/8/3 14/9/3 58 | f 10/10/4 8/5/4 16/1/4 15/4/4 59 | f 7/11/5 5/12/5 3/13/5 9/14/5 60 | f 6/6/1 8/15/1 10/16/1 4/8/1 61 | f 2/17/5 7/11/5 9/14/5 1/18/5 62 | f 14/9/6 4/8/6 10/10/6 15/4/6 63 | f 2/19/2 12/2/2 16/1/2 7/20/2 64 | f 3/13/6 14/9/6 15/4/6 9/21/6 65 | f 9/21/6 15/4/6 11/22/6 1/23/6 66 | f 5/12/7 13/7/7 14/9/7 3/13/7 67 | f 7/20/2 16/1/2 13/7/2 5/12/2 68 | f 1/24/8 11/3/8 12/2/8 2/19/8 69 | -------------------------------------------------------------------------------- /resource-api/content/models/boat01_windows/boat01_windows.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'boat01.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 500 6 | Ka 0.8 0.8 0.8 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/boat01_windows/boat01_windows.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.92.0 OBJ File: 'boat01.blend' 2 | # www.blender.org 3 | mtllib boat01_windows.mtl 4 | o Window_Cube.003 5 | v -1.162673 2.806243 5.609775 6 | v 1.625379 1.762045 7.100120 7 | v -1.613129 1.773495 7.166898 8 | v -1.553032 1.759943 6.857671 9 | v 1.078234 2.806243 5.602083 10 | v -1.186256 2.813683 5.693230 11 | v 1.095598 2.813684 5.700529 12 | v 1.539708 1.758184 6.806891 13 | vt 0.000000 0.132464 14 | vt 0.525394 0.000000 15 | vt 0.525394 0.946861 16 | vt 0.011481 0.799381 17 | vt 1.000000 0.000000 18 | vt 1.000000 0.904166 19 | vt 0.525394 0.784286 20 | vt 0.531627 0.129269 21 | vn 0.0080 0.8086 0.5884 22 | vn -0.0074 -0.7606 -0.6492 23 | usemtl None 24 | s off 25 | f 6/1/1 3/2/1 2/3/1 7/4/1 26 | f 8/5/2 4/6/2 1/7/2 5/8/2 27 | -------------------------------------------------------------------------------- /resource-api/content/models/crate/crate.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'crate.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/crate/crate.phys: -------------------------------------------------------------------------------- 1 | {"rigid_shape":{"type":1,"pos":{"x":0,"y":0,"z":0},"scale":{"x":2,"y":2,"z":2},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}}} -------------------------------------------------------------------------------- /resource-api/content/models/door_a1/door_a1.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'door_a1.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /resource-api/content/models/door_a1/door_a1.phys: -------------------------------------------------------------------------------- 1 | {"rigid_shape":{"type":1,"pos":{"x":0,"y":0,"z":0},"scale":{"x":0.1,"y":2.4,"z":1.55},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}}} -------------------------------------------------------------------------------- /resource-api/content/models/fence_01/fence_01.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'fence_01.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/fence_01/fence_01.phys: -------------------------------------------------------------------------------- 1 | {"rigid_shape":{"type":1,"pos":{"x":0,"y":0.8,"z":0},"scale":{"x":0.25,"y":2.2,"z":7.5},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"rigid_shape_1":{"type":1,"pos":{"x":-0.8,"y":0.45,"z":3.75},"scale":{"x":0.05,"y":2,"z":0.4},"rot":{"axis":{"x":0,"y":0,"z":-1.0000000000000002},"r":0.663225115757845}}} -------------------------------------------------------------------------------- /resource-api/content/models/fence_02/fence_02.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'fence_02.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/fence_02/fence_02.phys: -------------------------------------------------------------------------------- 1 | {"rigid_shape":{"type":1,"pos":{"x":0,"y":1,"z":0},"scale":{"x":0.1,"y":0.5,"z":4.25},"rot":{"axis":{"x":0.9888201906762255,"y":-0.14684745269861613,"z":-0.025893167959076105},"r":0.35293147946865655}},"rigid_shape_1":{"type":1,"pos":{"x":0,"y":0.8,"z":2.125},"scale":{"x":0.2,"y":2.2,"z":0.2},"rot":{"axis":{"x":1,"y":0,"z":0},"r":0}},"rigid_shape_2":{"type":1,"pos":{"x":0,"y":0.9,"z":-2},"scale":{"x":0.2,"y":2,"z":0.2},"rot":{"axis":{"x":0.999999999999991,"y":0,"z":0},"r":0.1396263401595478}}} -------------------------------------------------------------------------------- /resource-api/content/models/flame/flame.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'flame.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/gun/gun.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl Mat 5 | Ns 49.019608 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.148728 0.168273 0.187817 8 | Ks 1.000000 1.000000 1.000000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /resource-api/content/models/humanoid_base01_rigtest/humanoid_base01_rigtest.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'humanoid_base01_rigtest.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 323.999994 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.450000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /resource-api/content/models/log_with_hole/log_with_hole.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'log_with_hole.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/mushroom/mushroom.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'mushroom.blend' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 323.999994 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.450000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /resource-api/content/models/rock_cliff_face_a/rock_cliff_face_a.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/spider_bush_2/spider_bush_2.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/torch/torch.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'torch.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/torch/torch.phys: -------------------------------------------------------------------------------- 1 | { 2 | "rigid_shape": { 3 | "type": 1, 4 | "pos": { 5 | "x": 0.05, 6 | "y": 3, 7 | "z": -0.15 8 | }, 9 | "scale": { 10 | "x": 0.2, 11 | "y": 6.9, 12 | "z": 0.2 13 | }, 14 | "rot": { 15 | "axis": { 16 | "x": 1, 17 | "y": 0, 18 | "z": 0 19 | }, 20 | "r": 0 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /resource-api/content/models/tree2/tree2.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/tree_exposed_roots/tree_exposed_roots.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'tree_exposed_roots.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/tree_swamp_A_leaves/tree_swamp_A_leaves_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/models/tree_swamp_A_leaves/tree_swamp_A_leaves_texture.png -------------------------------------------------------------------------------- /resource-api/content/models/wall_vegetation_mess/wall_vegetation_mess.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'wall_vegetation_mess.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0.000000 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.800000 0.800000 0.800000 8 | Ks 0.800000 0.800000 0.800000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | -------------------------------------------------------------------------------- /resource-api/content/models/wall_vine_A/wall_vine_A.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'wall_vine_A.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/models/wood_pier/wood_pier.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'wood_pier.blend' 2 | # Material Count: 1 3 | 4 | newmtl None 5 | Ns 0 6 | Ka 0.000000 0.000000 0.000000 7 | Kd 0.8 0.8 0.8 8 | Ks 0.8 0.8 0.8 9 | d 1 10 | illum 2 11 | -------------------------------------------------------------------------------- /resource-api/content/shaders/FlameShader/FlameShader_fragment.glsl: -------------------------------------------------------------------------------- 1 | varying vec3 pos; 2 | uniform float delta; 3 | varying vec3 vNormal; 4 | varying vec3 wPosition; 5 | 6 | void main() 7 | { 8 | float faceDiff = abs(dot(vNormal, wPosition)); 9 | 10 | float alpha = (vec4(0.0, 0.05+(0.75-min(faceDiff, 0.75)*(1.5-min((abs(pos.y)*0.3)/6.0, 1.5)))*faceDiff, 0.0, 1.0) * viewMatrix).y; 11 | 12 | gl_FragColor = vec4( 13 | 1.0, 14 | faceDiff, 15 | 0.0, 16 | alpha 17 | ); 18 | } 19 | -------------------------------------------------------------------------------- /resource-api/content/shaders/FlameShader/FlameShader_vertex.glsl: -------------------------------------------------------------------------------- 1 | uniform float delta; 2 | varying vec3 pos; 3 | varying vec3 vNormal; 4 | varying vec3 nNormal; 5 | varying vec3 wPosition; 6 | 7 | void main() 8 | { 9 | pos = position; 10 | 11 | float offset = 15.0 * sin(delta-0.5); 12 | if(pos.y < 0.0) 13 | { 14 | float diff = (abs(pos.y))-(abs(-10.5-offset)); 15 | pos.x += ((diff*pos.x)*0.0175) * abs(cos((delta-0.5) / 0.3)); 16 | pos.z += ((diff*pos.z)*0.0175) * abs(cos((delta-0.5) / 0.3)); 17 | } 18 | else 19 | { 20 | pos.y += pos.y * 2.0; 21 | pos.x = pos.x * ((80.0-pos.y)/80.0); 22 | pos.z = pos.z * ((80.0-pos.y)/80.0); 23 | float diff = (abs(pos.y))-(abs(-10.5-offset)); 24 | pos.x += ((diff*pos.x)*0.0175) * abs(cos((delta-0.5) / 0.3)); 25 | pos.z += ((diff*pos.z)*0.0175) * abs(cos((delta-0.5) / 0.3)); 26 | 27 | float waveStrength = 5.0; 28 | if(pos.y > 55.5) 29 | { 30 | waveStrength *= (pos.y - 55.5)/20.0; 31 | 32 | vec3 wavey = vec3(0.0, 0.0, 0.0); 33 | wavey.x = (waveStrength * sin(delta*6.283)); 34 | wavey.z = (waveStrength * cos(delta*6.283)); 35 | } 36 | vec3 wavey = vec3(0.0, 0.0, 0.0); 37 | wavey.x = (waveStrength * sin(delta*6.283)); 38 | wavey.z = (waveStrength * cos(delta*6.283)); 39 | 40 | wavey *= ((pos.y)/55.0) * (min(pos.y, 10.0) / 10.0); 41 | if(pos.y > 55.5) 42 | { 43 | wavey.x += (5.0 * sin(delta*6.283)); 44 | wavey.z += (5.0 * cos(delta*6.283)); 45 | } 46 | pos += vec3((vec4(wavey, 1.0) * viewMatrix).xyz); 47 | 48 | } 49 | 50 | gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); 51 | wPosition = normalize((modelViewMatrix * vec4(pos, 1.0)).xyz); 52 | vNormal = normalize(normalMatrix * normal); 53 | } -------------------------------------------------------------------------------- /resource-api/content/shaders/TerrainMapMaterial/TerrainMapMaterial_vertex.glsl: -------------------------------------------------------------------------------- 1 | varying vec3 vViewPosition; 2 | #ifndef FLAT_SHADED 3 | varying vec3 vNormal; 4 | #endif 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void main() { 19 | vec3 poz = position; 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #ifndef FLAT_SHADED 30 | vNormal = normalize( transformedNormal ); 31 | #endif 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | vViewPosition = - mvPosition.xyz; 40 | #include 41 | #include 42 | #include 43 | #include 44 | } -------------------------------------------------------------------------------- /resource-api/content/shaders/VegetationMaterial/VegetationMaterial_vertex.glsl: -------------------------------------------------------------------------------- 1 | varying vec3 vViewPosition; 2 | #ifndef FLAT_SHADED 3 | varying vec3 vNormal; 4 | #endif 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | void main() { 19 | vec3 poz = position; 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #ifndef FLAT_SHADED 30 | vNormal = normalize( transformedNormal ); 31 | #endif 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | vViewPosition = - mvPosition.xyz; 40 | #include 41 | #include 42 | #include 43 | #include 44 | } -------------------------------------------------------------------------------- /resource-api/content/textures/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/1.png -------------------------------------------------------------------------------- /resource-api/content/textures/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/10.png -------------------------------------------------------------------------------- /resource-api/content/textures/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/11.png -------------------------------------------------------------------------------- /resource-api/content/textures/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/12.png -------------------------------------------------------------------------------- /resource-api/content/textures/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/2.png -------------------------------------------------------------------------------- /resource-api/content/textures/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/5.png -------------------------------------------------------------------------------- /resource-api/content/textures/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/6.png -------------------------------------------------------------------------------- /resource-api/content/textures/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/7.png -------------------------------------------------------------------------------- /resource-api/content/textures/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/8.png -------------------------------------------------------------------------------- /resource-api/content/textures/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/9.png -------------------------------------------------------------------------------- /resource-api/content/textures/boat01_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/boat01_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/concrete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/concrete.png -------------------------------------------------------------------------------- /resource-api/content/textures/crate_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/crate_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/nx.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/nx.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/ny.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/ny.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/nz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/nz.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/px.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/px.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/py.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/py.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/cube/skyboxsun/pz.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/cube/skyboxsun/pz.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/default.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/default.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/dirt.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/dirt.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/door_a1_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/door_a1_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/fence_01_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/fence_01_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/fence_02_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/fence_02_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/grass.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/grass.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/grass2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/grass2.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/grass_2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/grass_2.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/grass_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/grass_2.png -------------------------------------------------------------------------------- /resource-api/content/textures/grass_bubbly.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/grass_bubbly.png -------------------------------------------------------------------------------- /resource-api/content/textures/gun.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/gun.png -------------------------------------------------------------------------------- /resource-api/content/textures/layout2_Tree2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/layout2_Tree2.png -------------------------------------------------------------------------------- /resource-api/content/textures/light01_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/light01_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/log_with_hole_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/log_with_hole_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/marblefloor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/marblefloor.png -------------------------------------------------------------------------------- /resource-api/content/textures/mushroom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/mushroom.png -------------------------------------------------------------------------------- /resource-api/content/textures/poker_chair.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/poker_chair.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/private/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/private/check.png -------------------------------------------------------------------------------- /resource-api/content/textures/private/swirl.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/private/swirl.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/rock_cliff_face_a_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/rock_cliff_face_a_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/spider_bush_2_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/spider_bush_2_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/spider_bush_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/spider_bush_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/stone1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/stone1.png -------------------------------------------------------------------------------- /resource-api/content/textures/torch_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/torch_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/tree_exposed_roots_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/tree_exposed_roots_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/tree_swamp_A_leaves_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/tree_swamp_A_leaves_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/tree_tall_spider_base_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/tree_tall_spider_base_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/vegetationseed.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/vegetationseed.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/wall_vegetation_mess_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/wall_vegetation_mess_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/wall_vine_A_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/wall_vine_A_texture.png -------------------------------------------------------------------------------- /resource-api/content/textures/warning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/warning.png -------------------------------------------------------------------------------- /resource-api/content/textures/waternormals.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/waternormals.jpg -------------------------------------------------------------------------------- /resource-api/content/textures/wood_pier_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/owen-chair/Three.js-Game-Engine/3965197734b88c00ad29d1e790c222083b8a1c14/resource-api/content/textures/wood_pier_texture.png -------------------------------------------------------------------------------- /resource-api/middleware/cors.js: -------------------------------------------------------------------------------- 1 | module.exports = (req, res, next) => { 2 | //res.header('Access-Control-Allow-Origin', 'http://217.155.7.240:8080'); 3 | res.header('Access-Control-Allow-Origin', 'http://localhost:8080'); 4 | res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE'); 5 | res.header('Access-Control-Allow-Headers', 'Content-Type'); 6 | 7 | next(); 8 | } -------------------------------------------------------------------------------- /resource-api/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "3js-gev-dev-server", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "server.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "express": "^4.16.3", 13 | "glob": "^7.1.3" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /vsCode.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "client-game-app" 5 | }, 6 | { 7 | "path": "resource-api" 8 | } 9 | ], 10 | "settings": {} 11 | } -------------------------------------------------------------------------------- /ws.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "client-game-app" 5 | }, 6 | { 7 | "path": "resource-api" 8 | }, 9 | { 10 | "path": "/home/o/Downloads/git/three.js" 11 | }, 12 | { 13 | "path": "client-game-app2" 14 | } 15 | ], 16 | "settings": { 17 | "search.exclude": { 18 | "**/bower_components": false 19 | } 20 | } 21 | } --------------------------------------------------------------------------------