Pārlūkot izejas kodu

*Moved the controllers to new dir
*Renamed a few controllers. Read the controllers/README for the naming convention
*From now on changes in the build dir wont be documented. Happens all the time

Panagiotis Christopoulos Charitos 16 gadi atpakaļ
vecāks
revīzija
2af2b7d7e3

+ 64 - 60
build/debug/Makefile

@@ -3,10 +3,10 @@ COMMONFLAGS =
 CFLAGS = $(COMMONFLAGS) -c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg `sdl-config --cflags` -D_DEBUG_ -D_TERMINAL_COLORING_ -D_PLATFORM_LINUX_
 PHFLAGS = $(CFLAGS) -x c++-header
 LFLAGS = $(COMMONFLAGS) -lGL -lGLU -lSDL_image `sdl-config --static-libs` -ljpeg -lGLEW
-EXECUTABLE = AnKi
-INCPATH = -I../../src/math/ -I../../src/tokenizer/ -I../../src/uncategorized/ -I../../src/ -I../../src/renderer/ -I../../src/scene/ -I../../src/ui/ -I../../src/resources/ -I../../src/utility/ 
-SOURCES = ../../src/tokenizer//scanner.cpp ../../src/uncategorized//input.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//particles.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//engine_class.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//map.cpp ../../src//main.cpp ../../src/renderer//r_ms.cpp ../../src/renderer//r_pps_hdr.cpp ../../src/renderer//r_pps.cpp ../../src/renderer//r_is_shadows.cpp ../../src/renderer//r_bs.cpp ../../src/renderer//r_ms_earlyz.cpp ../../src/renderer//renderer.cpp ../../src/renderer//r_pps_ssao.cpp ../../src/renderer//r_is.cpp ../../src/renderer//r_dbg.cpp ../../src/renderer//r_pps_lscatt.cpp ../../src/renderer//r_bs2.cpp ../../src/scene//mesh_node.cpp ../../src/scene//skel_node.cpp ../../src/scene//skel_anim_controller.cpp ../../src/scene//light.cpp ../../src/scene//skel_model_node.cpp ../../src/scene//controller.cpp ../../src/scene//node.cpp ../../src/scene//camera.cpp ../../src/scene//scene.cpp ../../src/ui//ui.cpp ../../src/resources//material.cpp ../../src/resources//texture.cpp ../../src/resources//skel_anim.cpp ../../src/resources//extension.cpp ../../src/resources//shader_parser.cpp ../../src/resources//skeleton.cpp ../../src/resources//resource.cpp ../../src/resources//light_props.cpp ../../src/resources//mesh.cpp ../../src/resources//shader_prog.cpp ../../src/utility//app.cpp ../../src/utility//common.cpp ../../src/utility//util.cpp 
-OBJECTS = scanner.o input.o skybox.o particles.o memory.o engine_class.o collision.o map.o main.o r_ms.o r_pps_hdr.o r_pps.o r_is_shadows.o r_bs.o r_ms_earlyz.o renderer.o r_pps_ssao.o r_is.o r_dbg.o r_pps_lscatt.o r_bs2.o mesh_node.o skel_node.o skel_anim_controller.o light.o skel_model_node.o controller.o node.o camera.o scene.o ui.o material.o texture.o skel_anim.o extension.o shader_parser.o skeleton.o resource.o light_props.o mesh.o shader_prog.o app.o common.o util.o 
+EXECUTABLE = AnKi.bin
+INCPATH = -I../../src/math/ -I../../src/tokenizer/ -I../../src/uncategorized/ -I../../src/ -I../../src/renderer/ -I../../src/scene/ -I../../src/ui/ -I../../src/resources/ -I../../src/utility/ -I../../src/controllers/ 
+SOURCES = ../../src/tokenizer//scanner.cpp ../../src/uncategorized//input.cpp ../../src/uncategorized//skybox.cpp ../../src/uncategorized//particles.cpp ../../src/uncategorized//memory.cpp ../../src/uncategorized//engine_class.cpp ../../src/uncategorized//collision.cpp ../../src/uncategorized//map.cpp ../../src//main.cpp ../../src/renderer//r_ms.cpp ../../src/renderer//r_pps_hdr.cpp ../../src/renderer//r_pps.cpp ../../src/renderer//r_is_shadows.cpp ../../src/renderer//r_bs.cpp ../../src/renderer//r_ms_earlyz.cpp ../../src/renderer//renderer.cpp ../../src/renderer//r_pps_ssao.cpp ../../src/renderer//r_is.cpp ../../src/renderer//r_dbg.cpp ../../src/renderer//r_pps_lscatt.cpp ../../src/renderer//r_bs2.cpp ../../src/scene//mesh_node.cpp ../../src/scene//skel_node.cpp ../../src/scene//light.cpp ../../src/scene//skel_model_node.cpp ../../src/scene//node.cpp ../../src/scene//camera.cpp ../../src/scene//scene.cpp ../../src/ui//ui.cpp ../../src/resources//material.cpp ../../src/resources//texture.cpp ../../src/resources//skel_anim.cpp ../../src/resources//extension.cpp ../../src/resources//shader_parser.cpp ../../src/resources//skeleton.cpp ../../src/resources//resource.cpp ../../src/resources//light_props.cpp ../../src/resources//mesh.cpp ../../src/resources//shader_prog.cpp ../../src/utility//app.cpp ../../src/utility//common.cpp ../../src/utility//util.cpp ../../src/controllers//controller.cpp ../../src/controllers//skel_anim_ctrl.cpp 
+OBJECTS = scanner.o input.o skybox.o particles.o memory.o engine_class.o collision.o map.o main.o r_ms.o r_pps_hdr.o r_pps.o r_is_shadows.o r_bs.o r_ms_earlyz.o renderer.o r_pps_ssao.o r_is.o r_dbg.o r_pps_lscatt.o r_bs2.o mesh_node.o skel_node.o light.o skel_model_node.o node.o camera.o scene.o ui.o material.o texture.o skel_anim.o extension.o shader_parser.o skeleton.o resource.o light_props.o mesh.o shader_prog.o app.o common.o util.o controller.o skel_anim_ctrl.o 
 PRECOMPILED_HEADERS = 
 
 all: $(PRECOMPILED_HEADERS) $(SOURCES) $(EXECUTABLE)
@@ -150,9 +150,10 @@ main.o: ../../src//main.cpp ../../src/utility/common.h \
  ../../src/tokenizer/scanner.h ../../src/uncategorized/map.h \
  ../../src/uncategorized/collision.h ../../src/scene/mesh_node.h \
  ../../src/scene/skel_model_node.h ../../src/scene/mesh_node.h \
- ../../src/resources/skel_anim.h ../../src/scene/skel_controller.h \
- ../../src/scene/controller.h ../../src/scene/skel_anim_controller.h \
- ../../src/scene/skel_node.h ../../src/resources/light_props.h
+ ../../src/resources/skel_anim.h ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h \
+ ../../src/controllers/skel_anim_ctrl.h ../../src/scene/skel_node.h \
+ ../../src/controllers/controller.h ../../src/resources/light_props.h
 	@echo Compiling ../../src//main.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src//main.cpp -o main.o
 
@@ -387,7 +388,7 @@ r_dbg.o: ../../src/renderer//r_dbg.cpp ../../src/renderer//renderer.h \
  ../../src/renderer//fbo.h ../../src/scene/scene.h \
  ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
  ../../src/scene/node.h ../../src/scene/skel_node.h \
- ../../src/scene/controller.h
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/renderer//r_dbg.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/renderer//r_dbg.cpp -o r_dbg.o
 
@@ -458,9 +459,10 @@ mesh_node.o: ../../src/scene//mesh_node.cpp ../../src/scene//mesh_node.h \
  ../../src/renderer/vbo.h ../../src/uncategorized/collision.h \
  ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
  ../../src/scene/camera.h ../../src/scene/node.h \
- ../../src/scene//skel_node.h ../../src/scene//controller.h \
- ../../src/resources/skeleton.h ../../src/scene//skel_controller.h \
- ../../src/scene//skel_anim_controller.h
+ ../../src/scene//skel_node.h ../../src/controllers/controller.h \
+ ../../src/resources/skeleton.h ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h \
+ ../../src/controllers/skel_anim_ctrl.h
 	@echo Compiling ../../src/scene//mesh_node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//mesh_node.cpp -o mesh_node.o
 
@@ -476,39 +478,17 @@ skel_node.o: ../../src/scene//skel_node.cpp ../../src/scene//skel_node.h \
  ../../src/math/euler.inl.h ../../src/math/mat3.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/scene//controller.h \
+ ../../src/math/m_misc.inl.h ../../src/controllers/controller.h \
  ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/scene/camera.h ../../src/uncategorized/collision.h \
  ../../src/scene/node.h ../../src/resources/skel_anim.h \
- ../../src/resources/skeleton.h ../../src/scene//skel_anim_controller.h
+ ../../src/resources/skeleton.h ../../src/controllers/skel_anim_ctrl.h \
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//skel_node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_node.cpp -o skel_node.o
 
-skel_anim_controller.o: ../../src/scene//skel_anim_controller.cpp \
- ../../src/scene//skel_anim_controller.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/scene//controller.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h ../../src/resources/skel_anim.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/scene//skel_node.h ../../src/scene//node.h \
- ../../src/resources/skeleton.h ../../src/renderer/renderer.h \
- ../../src/resources/shader_prog.h ../../src/scene/camera.h \
- ../../src/uncategorized/collision.h ../../src/scene/node.h
-	@echo Compiling ../../src/scene//skel_anim_controller.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_anim_controller.cpp -o skel_anim_controller.o
-
 light.o: ../../src/scene//light.cpp ../../src/scene//light.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/resources/texture.h ../../src/resources/resource.h \
@@ -548,31 +528,12 @@ skel_model_node.o: ../../src/scene//skel_model_node.cpp \
  ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
  ../../src/utility/util.h ../../src/utility/common.h \
  ../../src/tokenizer/parser.h ../../src/tokenizer/scanner.h \
- ../../src/scene//skel_node.h ../../src/scene//controller.h \
- ../../src/scene//skel_controller.h
+ ../../src/scene//skel_node.h ../../src/controllers/controller.h \
+ ../../src/controllers/mesh_skel_ctrl.h \
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//skel_model_node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//skel_model_node.cpp -o skel_model_node.o
 
-controller.o: ../../src/scene//controller.cpp \
- ../../src/scene//controller.h ../../src/utility/common.h \
- ../../src/uncategorized/memory.h ../../src/scene//scene.h \
- ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
- ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
- ../../src/utility/util.h ../../src/utility/common.h \
- ../../src/math/gmath.h ../../src/math/vec2.h \
- ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
- ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
- ../../src/math/vec3.inl.h ../../src/math/vec4.h \
- ../../src/math/vec4.inl.h ../../src/math/quat.h \
- ../../src/math/quat.inl.h ../../src/math/axisang.h \
- ../../src/math/axisang.inl.h ../../src/math/euler.h \
- ../../src/math/euler.inl.h ../../src/math/mat3.h \
- ../../src/math/mat3.inl.h ../../src/math/mat4.h \
- ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
- ../../src/math/m_misc.inl.h
-	@echo Compiling ../../src/scene//controller.cpp...
-	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//controller.cpp -o controller.o
-
 node.o: ../../src/scene//node.cpp ../../src/scene//node.h \
  ../../src/utility/common.h ../../src/uncategorized/memory.h \
  ../../src/math/gmath.h ../../src/math/vec2.h \
@@ -590,7 +551,7 @@ node.o: ../../src/scene//node.cpp ../../src/scene//node.h \
  ../../src/uncategorized/engine_class.h ../../src/utility/util.h \
  ../../src/utility/common.h ../../src/scene/camera.h \
  ../../src/uncategorized/collision.h ../../src/scene/node.h \
- ../../src/scene//controller.h
+ ../../src/controllers/controller.h
 	@echo Compiling ../../src/scene//node.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/scene//node.cpp -o node.o
 
@@ -630,7 +591,7 @@ scene.o: ../../src/scene//scene.cpp ../../src/scene//scene.h \
  ../../src/math/mat3.inl.h ../../src/math/mat4.h \
  ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
  ../../src/math/m_misc.inl.h ../../src/scene//skel_node.h \
- ../../src/scene//node.h ../../src/scene//controller.h \
+ ../../src/scene//node.h ../../src/controllers/controller.h \
  ../../src/scene//camera.h ../../src/uncategorized/collision.h \
  ../../src/scene//mesh_node.h ../../src/resources/material.h \
  ../../src/scene//light.h
@@ -859,6 +820,49 @@ util.o: ../../src/utility//util.cpp ../../src/utility//util.h \
 	@echo Compiling ../../src/utility//util.cpp...
 	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/utility//util.cpp -o util.o
 
+controller.o: ../../src/controllers//controller.cpp \
+ ../../src/controllers//controller.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/scene/scene.h \
+ ../../src/uncategorized/skybox.h ../../src/resources/texture.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h
+	@echo Compiling ../../src/controllers//controller.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/controllers//controller.cpp -o controller.o
+
+skel_anim_ctrl.o: ../../src/controllers//skel_anim_ctrl.cpp \
+ ../../src/controllers//skel_anim_ctrl.h ../../src/utility/common.h \
+ ../../src/uncategorized/memory.h ../../src/controllers//controller.h \
+ ../../src/math/gmath.h ../../src/math/vec2.h \
+ ../../src/math/forward_decls.h ../../src/math/vec2.inl.h \
+ ../../src/math/m_dflt_header.h ../../src/math/vec3.h \
+ ../../src/math/vec3.inl.h ../../src/math/vec4.h \
+ ../../src/math/vec4.inl.h ../../src/math/quat.h \
+ ../../src/math/quat.inl.h ../../src/math/axisang.h \
+ ../../src/math/axisang.inl.h ../../src/math/euler.h \
+ ../../src/math/euler.inl.h ../../src/math/mat3.h \
+ ../../src/math/mat3.inl.h ../../src/math/mat4.h \
+ ../../src/math/mat4.inl.h ../../src/math/m_misc.h \
+ ../../src/math/m_misc.inl.h ../../src/resources/skel_anim.h \
+ ../../src/resources/resource.h ../../src/uncategorized/engine_class.h \
+ ../../src/utility/util.h ../../src/utility/common.h \
+ ../../src/scene/skel_node.h ../../src/scene/node.h \
+ ../../src/controllers/controller.h ../../src/resources/skeleton.h \
+ ../../src/renderer/renderer.h ../../src/resources/shader_prog.h \
+ ../../src/scene/camera.h ../../src/uncategorized/collision.h
+	@echo Compiling ../../src/controllers//skel_anim_ctrl.cpp...
+	@$(CXX) $(INCPATH) $(CFLAGS) ../../src/controllers//skel_anim_ctrl.cpp -o skel_anim_ctrl.o
+
 clean:
 	rm -f *.o
 	rm -f *.gch

+ 3 - 4
build/debug/gen.cfg.py

@@ -1,9 +1,8 @@
-include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/ui/", "../../src/resources/", "../../src/utility/" ]
-#precompiled_headers = ["../../src/uncategorized/common.h"]
+include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/ui/", "../../src/resources/", "../../src/utility/", "../../src/controllers/" ]
 precompiled_headers = []
-project_name = "AnKi"
+executable_name = "AnKi.bin"
 compiler = "g++"
 common_flags = ""
 compiler_flags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -W -pipe -O0 -g3 -pg `sdl-config --cflags` -D_DEBUG_ -D_TERMINAL_COLORING_ -D_PLATFORM_LINUX_"
 precompiled_headers_flags = "-x c++-header"
-linker_flags = "-lGL -lGLU -lSDL_image `sdl-config --static-libs` -ljpeg -lGLEW"
+linker_flags = "-lGL -lGLU -lSDL_image `sdl-config --static-libs` -ljpeg -lGLEW -rdynamic"

+ 14 - 1
build/genmakefile.py

@@ -3,6 +3,19 @@ import sys, os, fnmatch, random
 from threading import Thread
 
 
+#======================================================================================================================================
+# GLOBAL VARS                                                                                                                         =
+#======================================================================================================================================
+include_paths = []
+precompiled_headers = []
+executable_name = "unamed_project"
+compiler = ""
+common_flags = ""
+compiler_flags = ""
+precompiled_headers_flags = ""
+linker_flags = ""
+
+
 #======================================================================================================================================
 # GetCommandOutput                                                                                                                    =
 #======================================================================================================================================
@@ -136,7 +149,7 @@ master_str += "COMMONFLAGS = " + common_flags + "\n"
 master_str += "CFLAGS = $(COMMONFLAGS) " + compiler_flags + "\n"
 master_str += "PHFLAGS = $(CFLAGS) " + precompiled_headers_flags + "\n"
 master_str += "LFLAGS = $(COMMONFLAGS) " + linker_flags + "\n"
-master_str += "EXECUTABLE = " + project_name + "\n"
+master_str += "EXECUTABLE = " + executable_name + "\n"
 
 master_str += "INCPATH = "
 for path in include_paths:

+ 2 - 2
build/release/gen.cfg.py

@@ -1,8 +1,8 @@
 include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/resources/", "../../src/utility/", "../../src/ui/" ]
-project_name = "AnKi"
+executable_name = "AnKi.bin"
 precompiled_headers = []
 compiler = "gcc"
 common_flags = "-fopenmp"
 compiler_flags = "-c -pedantic-errors -pedantic -ansi -Wall -Wextra -pipe `sdl-config --cflags` -s -msse3 -O3 -mtune=core2 -fsingle-precision-constant -ffast-math -D_TERMINAL_COLORING__ -D_PLATFORM_LINUX_"
 precompiled_headers_flags = ""
-linker_flags = "-lGL -lGLU -lGLEW -lSDL_image `sdl-config --static-libs` -ljpeg -lgomp"
+linker_flags = "-lGL -lGLU -lGLEW -lSDL_image `sdl-config --static-libs` -ljpeg -lgomp -rdynamic"

+ 1 - 1
build/release_icpc/gen.cfg.py

@@ -1,6 +1,6 @@
 include_paths = [ "../../src/math/", "../../src/renderer/", "../../src/tokenizer/", "../../src/", "../../src/uncategorized/" ]
 precompiled_headers = []
-project_name = "AnKi"
+executable_name = "AnKi.bin"
 compiler = "/home/godlike/.intel/Compiler/11.1/046/bin/intel64/icpc"
 common_flags = "-ipo -parallel -openmp"
 compiler_flags = "-c `sdl-config --cflags` -O3 -ipo -ip -D_TERMINAL_COLORING_ -D_PLATFORM_LINUX_"

+ 1 - 1
build/release_llvm/gen.cfg.py

@@ -1,6 +1,6 @@
 include_paths = [ "../../src/math/", "../../src/tokenizer/", "../../src/uncategorized/", "../../src/", "../../src/renderer/", "../../src/scene/", "../../src/resources/", "../../src/utility/", "../../src/ui/" ]
 precompiled_headers = []
-project_name = "AnKi"
+executable_name = "AnKi.bin"
 compiler = "/usr/lib/llvm/llvm/gcc-4.2/bin/llvm-g++"
 common_flags = "-emit-llvm"
 compiler_flags = "-c `sdl-config --cflags` -O3 -D_TERMINAL_COLORING_ -D_PLATFORM_LINUX_"

+ 14 - 0
src/controllers/README

@@ -0,0 +1,14 @@
+The controllers are part of the scene node objects. The control the node's behaviour. 
+
+They have an input (script, animation, etc) and they control a scene node. The naming convention of the controllers is:
+
+<what the controller controls>_<the input of the contoller>_ctrl_t
+
+For Example:
+
+script_trf_ctrl_t
+path_trf_ctrl_t
+anim_skel_ctrl_t
+skel_mesh_ctrl_t
+script_light_ctrl_t
+

+ 0 - 0
src/scene/controller.cpp → src/controllers/controller.cpp


+ 0 - 0
src/scene/controller.h → src/controllers/controller.h


+ 3 - 3
src/scene/light_controller.h → src/controllers/light_script_ctrl.h

@@ -1,5 +1,5 @@
-#ifndef _LIGHT_CONTROLLER_H_
-#define _LIGHT_CONTROLLER_H_
+#ifndef _LIGHT_SCRIPT_CTRL_H_
+#define _LIGHT_SCRIPT_CTRL_H_
 
 #include "common.h"
 #include "controller.h"
@@ -8,7 +8,7 @@
 class light_t;
 
 
-class light_controller_t: public controller_t
+class light_script_ctrl_t: public controller_t
 {
 	public:
 		light_t* light;

+ 4 - 4
src/scene/skel_controller.h → src/controllers/mesh_skel_ctrl.h

@@ -1,5 +1,5 @@
-#ifndef _SKEL_CONTROLLER_H_
-#define _SKEL_CONTROLLER_H_
+#ifndef _MESH_SKEL_CTRL_H_
+#define _MESH_SKEL_CTRL_H_
 
 #include "common.h"
 #include "controller.h"
@@ -14,13 +14,13 @@ class mesh_t;
  * Skeleton controller
  * It controls a mesh node using a skeleton node and the skeleton node's controllers
  */
-class skel_controller_t: public controller_t
+class mesh_skel_ctrl_t: public controller_t
 {
 	public:
 		skel_node_t* skel_node;
 		mesh_node_t* mesh_node;
 
-		skel_controller_t( skel_node_t* skel_node_, mesh_node_t* mesh_node_ ):
+		mesh_skel_ctrl_t( skel_node_t* skel_node_, mesh_node_t* mesh_node_ ):
 			controller_t( CT_SKEL ),
 			skel_node( skel_node_ ),
 			mesh_node( mesh_node_ ) 

+ 7 - 7
src/scene/skel_anim_controller.cpp → src/controllers/skel_anim_ctrl.cpp

@@ -1,4 +1,4 @@
-#include "skel_anim_controller.h"
+#include "skel_anim_ctrl.h"
 #include "skel_anim.h"
 #include "skel_node.h"
 #include "skeleton.h"
@@ -6,9 +6,9 @@
 
 
 //=====================================================================================================================================
-// skel_anim_controller_t                                                                                                             =
+// skel_anim_ctrl_t                                                                                                             =
 //=====================================================================================================================================
-skel_anim_controller_t::skel_anim_controller_t( skel_node_t* skel_node_ ):
+skel_anim_ctrl_t::skel_anim_ctrl_t( skel_node_t* skel_node_ ):
 	controller_t(CT_SKEL_ANIM),
 	skel_node( skel_node_ )
 {
@@ -22,7 +22,7 @@ skel_anim_controller_t::skel_anim_controller_t( skel_node_t* skel_node_ ):
 //=====================================================================================================================================
 // Interpolate                                                                                                                        =
 //=====================================================================================================================================
-void skel_anim_controller_t::Interpolate( skel_anim_t* animation, float frame )
+void skel_anim_ctrl_t::Interpolate( skel_anim_t* animation, float frame )
 {
 	DEBUG_ERR( frame >= animation->frames_num );
 
@@ -87,7 +87,7 @@ void skel_anim_controller_t::Interpolate( skel_anim_t* animation, float frame )
 //=====================================================================================================================================
 // UpdateBoneTransforms                                                                                                               =
 //=====================================================================================================================================
-void skel_anim_controller_t::UpdateBoneTransforms()
+void skel_anim_ctrl_t::UpdateBoneTransforms()
 {
 	uint queue[ 128 ];
 	uint head = 0, tail = 0;
@@ -132,7 +132,7 @@ void skel_anim_controller_t::UpdateBoneTransforms()
 //=====================================================================================================================================
 // Deform                                                                                                                             =
 //=====================================================================================================================================
-void skel_anim_controller_t::Deform()
+void skel_anim_ctrl_t::Deform()
 {
 	skeleton_t* skeleton = skel_node->skeleton;
 
@@ -150,7 +150,7 @@ void skel_anim_controller_t::Deform()
 //=====================================================================================================================================
 // Update                                                                                                                             =
 //=====================================================================================================================================
-void skel_anim_controller_t::Update( float )
+void skel_anim_ctrl_t::Update( float )
 {
 	frame += step;
 	if( frame > skel_anim->frames_num ) // if the crnt is finished then play the next or loop the crnt

+ 4 - 4
src/scene/skel_anim_controller.h → src/controllers/skel_anim_ctrl.h

@@ -1,5 +1,5 @@
-#ifndef _SKEL_ANIM_CONTROLLER_H_
-#define _SKEL_ANIM_CONTROLLER_H_
+#ifndef _SKEL_ANIM_CTRL_H_
+#define _SKEL_ANIM_CTRL_H_
 
 #include "common.h"
 #include "controller.h"
@@ -11,7 +11,7 @@ class skel_node_t;
 
 
 /// Skeleton animation controller
-class skel_anim_controller_t: public controller_t
+class skel_anim_ctrl_t: public controller_t
 {
 	private:
 		void Interpolate( skel_anim_t* animation, float frame );
@@ -28,7 +28,7 @@ class skel_anim_controller_t: public controller_t
 		float step;
 		float frame;
 
-		skel_anim_controller_t( skel_node_t* skel_node_ );
+		skel_anim_ctrl_t( skel_node_t* skel_node_ );
 		void Update( float time );
 };
 

+ 18 - 0
src/controllers/trf_ctrl.h

@@ -0,0 +1,18 @@
+#ifndef _TRF_SCRIPT_CTRL_H_
+#define _TRF_SCRIPT_CTRL_H_
+
+#include "common.h"
+#include "controller.h"
+
+
+/// Transform controller
+class trf_script_ctrl_t: public controller_t
+{
+	public:
+		node_t* node;
+	
+		trf_script_ctrl_t( node_t* node_ ): controller_t( CT_TRF ), node(node_) {}
+		void Update( float ) { /* ToDo */ }
+};
+
+#endif

+ 4 - 4
src/main.cpp

@@ -25,8 +25,8 @@
 #include "skel_model_node.h"
 #include "mesh_node.h"
 #include "skel_anim.h"
-#include "skel_controller.h"
-#include "skel_anim_controller.h"
+#include "mesh_skel_ctrl.h"
+#include "skel_anim_ctrl.h"
 #include "skel_node.h"
 #include "light_props.h"
 
@@ -96,8 +96,8 @@ void Init()
 	imp = new skel_model_node_t();
 	imp->Init( "models/imp/imp.smdl" );
 	imp->SetLocalTransformation( vec3_t( 0.0, 2.11, 0.0 ), mat3_t( euler_t(-m::PI/2, 0.0, 0.0) ), 0.7 );
-	imp->mesh_nodes[0]->skel_controller->skel_node->skel_anim_controller->skel_anim = rsrc::skel_anims.Load( "models/imp/walk.imp.anim" );
-	imp->mesh_nodes[0]->skel_controller->skel_node->skel_anim_controller->step = 0.8;
+	imp->mesh_nodes[0]->mesh_skel_ctrl->skel_node->skel_anim_ctrl->skel_anim = rsrc::skel_anims.Load( "models/imp/walk.imp.anim" );
+	imp->mesh_nodes[0]->mesh_skel_ctrl->skel_node->skel_anim_ctrl->step = 0.8;
 
 
 

+ 25 - 0
src/resources/path.h

@@ -0,0 +1,25 @@
+#ifndef _PATH_H_
+#define _PATH_H_
+
+#include "common.h"
+#include "resource.h"
+#include "gmath.h"
+
+
+/// Path
+class path_t: public resource_t
+{
+	public:
+		vec_t<vec3_t> positions; ///< AKA translations
+		vec_t<mat3_t> rotations;
+		vec_t<float>  scales;
+		float         step;
+
+		path_t() {}
+		~path_t() {}
+		bool Load( const char* filename );
+		void Unload() { points.clear(); }
+};
+
+
+#endif

+ 8 - 8
src/scene/mesh_node.cpp

@@ -5,8 +5,8 @@
 #include "material.h"
 #include "skel_node.h"
 #include "skeleton.h"
-#include "skel_controller.h"
-#include "skel_anim_controller.h"
+#include "mesh_skel_ctrl.h"
+#include "skel_anim_ctrl.h"
 
 
 //=====================================================================================================================================
@@ -45,13 +45,13 @@ void mesh_node_t::Render( material_t* mtl ) const
 	r::MultMatrix( transformation_wspace );
 
 	// if we have skeleton controller
-	if( skel_controller )
+	if( mesh_skel_ctrl )
 	{
 		// first the uniforms
-		glUniformMatrix3fv( mtl->uni_locs.skinning_rotations, skel_controller->skel_node->skeleton->bones.size(), 1,
-		                    &(skel_controller->skel_node->skel_anim_controller->bone_rotations[0])[0] );
-		glUniform3fv( mtl->uni_locs.skinning_translations, skel_controller->skel_node->skeleton->bones.size(),
-		              &(skel_controller->skel_node->skel_anim_controller->bone_translations[0])[0] );
+		glUniformMatrix3fv( mtl->uni_locs.skinning_rotations, mesh_skel_ctrl->skel_node->skeleton->bones.size(), 1,
+		                    &(mesh_skel_ctrl->skel_node->skel_anim_ctrl->bone_rotations[0])[0] );
+		glUniform3fv( mtl->uni_locs.skinning_translations, mesh_skel_ctrl->skel_node->skeleton->bones.size(),
+		              &(mesh_skel_ctrl->skel_node->skel_anim_ctrl->bone_translations[0])[0] );
 
 		// then the attributes
 		DEBUG_ERR( !mtl->HasHWSkinning() );
@@ -103,7 +103,7 @@ void mesh_node_t::Render( material_t* mtl ) const
 	if( mtl->attrib_locs.tex_coords != -1 ) glDisableVertexAttribArray( mtl->attrib_locs.tex_coords );
 	if( mtl->attrib_locs.tanget != -1 ) glDisableVertexAttribArray( mtl->attrib_locs.tanget );
 
-	if( skel_controller )
+	if( mesh_skel_ctrl )
 	{
 		glDisableVertexAttribArray( mtl->attrib_locs.vert_weight_bones_num );
 		glDisableVertexAttribArray( mtl->attrib_locs.vert_weight_bone_ids );

+ 3 - 3
src/scene/mesh_node.h

@@ -5,7 +5,7 @@
 #include "node.h"
 #include "material.h"
 
-class skel_controller_t;
+class mesh_skel_ctrl_t;
 class mesh_t;
 
 
@@ -21,9 +21,9 @@ class mesh_node_t: public node_t
 		material_t* material;
 		material_t* dp_material; ///< Depth pass material
 		// controllers
-		skel_controller_t* skel_controller;
+		mesh_skel_ctrl_t* mesh_skel_ctrl;
 		// funcs
-		mesh_node_t(): node_t(NT_MESH), skel_controller(NULL) {}
+		mesh_node_t(): node_t(NT_MESH), mesh_skel_ctrl(NULL) {}
 		void Render() { Render(material); }
 		void RenderDepth() { Render( material->dp_mtl ); }
 		void Init( const char* filename );

+ 3 - 3
src/scene/skel_model_node.cpp

@@ -1,9 +1,9 @@
 #include "skel_model_node.h"
 #include "parser.h"
 #include "skel_node.h"
-#include "skel_controller.h"
+#include "mesh_skel_ctrl.h"
 
-/// Create a skel_node and N mesh_nodes that have a skel_controller
+/// Create a skel_node and N mesh_nodes that have a mesh_skel_ctrl
 void skel_model_node_t::Init( const char* filename )
 {
 	scanner_t scanner;
@@ -59,6 +59,6 @@ void skel_model_node_t::Init( const char* filename )
 		mesh_nodes[i] = new mesh_node_t;
 		mesh_nodes[i]->Init( token->value.string );
 		skel_node->AddChild( mesh_nodes[i] );
-		mesh_nodes[i]->skel_controller = new skel_controller_t( skel_node, mesh_nodes[i] );
+		mesh_nodes[i]->mesh_skel_ctrl = new mesh_skel_ctrl_t( skel_node, mesh_nodes[i] );
 	}
 }

+ 6 - 6
src/scene/skel_node.cpp

@@ -2,7 +2,7 @@
 #include "renderer.h"
 #include "skel_anim.h"
 #include "skeleton.h"
-#include "skel_anim_controller.h"
+#include "skel_anim_ctrl.h"
 
 
 //=====================================================================================================================================
@@ -10,7 +10,7 @@
 //=====================================================================================================================================
 skel_node_t::skel_node_t(): 
 	node_t( NT_SKELETON ),
-	skel_anim_controller( NULL )
+	skel_anim_ctrl( NULL )
 {
 }
 
@@ -21,7 +21,7 @@ skel_node_t::skel_node_t():
 void skel_node_t::Init( const char* filename )
 {
 	skeleton = rsrc::skeletons.Load( filename );
-	skel_anim_controller = new skel_anim_controller_t( this );
+	skel_anim_ctrl = new skel_anim_ctrl_t( this );
 }
 
 
@@ -49,13 +49,13 @@ void skel_node_t::Render()
 	{
 		glColor3fv( &vec3_t( 1.0, 1.0, 1.0 )[0] );
 		glBegin( GL_POINTS );
-			glVertex3fv( &skel_anim_controller->heads[i][0] );
+			glVertex3fv( &skel_anim_ctrl->heads[i][0] );
 		glEnd();
 
 		glBegin( GL_LINES );
-			glVertex3fv( &skel_anim_controller->heads[i][0] );
+			glVertex3fv( &skel_anim_ctrl->heads[i][0] );
 			glColor3fv( &vec3_t( 1.0, 0.0, 0.0 )[0] );
-			glVertex3fv( &skel_anim_controller->tails[i][0] );
+			glVertex3fv( &skel_anim_ctrl->tails[i][0] );
 		glEnd();
 	}
 

+ 2 - 2
src/scene/skel_node.h

@@ -7,7 +7,7 @@
 #include "gmath.h"
 
 class skeleton_t;
-class skel_anim_controller_t;
+class skel_anim_ctrl_t;
 
 
 /// Skeleton node
@@ -15,7 +15,7 @@ class skel_node_t: public node_t
 {
 	public:
 		skeleton_t* skeleton; ///< The skeleton resource
-		skel_anim_controller_t* skel_anim_controller; ///< Hold the controller here as well
+		skel_anim_ctrl_t* skel_anim_ctrl; ///< Hold the controller here as well
 
 		skel_node_t();
 		void Render();

+ 0 - 18
src/scene/trf_controller.h

@@ -1,18 +0,0 @@
-#ifndef _TRF_CONTROLLER_H_
-#define _TRF_CONTROLLER_H_
-
-#include "common.h"
-#include "controller.h"
-
-
-/// Transform controller
-class trf_controller_t: public controller_t
-{
-	public:
-		node_t* node;
-	
-		trf_controller_t( node_t* node_ ): controller_t( CT_TRF ), node(node_) {}
-		void Update( float ) { /* ToDo */ }
-};
-
-#endif

+ 1 - 1
src/tokenizer/scanner.cpp

@@ -252,7 +252,7 @@ void scanner_t::GetAllPrintAll()
 // LoadFile                                                                                                                           =
 //=====================================================================================================================================
 bool scanner_t::LoadFile( const char* filename_ )
-{
+{	
 	in_fstream.open( filename_, ios::in );
 	if( !in_fstream.good() )
 	{