Changeset 8783 in orxonox.OLD for trunk/src/world_entities
- Timestamp:
- Jun 26, 2006, 2:00:31 PM (19 years ago)
- Location:
- trunk/src/world_entities
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/world_entities/npcs/generic_npc.cc
r8724 r8783 125 125 * @param coordinate: coordinate to go to 126 126 */ 127 bool GenericNPC::walkTo(const Vector& coordinate, float time)127 float GenericNPC::walkTo(const Vector& coordinate, const Quaternion& dir) 128 128 { 129 129 … … 136 136 * @param coordinate: coordinate to go to 137 137 */ 138 bool GenericNPC::walkTo(float x, float y, float z, float time)138 float GenericNPC::walkTo(float x, float y, float z, float qu, float qx, float qy, float qz) 139 139 { 140 140 -
trunk/src/world_entities/npcs/generic_npc.h
r8724 r8783 38 38 void playSound(int i); 39 39 40 bool walkTo(const Vector& coordinate, float time); 41 bool walkTo(float x, float y, float z, float time); 40 float walkTo(const Vector& coordinate, const Quaternion& dir); 41 float walkTo(float x, float y, float z, float qu, float qx, float qy, float qz); 42 float walkTo(float x, float y, float qu, float qx, float qy, float qz); 43 44 float runTo(const Vector& coordinate, const Quaternion& dir); 45 float runTo(float x, float y, float z, float qu, float qx, float qy, float qz); 46 float runTo(float x, float y, float qu, float qx, float qy, float qz); 47 48 float crouchTo(const Vector& coordinate, const Quaternion& dir); 49 float crouchTo(float x, float y, float z, float qu, float qx, float qy, float qz); 50 float crouchTo(float x, float y, float qu, float qx, float qy, float qz); 51 42 52 43 53 void destroy(); -
trunk/src/world_entities/script_trigger.cc
r8711 r8783 21 21 #include "state.h" 22 22 23 24 CREATE_SCRIPTABLE_CLASS(ScriptTrigger, CL_SCRIPT_TRIGGER, 25 addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 26 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) 27 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY)) 28 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ)) 29 ); 23 30 24 31 … … 40 47 scriptIsOk = false; 41 48 triggerLasts = false; 49 addToScript = false; 50 51 if(root != NULL) 52 { 53 42 54 loadParams(root); 43 55 56 if(addToScript) 57 { 58 script->addObject( "ScriptTrigger", this->getName()); 59 } 60 61 } 44 62 } 45 63 … … 60 78 void ScriptTrigger::loadParams(const TiXmlElement* root) 61 79 { 62 if(root != NULL) 63 { 80 64 81 WorldEntity ::loadParams(root); 65 82 … … 97 114 .describe("True if the script should only be called once") 98 115 .defaultValues(""); 99 } 100 116 LoadParam(root, "addtoscript", this, ScriptTrigger, setAddToScript) 117 .describe("True if this scripttrigger should be aviable in the script") 118 .defaultValues(""); 101 119 } 102 120 -
trunk/src/world_entities/script_trigger.h
r8711 r8783 14 14 #include "script_manager.h" 15 15 #include "script.h" 16 #include "script_class.h" 16 17 17 18 class ScriptTrigger : public WorldEntity … … 42 43 void setFunction(const std::string& function){ this->functionName = function;} 43 44 void setDebugDraw(const bool draw) { this->doDebugDraw = draw; } 45 void setAddToScript(const bool add) { this->addToScript = add; } 44 46 45 47 ///DRAWING … … 57 59 std::string functionName; 58 60 bool doDebugDraw; 59 61 bool addToScript; 60 62 //for internal use 61 63 bool scriptCalled; … … 66 68 }; 67 69 70 68 71 #endif -
trunk/src/world_entities/space_ships/helicopter.cc
r8495 r8783 36 36 CREATE_FACTORY(Helicopter, CL_HELICOPTER); 37 37 #include "script_class.h" 38 //CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER, NULL); 39 38 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER, 39 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp)) 40 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown)) 41 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor)) 42 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX)) 43 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY)) 44 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ)) 45 46 ); 40 47 41 48 /** -
trunk/src/world_entities/space_ships/helicopter.h
r8711 r8783 83 83 }; 84 84 85 CREATE_SCRIPTABLE_CLASS(Helicopter, CL_HELICOPTER,86 addMethod("moveUp", ExecutorLua1<Helicopter,bool>(&Helicopter::moveUp))87 ->addMethod("moveDown", ExecutorLua1<Helicopter,bool>(&Helicopter::moveDown))88 ->addMethod("setAbsCoor", ExecutorLua3<PNode,float,float,float>(&PNode::setAbsCoor))89 ->addMethod("getAbsCoorX", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorX))90 ->addMethod("getAbsCoorY", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorY))91 ->addMethod("getAbsCoorZ", ExecutorLua0ret<PNode, float>(&PNode::getAbsCoorZ))92 93 );94 95 96 85 #endif /* _HELICOPTERS_H */
Note: See TracChangeset
for help on using the changeset viewer.