Minor Changes
Signed-off-by: Robear Selwans <robear.selwans@outlook.com>
This commit is contained in:
@@ -9,18 +9,17 @@ this.on_update = function()
|
||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
||||
this.angles.y = this.angles.y - deltaMouseMovement.x * this.mouse_sens
|
||||
this.eulerAngles = this.angles
|
||||
end
|
||||
print('Camera OnUpdate')
|
||||
|
||||
this.on_fixedupdate = function()
|
||||
if Input.getKeyJustPressed(Input.KeyCode.Enter) then
|
||||
gotoScene('SideScene')
|
||||
end
|
||||
|
||||
if Input.getKeyDown(Input.KeyCode.Up) then
|
||||
this.position = this.position + Vec3:new(0, 1, 0) * this.speed
|
||||
this.position = this.position + this:getChild('RotationHelper').forward * 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 - this:getChild('RotationHelper').forward * this.speed
|
||||
end
|
||||
if Input.getKeyDown(Input.KeyCode.Right) then
|
||||
this.position = this.position + Vec3:new(1, 0, 0) * this.speed
|
||||
|
||||
@@ -7,4 +7,5 @@ this.on_update = function()
|
||||
local deltaMouseMovement = Input.getDeltaMousePos()
|
||||
this.angles.x = this.angles.x - deltaMouseMovement.y * this.mouse_sens
|
||||
this.eulerAngles = this.angles
|
||||
print('CameraHelper OnUpdate')
|
||||
end
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
-- other.position = other.position + Vec3:new(3.2, 0, 0)
|
||||
-- end
|
||||
this.on_init = function()
|
||||
print(this:getChild('Child').position:to_string())
|
||||
-- print(this:getChild('Child').position:to_string())
|
||||
end
|
||||
|
||||
this.on_update = function ()
|
||||
|
||||
@@ -35,5 +35,6 @@ void main() {
|
||||
Vertex vertex = ResourceBuffers[ nonuniformEXT(0) ].resources[PositionBuffers[ nonuniformEXT(0) ].resources[gl_VertexIndex] ];
|
||||
|
||||
normal = vertex.normal.xyz;
|
||||
gl_Position = vec4(vertex.position.x, vertex.position.y, vertex.position.z, 1.0);
|
||||
float scale = 0.3;
|
||||
gl_Position = vec4(vertex.position.x * scale - 0.1, vertex.position.y * scale - 0.7, (vertex.position.z * scale * -1.0 + 0.9), 1.0);
|
||||
}
|
||||
|
||||
17
src/main.c
17
src/main.c
@@ -31,7 +31,7 @@ struct {
|
||||
evolmodule_t asset_mod;
|
||||
evolmodule_t window_mod;
|
||||
evolmodule_t input_mod;
|
||||
/* evolmodule_t renderer_mod; */
|
||||
evolmodule_t renderer_mod;
|
||||
|
||||
WindowHandle window;
|
||||
|
||||
@@ -114,8 +114,11 @@ project_changed_cb()
|
||||
}
|
||||
|
||||
evstring_free(project_dir);
|
||||
/* Renderer->setWindow((GenericHandle)State.window); */
|
||||
|
||||
evol_unloadmodule(State.renderer_mod);
|
||||
State.renderer_mod = evol_loadmodule("renderer");
|
||||
|
||||
Renderer->setWindow((GenericHandle)State.window);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -124,12 +127,12 @@ load_project()
|
||||
State.game_mod = evol_loadmodule("game"); DEBUG_ASSERT(State.game_mod);
|
||||
State.window_mod = evol_loadmodule("window"); DEBUG_ASSERT(State.window_mod);
|
||||
State.input_mod = evol_loadmodule("input"); DEBUG_ASSERT(State.input_mod);
|
||||
/* State.renderer_mod = evol_loadmodule("renderer"); DEBUG_ASSERT(State.renderer_mod); */
|
||||
State.renderer_mod = evol_loadmodule("renderer"); DEBUG_ASSERT(State.renderer_mod);
|
||||
|
||||
imports(State.game_mod , (Game, Object, Camera, Scene))
|
||||
imports(State.window_mod , (Window))
|
||||
imports(State.input_mod , (Input))
|
||||
/* imports(State.renderer_mod, (Renderer)) */
|
||||
imports(State.renderer_mod, (Renderer))
|
||||
IMPORT_EVENTS_evmod_glfw(State.window_mod);
|
||||
|
||||
U32 width = 800;
|
||||
@@ -211,7 +214,7 @@ load_project()
|
||||
}
|
||||
|
||||
evstring_free(project_dir);
|
||||
/* Renderer->setWindow((GenericHandle)State.window); */
|
||||
Renderer->setWindow((GenericHandle)State.window);
|
||||
|
||||
}
|
||||
|
||||
@@ -221,7 +224,7 @@ unload_project()
|
||||
evol_unloadmodule(State.game_mod);
|
||||
evol_unloadmodule(State.input_mod);
|
||||
evol_unloadmodule(State.window_mod);
|
||||
/* evol_unloadmodule(State.renderer_mod); */
|
||||
evol_unloadmodule(State.renderer_mod);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -257,7 +260,7 @@ int main(int argc, char **argv)
|
||||
AssetManager->update();
|
||||
}
|
||||
|
||||
/* Renderer->run(); */
|
||||
Renderer->run();
|
||||
sleep_ms(17);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user