Updated test scene and testing shader compilation
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
@@ -25,5 +25,5 @@
|
||||
"path": "scenes://SideScene.evsc"
|
||||
}
|
||||
],
|
||||
"activeScene": "SideScene"
|
||||
"activeScene": "MainScene"
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{
|
||||
"type": "CameraComponent",
|
||||
"view": "Perspective",
|
||||
"fov": 120,
|
||||
"fov": 60,
|
||||
"near": 0.001,
|
||||
"far": 1000,
|
||||
"aspectRatio": 1.3333
|
||||
|
||||
@@ -40,8 +40,9 @@
|
||||
"mass": 1.0,
|
||||
"restitution": 1.0,
|
||||
"collisionShape": {
|
||||
"type": "Sphere",
|
||||
"radius": 1.0
|
||||
"type": "Capsule",
|
||||
"radius": 1.0,
|
||||
"height": 2.0
|
||||
}
|
||||
},
|
||||
{
|
||||
@@ -79,6 +80,32 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"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": [
|
||||
|
||||
@@ -1,10 +1,20 @@
|
||||
this.on_init = function()
|
||||
this.speed = 0.1
|
||||
this.original_position = this.position
|
||||
this.angles = Vec3:new()
|
||||
this.mouse_sens = 0.01
|
||||
Input.lockCursor()
|
||||
end
|
||||
|
||||
this.on_update = function()
|
||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
||||
this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens
|
||||
this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens
|
||||
this.eulerAngles = this.angles
|
||||
end
|
||||
|
||||
this.on_fixedupdate = function()
|
||||
if Input.getKeyDown(Input.KeyCode.Enter) then
|
||||
if Input.getKeyJustPressed(Input.KeyCode.Enter) then
|
||||
gotoScene('SideScene')
|
||||
end
|
||||
|
||||
|
||||
@@ -1,18 +1,28 @@
|
||||
this.on_init = function()
|
||||
this.speed = 0.1
|
||||
this.original_position = this.position
|
||||
this.cursor_locked = false
|
||||
end
|
||||
|
||||
this.on_fixedupdate = function()
|
||||
if Input.getKeyDown(Input.KeyCode.Enter) then
|
||||
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, 1, 0) * this.speed
|
||||
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, 1, 0) * this.speed
|
||||
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
|
||||
|
||||
8
res/project/res/scripts/SideScene/ghost.lua
Normal file
8
res/project/res/scripts/SideScene/ghost.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
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,6 +1,9 @@
|
||||
-- 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)
|
||||
|
||||
5
res/project/triangle.vert
Normal file
5
res/project/triangle.vert
Normal file
@@ -0,0 +1,5 @@
|
||||
#version 450
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(0);
|
||||
}
|
||||
Reference in New Issue
Block a user