diff --git a/ege/Entity.cpp b/ege/Entity.cpp index 53d4093..6185078 100644 --- a/ege/Entity.cpp +++ b/ege/Entity.cpp @@ -39,6 +39,8 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { EGE_ERROR("try to add an empty component"); return; } + EGE_PRINT("Entity: Add New component ... [START]"); + // Componenet to remove if it have the same type of the previous Component: ememory::SharedPtr componentRemoved; int32_t findId = -1; // check if not exist @@ -74,11 +76,14 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { continue; } if (componentRemoved != null) { + EGE_PRINT("Entity: ==> remove previous component"); m_env->engineComponentRemove(componentRemoved); m_component[iii]->removeFriendComponent(componentRemoved); } + EGE_PRINT("Entity: ==> add New component"); m_env->engineComponentAdd(_ref); m_component[iii]->addFriendComponent(_ref); + break; } // notify new component of all previously added component: componentRemoved = _ref; @@ -91,6 +96,7 @@ void ege::Entity::addComponent(const ememory::SharedPtr& _ref) { } componentRemoved->addFriendComponent(m_component[iii]); } + EGE_PRINT("Entity: Add New component ... [END]"); } void ege::Entity::rmComponent(const ememory::SharedPtr& _ref) { diff --git a/ege/debug.hpp b/ege/debug.hpp index 62fabef..1e29b41 100644 --- a/ege/debug.hpp +++ b/ege/debug.hpp @@ -12,6 +12,7 @@ namespace ege { }; #define EGE_BASE(info,data) ELOG_BASE(ege::getLogId(),info,data) +#define EGE_PRINT(data) EGE_BASE(-1, data) #define EGE_CRITICAL(data) EGE_BASE(1, data) #define EGE_ERROR(data) EGE_BASE(2, data) #define EGE_WARNING(data) EGE_BASE(3, data) diff --git a/ege/ia/Component.cpp b/ege/ia/Component.cpp index 5d16334..9182d43 100644 --- a/ege/ia/Component.cpp +++ b/ege/ia/Component.cpp @@ -10,3 +10,6 @@ const etk::String& ege::ia::Component::getType() const { return tmp; } +void ege::ia::Component::update(float _delta) { + +} diff --git a/ege/ia/Component.hpp b/ege/ia/Component.hpp index c34dc8e..9d9e4c4 100644 --- a/ege/ia/Component.hpp +++ b/ege/ia/Component.hpp @@ -16,6 +16,8 @@ namespace ege { public: virtual const etk::String& getType() const override; + // call of this function every time the call will be done + virtual void update(float _delta); }; } } \ No newline at end of file diff --git a/ege/ia/ComponentLua.cpp b/ege/ia/ComponentLua.cpp new file mode 100644 index 0000000..ea7fa63 --- /dev/null +++ b/ege/ia/ComponentLua.cpp @@ -0,0 +1,16 @@ +/** @file + * @author Edouard DUPIN + * @copyright 2011, Edouard DUPIN, all right reserved + * @license MPL v2.0 (see license file) + */ +#include + +ege::ia::ComponentLua::ComponentLua(const etk::String& _fileName) { + // Load the current IA file interface ==> init... + m_engine.executeFile(_fileName); +} + + +void ege::ia::ComponentLua::update(float _delta) { + m_engine.callVoid("update", float(_delta)); +} diff --git a/ege/ia/ComponentLua.hpp b/ege/ia/ComponentLua.hpp new file mode 100644 index 0000000..bac88cf --- /dev/null +++ b/ege/ia/ComponentLua.hpp @@ -0,0 +1,21 @@ +/** @file + * @author Edouard DUPIN + * @copyright 2011, Edouard DUPIN, all right reserved + * @license MPL v2.0 (see license file) + */ +#pragma once + +#include +#include + +namespace ege { + namespace ia { + class ComponentLua : public ege::ia::Component { + public: + ComponentLua(const etk::String& _fileName); + void update(float _delta) override; + private: + luaWrapper::Lua m_engine; + }; + } +} \ No newline at end of file diff --git a/ege/ia/Engine.cpp b/ege/ia/Engine.cpp index 6d518eb..e10d9db 100644 --- a/ege/ia/Engine.cpp +++ b/ege/ia/Engine.cpp @@ -4,6 +4,7 @@ * @license MPL v2.0 (see license file) */ #include +#include ege::ia::Engine::Engine(ege::Environement* _env) : ege::Engine(_env) { @@ -16,9 +17,66 @@ const etk::String& ege::ia::Engine::getType() const { } void ege::ia::Engine::componentRemove(const ememory::SharedPtr& _ref) { - + ememory::SharedPtr ref = ememory::dynamicPointerCast(_ref); + for (auto it=m_component.begin(); + it != m_component.end(); + ++it) { + if (*it == ref) { + it->reset(); + return; + } + } } void ege::ia::Engine::componentAdd(const ememory::SharedPtr& _ref) { - + ememory::SharedPtr ref = ememory::dynamicPointerCast(_ref); + EGE_WARNING("ADD COMPONENT " << uint64_t(ref.get()) ); + if (ref == null) { + return; + } + #if DEBUG + for (auto it=m_component.begin(); + it != m_component.end(); + ++it) { + if (*it != null) { + if (*it == ref) { + EGE_ERROR("Try Add multiple time the same Component in the IA Engine " << uint64_t(ref.get()) ); + } + } + } + #endif + for (auto it=m_component.begin(); + it != m_component.end(); + ++it) { + if (*it == null) { + *it = ref; + return; + } + } + m_component.pushBack(ref); +} + +// Constant physics time step ==> 10 time / seconds +// TODO: set it configurable, some games need more, and soem other just need really less ==> or set it configurable with the internal component +static const float timeStep = 5.0; + +void ege::ia::Engine::update(const echrono::Duration& _delta) { + float deltaTime = _delta.toSeconds(); + // Add the time difference in the accumulator + m_accumulator += deltaTime; + // While there is enough accumulated time to take one or several physics steps + while (m_accumulator >= timeStep) { + EGE_WARNING("Generate for " << m_accumulator << " / " << timeStep << " for:" << m_component.size()); + // call every object to usdate their constant forces applyed + for (auto &it: m_component) { + // check null pointer + if (it == null) { + // no pointer null are set in the output list ... + continue; + } + it->update(timeStep); + } + // Decrease the accumulated time + m_accumulator -= timeStep; + } } diff --git a/ege/ia/Engine.hpp b/ege/ia/Engine.hpp index f8afcd9..f149d81 100644 --- a/ege/ia/Engine.hpp +++ b/ege/ia/Engine.hpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace ege { @@ -20,11 +21,14 @@ namespace ege { ~Engine() {} // update cycle - void update(float _delta) {} + void update(const echrono::Duration& _delta) override; public: const etk::String& getType() const override; void componentRemove(const ememory::SharedPtr& _ref) override; void componentAdd(const ememory::SharedPtr& _ref) override; + protected: + etk::Vector> m_component; + float m_accumulator; // limit call of IA process }; } } diff --git a/ege/physics/Engine.cpp b/ege/physics/Engine.cpp index 513f2e8..d3dc6ad 100644 --- a/ege/physics/Engine.cpp +++ b/ege/physics/Engine.cpp @@ -73,6 +73,17 @@ void ege::physics::Engine::componentRemove(const ememory::SharedPtr& _ref) { ememory::SharedPtr ref = ememory::dynamicPointerCast(_ref); + #if DEBUG + for (auto it=m_component.begin(); + it != m_component.end(); + ++it) { + if (*it != null) { + if (*it == ref) { + EGE_ERROR("Try Add multiple time the same Component in the Physic Engine " << uint64_t(ref.get()) ); + } + } + } + #endif for (auto it=m_component.begin(); it != m_component.end(); ++it) { @@ -118,7 +129,7 @@ void ege::physics::Engine::setGravity(const vec3& _axePower) { } // Constant physics time step -const float timeStep = 1.0 / 60.0; +static const float timeStep = 1.0 / 60.0; void ege::physics::Engine::update(const echrono::Duration& _delta) { float deltaTime = _delta.toSeconds(); diff --git a/ege/resource/ParticuleMesh.cpp b/ege/resource/ParticuleMesh.cpp index 22c185e..9ddf4d1 100644 --- a/ege/resource/ParticuleMesh.cpp +++ b/ege/resource/ParticuleMesh.cpp @@ -64,7 +64,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, int32_t nbElementDrawTheoric = 0; int32_t nbElementDraw = 0; #endif - for (int32_t kkk=0; kkk +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +appl::Windows::Windows() { + addObjectType("appl::Windows"); + propertyTitle.setDirectCheck("example ege : Artificial Intelligence"); +} + + +static ememory::SharedPtr createViewBoxStar() { + ememory::SharedPtr out = ege::resource::Mesh::create("viewBoxStar", "DATA:texturedNoMaterial.prog"); + if (out != null) { + ememory::SharedPtr material = ememory::makeShared(); + // set the entity material properties : + material->setAmbientFactor(vec4(1,1,1,1)); + material->setDiffuseFactor(vec4(0,0,0,1)); + material->setSpecularFactor(vec4(0,0,0,1)); + material->setShininess(1); + // 1024 == > 1<<9 + // 2048 == > 1<<10 + // 4096 == > 1<<11 + int32_t size = 1<<11; + //material->setTexture0(""); //" + material->setTexture0Magic(ivec2(size,size)); + out->addMaterial("basics", material); + //material->setImageSize(ivec2(size,size)); + egami::Image* myImage = material->get(); + if (myImage == null) { + return out; + } + myImage->clear(etk::color::black); + ivec2 tmpPos; + for (int32_t iii=0; iii<6000; iii++) { + tmpPos.setValue(etk::tool::frand(0,size), etk::tool::frand(0,size)) ; + myImage->set(tmpPos, etk::color::white); + } + material->flush(); + // basis on cube : + out->createViewBox("basics", 1000/* distance */); + // generate the VBO + out->generateVBO(); + } + return out; +} + + + +void appl::Windows::init() { + ewol::widget::Windows::init(); + + // TODO : Auto mode : getObjectManager().periodicCall.connect(sharedFromThis(), &appl::Windows::onCallbackPeriodicUpdateCamera); + + m_env = ege::Environement::create(); + // Create basic Camera + m_camera = ememory::makeShared(); + m_env->addCamera("basic", m_camera); + m_cameraControler.setCamera(m_camera); + + ememory::SharedPtr tmpWidget = ege::widget::Scene::create(); + if (tmpWidget == null) { + APPL_ERROR("Can not allocate widget ==> display might be in error"); + } else { + tmpWidget->setEnv(m_env); + tmpWidget->propertyExpand.set(bvec2(true,true)); + tmpWidget->propertyFill.set(bvec2(true,true)); + tmpWidget->setCamera("basic"); + setSubWidget(tmpWidget); + } + ememory::SharedPtr myMesh; + // Create an external box: (no physics) + myMesh = createViewBoxStar(); + if (myMesh != null) { + ememory::SharedPtr entity = ememory::makeShared(m_env); + // 1st Position component: + etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); + ememory::SharedPtr componentPosition = ememory::makeShared(transform); + entity->addComponent(componentPosition); + // 2nd something to diplay: + ememory::SharedPtr componentRender = ememory::makeShared(myMesh); + entity->addComponent(componentRender); + // add it .. + m_env->addEntity(entity); + } + // create basic gird: (no physics) + myMesh = ege::resource::Mesh::createGrid(10, vec3(0,0,0), 5); + if (myMesh != null) { + ememory::SharedPtr entity = ememory::makeShared(m_env); + // 1st Position component: + etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); + ememory::SharedPtr componentPosition = ememory::makeShared(transform); + entity->addComponent(componentPosition); + // 2nd something to diplay: + ememory::SharedPtr componentRender = ememory::makeShared(myMesh); + entity->addComponent(componentRender); + // add it .. + m_env->addEntity(entity); + } + myMesh = ege::resource::Mesh::create("DATA:tower.emf"); + if (myMesh != null) { + ememory::SharedPtr entity = ememory::makeShared(m_env); + // add all component: + // 1st Position component: + etk::Transform3D transform(vec3(0,0,0), etk::Quaternion::identity()); + // 2nd something to diplay: + ememory::SharedPtr componentRender = ememory::makeShared(myMesh); + entity->addComponent(componentRender); + // 3rd some physic: + ememory::SharedPtr componentPhysics = ememory::makeShared(m_env, transform); + componentPhysics->setShape(myMesh->getPhysicalProperties()); + componentPhysics->generate(); + entity->addComponent(componentPhysics); + // 3rd this object have some intelligence: + ememory::SharedPtr componentIA = ememory::makeShared("DATA:tower.lua"); + entity->addComponent(componentIA); + // add it .. + m_env->addEntity(entity); + } + m_env->propertyStatus.set(ege::gameStart); + tmpWidget->propertyDebugPhysic.set(true); + tmpWidget->propertyDebugNormal.set(true); +} + + +bool appl::Windows::onEventEntry(const ewol::event::Entry& _event) { + if (m_cameraControler.onEventEntry(_event) == true) { + return true; + } + return false; +} + +bool appl::Windows::onEventInput(const ewol::event::Input& _event) { + if (m_cameraControler.onEventInput(_event, relativePosition(_event.getPos())) == true) { + return true; + } + return false; +} diff --git a/sample/IA/appl/Windows.hpp b/sample/IA/appl/Windows.hpp new file mode 100644 index 0000000..420b2f4 --- /dev/null +++ b/sample/IA/appl/Windows.hpp @@ -0,0 +1,35 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2010, Edouard DUPIN, all right reserved + * + * @license MPL v2.0 (see license file) + */ +#pragma once + +#include +#include +#include +#include + +namespace appl { + class Windows : public ewol::widget::Windows { + private: + ememory::SharedPtr m_env; + ememory::SharedPtr m_camera; + ege::camera::ControlBase m_cameraControler; + protected: + Windows(); + void init() override; + public: + DECLARE_FACTORY(Windows); + virtual ~Windows() { }; + private: + void onCallbackPeriodicUpdateCamera(const ewol::event::Time& _event); + private: + // need this to forward if to the camera controler ... + bool onEventEntry(const ewol::event::Entry& _event) override; + bool onEventInput(const ewol::event::Input& _event) override; + }; +} + diff --git a/sample/IA/appl/debug.cpp b/sample/IA/appl/debug.cpp new file mode 100644 index 0000000..4f5780b --- /dev/null +++ b/sample/IA/appl/debug.cpp @@ -0,0 +1,15 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2010, Edouard DUPIN, all right reserved + * + * @license MPL v2.0 (see license file) + */ + + +#include + +int32_t appl::getLogId() { + static int32_t g_val = elog::registerInstance("GP-spaceShip"); + return g_val; +} diff --git a/sample/IA/appl/debug.hpp b/sample/IA/appl/debug.hpp new file mode 100644 index 0000000..4c40487 --- /dev/null +++ b/sample/IA/appl/debug.hpp @@ -0,0 +1,40 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2010, Edouard DUPIN, all right reserved + * + * @license MPL v2.0 (see license file) + */ +#pragma once + +#include + +namespace appl { + int32_t getLogId(); +} +#define APPL_BASE(info,data) ELOG_BASE(appl::getLogId(),info,data) + +#define APPL_PRINT(data) APPL_BASE(-1, data) +#define APPL_CRITICAL(data) APPL_BASE(1, data) +#define APPL_ERROR(data) APPL_BASE(2, data) +#define APPL_WARNING(data) APPL_BASE(3, data) +#ifdef DEBUG + #define APPL_INFO(data) APPL_BASE(4, data) + #define APPL_DEBUG(data) APPL_BASE(5, data) + #define APPL_VERBOSE(data) APPL_BASE(6, data) + #define APPL_TODO(data) APPL_BASE(4, "TODO : " << data) +#else + #define APPL_INFO(data) do { } while(false) + #define APPL_DEBUG(data) do { } while(false) + #define APPL_VERBOSE(data) do { } while(false) + #define APPL_TODO(data) do { } while(false) +#endif + +#define APPL_ASSERT(cond,data) \ + do { \ + if (!(cond)) { \ + APPL_CRITICAL(data); \ + assert(!#cond); \ + } \ + } while (0) + diff --git a/sample/IA/appl/main.cpp b/sample/IA/appl/main.cpp new file mode 100644 index 0000000..27c65e7 --- /dev/null +++ b/sample/IA/appl/main.cpp @@ -0,0 +1,67 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2010, Edouard DUPIN, all right reserved + * + * @license MPL v2.0 (see license file) + */ + + +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace appl { + class MainApplication : public ewol::context::Application { + public: + void onCreate(ewol::Context& _context) override { + APPL_INFO(" == > CREATE ... " << PROJECT_NAME << " v" << APPL_VERSION << " (START) [" << gale::getBoardType() << "] (" << gale::getCompilationMode() << ") (BEGIN)"); + for( int32_t iii=0 ; iii<_context.getCmd().size(); iii++) { + etk::String tmpppp = _context.getCmd().get(iii); + if ( tmpppp == "-h" + || tmpppp == "--help") { + APPL_INFO(" -h/--help display this help" ); + exit(0); + } + } + // TODO : Remove this : Move if in the windows properties + _context.setSize(vec2(800, 600)); + + // select internal data for font ... + _context.getFontDefault().setUseExternal(true); + _context.getFontDefault().set("FreeSerif;DejaVuSansMono", 19); + + ememory::SharedPtr basicWindows = appl::Windows::create(); + // create the specific windows + _context.setWindows(basicWindows); + APPL_INFO("==> CREATE ... " PROJECT_NAME " (END)"); + } + + void onStart(ewol::Context& _context) override { + APPL_INFO("==> START ... " PROJECT_NAME " (BEGIN)"); + // nothing to do ... + APPL_INFO("==> START ... " PROJECT_NAME " (END)"); + } + void onStop(ewol::Context& _context) override { + APPL_INFO("==> STOP ... " PROJECT_NAME " (START)"); + // nothing to do ... + APPL_INFO("==> STOP ... " PROJECT_NAME " (END)"); + } + }; +} +/** + * @brief Main of the program (This can be set in every case, but it is not used in Andoid...). + * @param std IO + * @return std IO + */ +int main(int _argc, const char *_argv[]) { + return ewol::run(ETK_NEW(appl::MainApplication), _argc, _argv); +} + + diff --git a/sample/IA/appl/main.hpp b/sample/IA/appl/main.hpp new file mode 100644 index 0000000..91c03bf --- /dev/null +++ b/sample/IA/appl/main.hpp @@ -0,0 +1,9 @@ +/** + * @author Edouard DUPIN + * + * @copyright 2010, Edouard DUPIN, all right reserved + * + * @license MPL v2.0 (see license file) + */ +#pragma once + diff --git a/sample/IA/data/tower.blend b/sample/IA/data/tower.blend new file mode 100644 index 0000000..eca4350 Binary files /dev/null and b/sample/IA/data/tower.blend differ diff --git a/sample/IA/data/tower.blend1 b/sample/IA/data/tower.blend1 new file mode 100644 index 0000000..75c87c9 Binary files /dev/null and b/sample/IA/data/tower.blend1 differ diff --git a/sample/IA/data/tower.emf b/sample/IA/data/tower.emf new file mode 100644 index 0000000..955493e --- /dev/null +++ b/sample/IA/data/tower.emf @@ -0,0 +1,61 @@ +EMF(STRING) +# Blender v2.79 (sub 0) EMF File: 'tower.blend' +Mesh:Arbre_Normal_Cylinder.002 + Vertex:46 + 1.069005 3.112304 -0.025150|2.853355 1.343076 -0.025150|2.864047 -1.169684 -0.025150|1.094818 -2.954032 -0.025150|-1.417942 -2.964725 -0.025150|-3.202291 -1.195495 -0.025150|-3.212983 1.317264 -0.025150|-1.443754 3.101613 -0.025150|4.864760 -1.378834 39.491188|2.573533 -4.188148 13.610696|2.550247 4.372152 13.763056|0.797895 2.449828 3.651479|2.193210 1.066338 3.651479|2.201570 -0.898573 3.651479|0.818080 -2.293888 3.651479|-1.146831 -2.302248 3.651479|-2.542146 -0.918756 3.651479|-2.550506 1.046154 3.651479|-1.167017 2.441468 3.651479|1.813901 0.907330 11.753383|1.820923 -0.742798 11.753383|0.659070 -1.914580 11.448664|-0.991056 -1.921600 11.753383|-2.162838 -0.759748 11.753383|-2.169859 0.890379 11.583043|-1.008008 2.062160 11.753383|0.642120 2.069181 11.753383|-2.922470 4.335726 18.342533|-2.922470 4.335726 13.677886|2.550247 4.372152 18.427702|-2.899184 -4.224570 13.763056|2.573533 -4.188148 18.275343|-2.899184 -4.224570 18.427702|9.985636 -13.979649 27.016886|-1.247164 1.241499 19.622894|0.889137 1.251479 19.635977|0.898226 -1.093919 19.606348|-1.238073 -1.103898 19.612017|3.685154 -0.754828 14.929379|3.651026 0.938832 14.998319|3.651026 0.938832 17.109020|3.685154 -0.754828 17.040079|14.711964 -0.754827 14.929379|14.677835 0.938832 14.998319|14.677835 0.938832 17.109020|14.711964 -0.754827 17.040079| + Normal(face):84 + -0.000000 0.000000 -1.000000|0.692971 0.698893 0.177029|0.984197 0.004188 0.177030|0.698893 -0.692971 0.177030|0.004188 -0.984197 0.177029|-0.692971 -0.698893 0.177030|-0.984197 -0.004188 0.177029|-0.004188 0.984197 0.177029|-0.698893 0.692971 0.177029|0.703318 0.709330 0.046849|0.998893 0.004250 0.046849|0.709268 -0.703257 0.048675|0.004250 -0.998806 0.048675|-0.703319 -0.709329 0.046849|-0.998845 -0.004250 0.047853|-0.004250 0.998893 0.046849|-0.709296 0.703285 0.047853|0.692971 0.698894 0.177029|0.984197 0.004187 0.177029|0.698894 -0.692971 0.177029|0.004187 -0.984197 0.177030|-0.984197 -0.004187 0.177030|-0.698894 0.692971 0.177029|0.703319 0.709329 0.046849|0.998893 0.004251 0.046849|0.703239 -0.709419 0.046680|0.012870 -0.998827 0.046680|-0.998906 0.000576 0.046755|-0.712723 0.699886 0.046755|-0.000000 -0.040672 0.999173|0.000000 -1.000000 0.000000|-0.000000 0.040671 -0.999173|0.000000 1.000000 0.000000|0.999797 0.020146 -0.000000|-0.393778 -0.397144 -0.828985|0.523432 -0.312899 -0.792536|0.393778 0.397144 -0.828985|-0.320729 0.439945 -0.838797|0.951376 -0.308031 0.000000|0.004145 -0.356739 0.934195|-0.007405 0.364480 0.931182|0.002675 -0.004627 0.999986|0.755196 -0.009611 0.655429|0.952254 0.305308 -0.000000|0.746418 0.013872 -0.665332|0.028258 -0.382042 0.923713|-0.016920 0.374459 0.927089|-0.006064 -0.012655 0.999901|0.758604 -0.011231 0.651455|0.799250 0.040513 -0.599632|0.932442 0.008965 -0.361208|-0.016842 -0.649447 -0.760220|-0.956977 -0.033821 -0.288187|0.007420 0.653983 -0.756473|-0.999996 -0.002720 0.000000|0.006655 -0.999978 0.000000|-0.006656 0.999978 0.000000|0.607779 -0.012479 0.794008|-0.614232 -0.006041 0.789102|0.936710 0.003986 -0.350083|-0.120039 -0.735340 -0.666982|-0.935520 -0.006059 -0.353222|-0.002743 0.644733 -0.764403|0.597770 -0.007810 0.801630|-0.588511 0.006443 0.808464| + Face:84 + troc + 6/0 7/0 3/0| 11/1 1/1 0/1| 1/2 13/2 2/2| 13/3 3/3 2/3| 14/4 4/4 3/4| 15/5 5/5 4/5| 16/6 6/6 5/6| 18/7 0/7 7/7| 17/8 7/8 6/8| 26/9 12/9 11/9| 12/10 20/10 13/10| 13/11 21/11 14/11| 21/12 15/12 14/12| 15/13 23/13 16/13| 16/14 24/14 17/14| 25/15 11/15 18/15| 24/16 18/16 17/16| 7/0 0/0 3/0| 0/0 1/0 3/0| 1/0 2/0 3/0| 3/0 4/0 5/0| 5/0 6/0 3/0| 11/17 12/17 1/17| 1/18 12/18 13/18| 13/19 14/19 3/19| 14/20 15/20 4/20| 15/5 16/5 5/5| 16/21 17/21 6/21| 18/7 11/7 0/7| 17/22 18/22 7/22| 26/23 19/23 12/23| 12/24 19/24 20/24| 13/25 20/25 21/25| 21/26 22/26 15/26| 15/13 22/13 23/13| 16/27 23/27 24/27| 25/15 26/15 11/15| 24/28 25/28 18/28| + Material.001 + 41/29 44/29 40/29| 38/30 45/30 41/30| 38/31 43/31 42/31| 40/32 43/32 39/32| 43/33 45/33 42/33| 41/29 45/29 44/29| 38/30 42/30 45/30| 38/31 39/31 43/31| 40/32 44/32 43/32| 43/33 44/33 45/33| + Material.002 + 22/34 30/34 23/34| 20/35 9/35 21/35| 10/36 19/36 26/36| 24/37 28/37 25/37| 31/38 38/38 41/38| 32/39 36/39 37/39| 29/40 34/40 35/40| 36/41 34/41 37/41| 31/42 40/42 29/42| 10/43 40/43 39/43| 10/44 38/44 9/44| 31/38 9/38 38/38| 32/45 31/45 36/45| 29/46 27/46 34/46| 36/47 35/47 34/47| 31/48 41/48 40/48| 10/43 29/43 40/43| 10/49 39/49 38/49| + Material.003 + 20/50 10/50 9/50| 22/51 9/51 30/51| 23/52 28/52 24/52| 26/53 28/53 10/53| 30/54 27/54 28/54| 30/55 31/55 32/55| 10/56 27/56 29/56| 29/57 36/57 31/57| 27/58 37/58 34/58| 20/59 19/59 10/59| 22/60 21/60 9/60| 23/61 30/61 28/61| 26/62 25/62 28/62| 30/54 32/54 27/54| 30/55 9/55 31/55| 10/56 28/56 27/56| 29/63 35/63 36/63| 27/64 32/64 37/64| + Physics: + Cylinder + radius:0.24216008186340332 + size:2.0 + origin:-0.0126615 0.0444214 2.88964 + rotate:0 0 1.96444e-08 1 + mass:5.836589337064879 + Sphere + radius:0.8244769909363967 + origin:0.128048 0.0593033 8.31704 + rotate:0 0 1.96444e-08 1 + mass:178.05015608942654 + +Materials:Material.001 + Ns 96.078431 + Ka 0.000000 0.000000 0.000000 + Kd 0.277363 0.446672 0.072673 + Ks 0.500000 0.500000 0.500000 + Ni 1.000000 + d 1.000000 + illum 2 +Materials:Material.002 + Ns 96.078431 + Ka 0.000000 0.000000 0.000000 + Kd 0.223115 0.223115 0.018523 + Ks 0.500000 0.500000 0.500000 + Ni 1.000000 + d 1.000000 + illum 2 +Materials:Material.003 + Ns 96.078431 + Ka 0.000000 0.000000 0.000000 + Kd 0.640000 0.640000 0.640000 + Ks 0.500000 0.500000 0.500000 + Ni 1.000000 + d 1.000000 + illum 2 +Materials:troc + Ns 96.078431 + Ka 0.000000 0.000000 0.000000 + Kd 0.046244 0.031637 0.010962 + Ks 0.500000 0.500000 0.500000 + Ni 1.000000 + d 1.000000 + illum 2 diff --git a/sample/IA/data/tower.lua b/sample/IA/data/tower.lua new file mode 100644 index 0000000..724978f --- /dev/null +++ b/sample/IA/data/tower.lua @@ -0,0 +1,9 @@ + + +-- +-- Generic update function called by the IA center engine +-- +function update(deltaTime) + print("hello how are you ?", deltaTime) +end + diff --git a/sample/IA/lutin_ege-sample-ia.py b/sample/IA/lutin_ege-sample-ia.py new file mode 100644 index 0000000..3b1648e --- /dev/null +++ b/sample/IA/lutin_ege-sample-ia.py @@ -0,0 +1,52 @@ +#!/usr/bin/python +import lutin.debug as debug +import lutin.tools as tools + + +def get_type(): + return "BINARY" + +def get_sub_type(): + return "SAMPLE" + +def get_name(): + return "ege-sample-ia" + +def get_desc(): + return "ege sample : Artificial intelligence" + +def get_licence(): + return "MPL-2" + +def get_compagny_type(): + return "com" + +def get_compagny_name(): + return "atria-soft" + +def get_maintainer(): + return ["Mr DUPIN Edouard "] + +def get_version(): + return [0,1] + +def configure(target, my_module): + my_module.add_extra_flags() + my_module.add_src_file([ + 'appl/debug.cpp', + 'appl/main.cpp', + 'appl/Windows.cpp', + ]) + my_module.add_depend('ege') + my_module.add_path(".") + my_module.copy_path("data/*.emf") + my_module.copy_path("data/*.lua") + my_module.add_flag('c++', [ + "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", + "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"", + ]) + # set the package properties: + my_module.set_pkg("SECTION", ["Game"]) + my_module.set_pkg("PRIORITY", "optional") + return True + diff --git a/sample/LowPoly/lutin_ege-sample-low-poly.py b/sample/LowPoly/lutin_ege-sample-low-poly.py index f8facb3..401f81d 100644 --- a/sample/LowPoly/lutin_ege-sample-low-poly.py +++ b/sample/LowPoly/lutin_ege-sample-low-poly.py @@ -10,10 +10,10 @@ def get_sub_type(): return "SAMPLE" def get_name(): - return "ege-sample-CameraPosition" + return "ege-sample-LowPoly" def get_desc(): - return "ege sample : CameraPisition" + return "ege sample : Low poly test" def get_licence(): return "MPL-2" @@ -32,24 +32,18 @@ def get_version(): def configure(target, my_module): my_module.add_extra_flags() - my_module.add_src_file([ 'appl/debug.cpp', 'appl/main.cpp', - 'appl/Windows.cpp' + 'appl/Windows.cpp', ]) - my_module.add_depend('ege') - my_module.add_path(".") - my_module.copy_path("data/*.emf") - my_module.add_flag('c++', [ "-DPROJECT_NAME=\"\\\"" + my_module.get_name() + "\\\"\"", - "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"" + "-DAPPL_VERSION=\"\\\"" + tools.version_to_string(get_version()) + "\\\"\"", ]) - # set the package properties: my_module.set_pkg("SECTION", ["Game"]) my_module.set_pkg("PRIORITY", "optional")