Extracted project folder to its own repository
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
2
config.lua
Normal file → Executable file
2
config.lua
Normal file → Executable file
@@ -3,4 +3,4 @@ module_dir = "."
|
|||||||
|
|
||||||
visualize_physics = 1
|
visualize_physics = 1
|
||||||
|
|
||||||
project_dir = "../res/project"
|
project_dir = "../subprojects/project_assets"
|
||||||
|
|||||||
2
meson.build
Normal file → Executable file
2
meson.build
Normal file → Executable file
@@ -35,6 +35,8 @@ evmodgame_dep = dependency('evmod_game')
|
|||||||
evmodrenderer_dep = dependency('evmod_renderer')
|
evmodrenderer_dep = dependency('evmod_renderer')
|
||||||
evmod_assets_dep = dependency('evmod_assets')
|
evmod_assets_dep = dependency('evmod_assets')
|
||||||
|
|
||||||
|
subproject('project_assets')
|
||||||
|
|
||||||
# Setup build directory
|
# Setup build directory
|
||||||
subdir('buildscripts')
|
subdir('buildscripts')
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "dummy_game",
|
|
||||||
"engineVersion": "0.2",
|
|
||||||
"mounts": [
|
|
||||||
{
|
|
||||||
"path": "./res",
|
|
||||||
"mountpoint": "res"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./res/scripts",
|
|
||||||
"mountpoint": "scripts"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./res/scenes",
|
|
||||||
"mountpoint": "scenes"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"path": "./res/shaders",
|
|
||||||
"mountpoint": "shaders"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"scenes": [
|
|
||||||
{
|
|
||||||
"id": "MainScene",
|
|
||||||
"path": "scenes://MainScene.evsc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "SideScene",
|
|
||||||
"path": "scenes://SideScene.evsc"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "TestScene",
|
|
||||||
"path": "scenes://TestScene.evsc"
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"activeScene": "TestScene"
|
|
||||||
}
|
|
||||||
@@ -1,304 +0,0 @@
|
|||||||
{
|
|
||||||
"id":"MainScene",
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"id": "Camera",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, -2.0, -11.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "MainCameraController",
|
|
||||||
"script_path": "scripts://MainScene/Camera.lua"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "RotationHelper",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, 0.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "CameraComponent",
|
|
||||||
"view": "Perspective",
|
|
||||||
"fov": 90,
|
|
||||||
"near": 0.001,
|
|
||||||
"far": 1000,
|
|
||||||
"aspectRatio": 1.3333
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "MainCameraRotationHelper",
|
|
||||||
"script_path": "scripts://MainScene/CameraHelper.lua"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "SideCamera",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [25.0, 0.0, -15.0],
|
|
||||||
"rotation": [0.0, 90.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "CameraComponent",
|
|
||||||
"view": "Perspective",
|
|
||||||
"fov": 90,
|
|
||||||
"near": 0.001,
|
|
||||||
"far": 1000,
|
|
||||||
"aspectRatio": 1.3333
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Player",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Dynamic",
|
|
||||||
"mass": 1.0,
|
|
||||||
"restitution": 1.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Sphere",
|
|
||||||
"radius": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "MainPlayerController",
|
|
||||||
"script_path": "scripts://MainScene/Player.lua"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RenderComponent",
|
|
||||||
"mesh": "project://Avocado.mesh",
|
|
||||||
"material": "WhiteMaterial"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "Child",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 5.0, -5.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Kinematic",
|
|
||||||
"mass": 1.0,
|
|
||||||
"restitution": 1.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [1.0, 1.0, 1.0]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "CameraComponent",
|
|
||||||
"view": "Perspective",
|
|
||||||
"fov": 120,
|
|
||||||
"near": 0.001,
|
|
||||||
"far": 1000,
|
|
||||||
"aspectRatio": 1.3333
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "MainChildController",
|
|
||||||
"script_path": "scripts://MainScene/Child.lua"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RenderComponent",
|
|
||||||
"mesh": "project://Cube.mesh",
|
|
||||||
"material": "WhiteMaterial"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Map",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, 0.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "Ground",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, -5.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [10.0, 1.0, 10.0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Ceiling",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 5.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [10.0, 1.0, 10.0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "WallRight",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [9.0, 0.0, -14.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [1.0, 4.0, 9.0]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RenderComponent",
|
|
||||||
"mesh": "project://Avocado.mesh",
|
|
||||||
"material": "WhiteMaterial"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "WallLeft",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [-9.0, 0.0, -14.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [1.0, 4.0, 9.0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "WallBack",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, -24.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [10.0, 4.0, 1.0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"materials": [
|
|
||||||
{
|
|
||||||
"id": "GreenMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [0.0, 1.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "RedMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [1.0, 0.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "BlueMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [0.0, 0.0, 1.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "WhiteMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [1.0, 1.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
"pipelines": [
|
|
||||||
{
|
|
||||||
"id": "DefaultPipeline",
|
|
||||||
"shaderStages": [
|
|
||||||
{
|
|
||||||
"type": "Vertex",
|
|
||||||
"shaderPath": "shaders://default.vert"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Fragment",
|
|
||||||
"shaderPath": "shaders://default.frag"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activeCamera": "Camera.RotationHelper"
|
|
||||||
}
|
|
||||||
@@ -1,174 +0,0 @@
|
|||||||
{
|
|
||||||
"id":"SideScene",
|
|
||||||
"nodes": [
|
|
||||||
{
|
|
||||||
"id": "Camera",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, 0.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "CameraComponent",
|
|
||||||
"view": "Perspective",
|
|
||||||
"fov": 60,
|
|
||||||
"near": 0.001,
|
|
||||||
"far": 1000,
|
|
||||||
"aspectRatio": 1.3333
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "SideCameraController",
|
|
||||||
"script_path": "scripts://SideScene/Camera.lua"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Player",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 0.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Dynamic",
|
|
||||||
"mass": 1.0,
|
|
||||||
"restitution": 1.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Capsule",
|
|
||||||
"radius": 1.0,
|
|
||||||
"height": 2.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "SidePlayerController",
|
|
||||||
"script_path": "scripts://SideScene/Player.lua"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"id": "Child",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 5.0, -5.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Kinematic",
|
|
||||||
"mass": 1.0,
|
|
||||||
"restitution": 1.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Sphere",
|
|
||||||
"radius": 1.0
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "SideChildController",
|
|
||||||
"script_path": "scripts://SideScene/Child.lua"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Ceiling",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, 15.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Ghost",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Box",
|
|
||||||
"halfExtents": [10.0, 10.0, 10.0]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ScriptComponent",
|
|
||||||
"script_name": "SideGhostController",
|
|
||||||
"script_path": "scripts://SideScene/Ghost.lua"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "Ground",
|
|
||||||
"components": [
|
|
||||||
{
|
|
||||||
"type": "TransformComponent",
|
|
||||||
"position": [0.0, -15.0, -15.0],
|
|
||||||
"rotation": [0.0, 0.0, 0.0],
|
|
||||||
"scale": [1.0, 1.0, 1.0]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "RigidbodyComponent",
|
|
||||||
"rigidbodyType": "Static",
|
|
||||||
"mass": 0.0,
|
|
||||||
"restitution": 0.0,
|
|
||||||
"collisionShape": {
|
|
||||||
"type": "Sphere",
|
|
||||||
"radius": 10.0
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"materials": [
|
|
||||||
{
|
|
||||||
"id": "GreenMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [0.0, 1.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "RedMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [1.0, 0.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "BlueMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [0.0, 0.0, 1.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "WhiteMaterial",
|
|
||||||
"pipeline": "DefaultPipeline",
|
|
||||||
"baseColor": [1.0, 1.0, 0.0, 1.0]
|
|
||||||
"albedoTexture": "project://lost.tx",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
|
|
||||||
"pipelines": [
|
|
||||||
{
|
|
||||||
"id": "DefaultPipeline",
|
|
||||||
"shaderStages": [
|
|
||||||
{
|
|
||||||
"type": "Vertex",
|
|
||||||
"shaderPath": "shaders://default.vert"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "Fragment",
|
|
||||||
"shaderPath": "shaders://default.frag"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activeCamera": "Camera"
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,45 +0,0 @@
|
|||||||
this.on_init = function()
|
|
||||||
this.speed = 0.1
|
|
||||||
this.original_position = this.position
|
|
||||||
this.angles = Vec3:new()
|
|
||||||
this.mouse_sens = 0.01
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function()
|
|
||||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
|
||||||
this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens
|
|
||||||
this.eulerAngles = this.angles
|
|
||||||
|
|
||||||
helper = this:getChild('RotationHelper')
|
|
||||||
|
|
||||||
if Input.getKeyJustPressed(Input.KeyCode.Enter) then
|
|
||||||
gotoScene('SideScene')
|
|
||||||
end
|
|
||||||
if Input.getKeyJustPressed(Input.KeyCode.T) then
|
|
||||||
gotoScene('TestScene')
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
local pos = this.position
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Up) then
|
|
||||||
pos = pos + helper.forward * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Down) then
|
|
||||||
pos = pos - helper.forward * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
pos = pos + helper.right * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
pos = pos - helper.right * this.speed
|
|
||||||
end
|
|
||||||
|
|
||||||
if Input.getMouseButtonJustPressed(0) then
|
|
||||||
hit = rayCast(this.worldPosition, helper.forward, 300)
|
|
||||||
if(hit.hasHit) then
|
|
||||||
hit.object.position = hit.object.position + Vec3:new(0, 0, -15)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
this.position = pos
|
|
||||||
end
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
this.on_init = function()
|
|
||||||
this.angles = Vec3:new()
|
|
||||||
this.mouse_sens = 0.01
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function()
|
|
||||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
|
||||||
this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens
|
|
||||||
this.eulerAngles = this.angles
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
this.on_init = function ()
|
|
||||||
this.custom_eulerangles = Vec3:new()
|
|
||||||
this.custom_angularvelocity = Vec3:new(0, 0.01, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_fixedupdate = function ()
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
this.custom_eulerangles:add(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
this.custom_eulerangles:sub(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
this.eulerAngles = this.custom_eulerangles
|
|
||||||
end
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
-- this.on_collisionenter = function(other)
|
|
||||||
-- other.position = other.position + Vec3:new(3.2, 0, 0)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
this.on_update = function ()
|
|
||||||
rb = this:getComponent(Rigidbody)
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Space) then
|
|
||||||
rb:addForce(Vec3:new(0, 100, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.D) then
|
|
||||||
rb:addForce(Vec3:new(10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.A) then
|
|
||||||
rb:addForce(Vec3:new(-10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.W) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, -10))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.S) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, 10))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
this.on_init = function()
|
|
||||||
this.speed = 0.1
|
|
||||||
this.original_position = this.position
|
|
||||||
this.cursor_locked = false
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_fixedupdate = function()
|
|
||||||
if Input.getKeyJustPressed(Input.KeyCode.Enter) then
|
|
||||||
gotoScene('MainScene')
|
|
||||||
end
|
|
||||||
|
|
||||||
if Input.getKeyDown(Input.KeyCode.L) then
|
|
||||||
if this.cursor_locked then
|
|
||||||
Input.unlockCursor()
|
|
||||||
else
|
|
||||||
Input.lockCursor()
|
|
||||||
end
|
|
||||||
this.cursor_locked = not this.cursor_locked
|
|
||||||
end
|
|
||||||
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Up) then
|
|
||||||
this.position = this.position - Vec3:new(0, 0, 1) * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Down) then
|
|
||||||
this.position = this.position + Vec3:new(0, 0, 1) * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
this.position = this.position + Vec3:new(1, 0, 0) * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
this.position = this.position - Vec3:new(1, 0, 0) * this.speed
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
this.on_init = function ()
|
|
||||||
this.custom_eulerangles = Vec3:new()
|
|
||||||
this.custom_angularvelocity = Vec3:new(0, 0.01, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_fixedupdate = function ()
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
this.custom_eulerangles:add(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
this.custom_eulerangles:sub(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
this.eulerAngles = this.custom_eulerangles
|
|
||||||
end
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
this.on_collisionenter = function(other)
|
|
||||||
print(other.name)
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function ()
|
|
||||||
local player = getObject('Player.Child')
|
|
||||||
this.position = player.position + Vec3:new(0, 10, 0)
|
|
||||||
end
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
-- this.on_collisionenter = function(other)
|
|
||||||
-- other.position = other.position + Vec3:new(3.2, 0, 0)
|
|
||||||
-- end
|
|
||||||
this.on_init = function()
|
|
||||||
-- print(this:getChild('Child').position:to_string())
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function ()
|
|
||||||
rb = this:getComponent(Rigidbody)
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Space) then
|
|
||||||
rb:addForce(Vec3:new(0, 100, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.D) then
|
|
||||||
rb:addForce(Vec3:new(10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.A) then
|
|
||||||
rb:addForce(Vec3:new(-10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.W) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, -10))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.S) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, 10))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
this.on_init = function()
|
|
||||||
this.speed = 2.1
|
|
||||||
this.original_position = this.position
|
|
||||||
this.angles = Vec3:new()
|
|
||||||
this.mouse_sens = 0.01
|
|
||||||
this.cursor_locked = false
|
|
||||||
end
|
|
||||||
|
|
||||||
this.toggleCursor = function()
|
|
||||||
if this.cursor_locked then
|
|
||||||
Input.unlockCursor()
|
|
||||||
else
|
|
||||||
Input.lockCursor()
|
|
||||||
end
|
|
||||||
this.cursor_locked = not this.cursor_locked
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function()
|
|
||||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
|
||||||
this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens
|
|
||||||
this.eulerAngles = this.angles
|
|
||||||
|
|
||||||
helper = this:getChild('RotationHelper')
|
|
||||||
|
|
||||||
if Input.getKeyJustPressed(Input.KeyCode.Enter) then
|
|
||||||
gotoScene('SideScene')
|
|
||||||
end
|
|
||||||
|
|
||||||
local pos = this.position
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Up) then
|
|
||||||
pos = pos + helper.forward * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Down) then
|
|
||||||
pos = pos - helper.forward * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
pos = pos + helper.right * this.speed
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
pos = pos - helper.right * this.speed
|
|
||||||
end
|
|
||||||
|
|
||||||
local mb0 = Input.getMouseButtonJustPressed(0)
|
|
||||||
local mb1 = Input.getMouseButtonJustPressed(1)
|
|
||||||
local mb2 = Input.getMouseButtonJustPressed(2)
|
|
||||||
|
|
||||||
if mb0 or mb1 then
|
|
||||||
hit = rayCast(this.worldPosition, helper.forward, 300)
|
|
||||||
if(hit.hasHit) then
|
|
||||||
local hitForce = 1000
|
|
||||||
rb = hit.object:getComponent(Rigidbody)
|
|
||||||
if mb0 then
|
|
||||||
rb:addForce(hit.hitNormal * -hitForce)
|
|
||||||
elseif mb1 then
|
|
||||||
rb:addForce(hit.hitNormal * hitForce)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if mb2 then
|
|
||||||
this.toggleCursor()
|
|
||||||
end
|
|
||||||
|
|
||||||
this.position = pos
|
|
||||||
end
|
|
||||||
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
this.on_init = function()
|
|
||||||
this.angles = Vec3:new()
|
|
||||||
this.mouse_sens = 0.01
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_update = function()
|
|
||||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
|
||||||
this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens
|
|
||||||
this.eulerAngles = this.angles
|
|
||||||
end
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
this.on_init = function ()
|
|
||||||
this.custom_eulerangles = Vec3:new()
|
|
||||||
this.custom_angularvelocity = Vec3:new(0, 0.01, 0)
|
|
||||||
end
|
|
||||||
|
|
||||||
this.on_fixedupdate = function ()
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Left) then
|
|
||||||
this.custom_eulerangles:add(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
|
||||||
this.custom_eulerangles:sub(Vec3:new(0,0.01,0))
|
|
||||||
end
|
|
||||||
this.eulerAngles = this.custom_eulerangles
|
|
||||||
end
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
-- this.on_collisionenter = function(other)
|
|
||||||
-- other.position = other.position + Vec3:new(3.2, 0, 0)
|
|
||||||
-- end
|
|
||||||
|
|
||||||
this.on_update = function ()
|
|
||||||
rb = this:getComponent(Rigidbody)
|
|
||||||
if Input.getKeyDown(Input.KeyCode.Space) then
|
|
||||||
rb:addForce(Vec3:new(0, 100, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.D) then
|
|
||||||
rb:addForce(Vec3:new(10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.A) then
|
|
||||||
rb:addForce(Vec3:new(-10, 0, 0))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.W) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, -10))
|
|
||||||
end
|
|
||||||
if Input.getKeyDown(Input.KeyCode.S) then
|
|
||||||
rb:addForce(Vec3:new(0, 0, 10))
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
#version 450
|
|
||||||
#extension GL_EXT_nonuniform_qualifier : require
|
|
||||||
|
|
||||||
struct Material {
|
|
||||||
vec3 baseColor;
|
|
||||||
uint index;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Light {
|
|
||||||
vec3 color;
|
|
||||||
uint intensity;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Scene {
|
|
||||||
uint lightsCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
vec3 directional_light = vec3(-1.0,-1.0,-1.0);
|
|
||||||
|
|
||||||
layout(set = 0, binding = 0) uniform SceneData {
|
|
||||||
layout(align = 16) Scene mesh;
|
|
||||||
} SceneBuffers[];
|
|
||||||
|
|
||||||
layout(set = 0, binding = 1) uniform LightBuffer {
|
|
||||||
layout(align = 16) Light lights[];
|
|
||||||
} LightsBuffers;
|
|
||||||
|
|
||||||
// layout(set = 2, binding = 4) uniform sampler2D texSampler[];
|
|
||||||
|
|
||||||
layout(location = 0) in vec3 normal;
|
|
||||||
layout(location = 1) in vec3 color;
|
|
||||||
layout(location = 2) flat in Material material;
|
|
||||||
|
|
||||||
layout(location = 0) out vec4 outColor;
|
|
||||||
|
|
||||||
void main() {
|
|
||||||
float intensity = ((dot(normalize(normal), normalize(directional_light)) +1)/2.0)+0.05;
|
|
||||||
|
|
||||||
outColor = vec4(color * intensity, 1.0);
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
#version 450
|
|
||||||
#extension GL_EXT_nonuniform_qualifier : require
|
|
||||||
|
|
||||||
struct Material {
|
|
||||||
vec3 baseColor;
|
|
||||||
uint index;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Vertex {
|
|
||||||
vec4 position;
|
|
||||||
vec4 normal;
|
|
||||||
vec4 color;
|
|
||||||
vec2 uv[2];
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Light {
|
|
||||||
vec3 color;
|
|
||||||
uint intensity;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Scene {
|
|
||||||
uint lightsCount;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct Mesh {
|
|
||||||
uint asd;
|
|
||||||
};
|
|
||||||
|
|
||||||
layout( push_constant ) uniform constants
|
|
||||||
{
|
|
||||||
mat4 render_matrix;
|
|
||||||
uint indexBufferIndex;
|
|
||||||
uint vertexBufferIndex;
|
|
||||||
uint materialBufferIndex;
|
|
||||||
} PushConstants;
|
|
||||||
|
|
||||||
layout(set = 1, binding = 0) uniform CameraParam {
|
|
||||||
mat4 projection;
|
|
||||||
mat4 view;
|
|
||||||
} Camera;
|
|
||||||
|
|
||||||
layout(set = 2, binding = 0) buffer MeshBuffer {
|
|
||||||
layout(align = 16) Mesh mesh;
|
|
||||||
} MeshBuffers[];
|
|
||||||
|
|
||||||
layout(set = 2, binding = 1) buffer VertexBuffer {
|
|
||||||
layout(align = 16) Vertex vertices[];
|
|
||||||
} VertexBuffers[];
|
|
||||||
|
|
||||||
layout(set = 2, binding = 2) buffer IndexBuffer {
|
|
||||||
uint indices[];
|
|
||||||
} IndexBuffers[];
|
|
||||||
|
|
||||||
layout(set = 2, binding = 3) buffer MaterialBuffer {
|
|
||||||
layout(align = 16) Material materials[];
|
|
||||||
} MaterialBuffers;
|
|
||||||
|
|
||||||
layout(set = 2, binding = 4) uniform sampler2D texSampler[];
|
|
||||||
|
|
||||||
layout(location = 0) out vec3 normal;
|
|
||||||
layout(location = 1) out vec3 color;
|
|
||||||
layout(location = 2) out Material material;
|
|
||||||
|
|
||||||
void main()
|
|
||||||
{
|
|
||||||
material = MaterialBuffers.materials[ PushConstants.materialBufferIndex ];
|
|
||||||
|
|
||||||
uint index = IndexBuffers[ PushConstants.indexBufferIndex ].indices[gl_VertexIndex];
|
|
||||||
Vertex vertex = VertexBuffers[ PushConstants.vertexBufferIndex ].vertices[ index ];
|
|
||||||
|
|
||||||
color = texture(texSampler[0],vertex.uv[0]).xyz;
|
|
||||||
|
|
||||||
normal = vertex.normal.xyz;
|
|
||||||
gl_Position = Camera.projection * Camera.view * PushConstants.render_matrix * vec4(vertex.position.xyz, 1.0);
|
|
||||||
}
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
- Add cross platform timer
|
|
||||||
- Add cross platform sleep function
|
|
||||||
- EV_EXPORT/EV_IMPORT events
|
|
||||||
- Remotery
|
|
||||||
2
src/main.c
Normal file → Executable file
2
src/main.c
Normal file → Executable file
@@ -240,7 +240,7 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
Renderer->run();
|
Renderer->run();
|
||||||
sleep_ms(17);
|
/* sleep_ms(17); */
|
||||||
}
|
}
|
||||||
|
|
||||||
unload_project();
|
unload_project();
|
||||||
|
|||||||
1
subprojects/packagefiles/project_assets/meson.build
Executable file
1
subprojects/packagefiles/project_assets/meson.build
Executable file
@@ -0,0 +1 @@
|
|||||||
|
project('project_assets')
|
||||||
5
subprojects/project_assets.wrap
Executable file
5
subprojects/project_assets.wrap
Executable file
@@ -0,0 +1,5 @@
|
|||||||
|
[wrap-git]
|
||||||
|
url = https://github.com/j3oss/evol-assets.git
|
||||||
|
revision = master
|
||||||
|
|
||||||
|
patch_directory = project_assets
|
||||||
Reference in New Issue
Block a user