Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 29, 2007, 6:08:23 PM (17 years ago)
Author:
snellen
Message:

added tick trigger which always calles the script

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/scriptimprovements/src/world_entities/script_triggers/tick_trigger.cc

    r10607 r10609  
     1/*
     2   orxonox - the future of 3D-vertical-scrollers
     3
     4   Copyright (C) 2004 orx
     5
     6   This program is free software; you can redistribute it and/or modify
     7   it under the terms of the GNU General Public License as published by
     8   the Free Software Foundation; either version 2, or (at your option)
     9   any later version.
     10
     11### File Specific:
     12   main-programmer: Silvan Nellen
     13   co-programmer: ...
     14*/
     15
     16
     17#include "tick_trigger.h"
     18#include "debug.h"
     19
     20ObjectListDefinition(TickTrigger);
     21
     22// CREATE_SCRIPTABLE_CLASS(TickTrigger,
     23//             // Coordinates
     24//                         addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
     25//                             ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
     26//                             ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
     27//                             ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
     28//             //Properties
     29//                             ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName))
     30//                             ->addMethod("setTarget", Executor1<TickTrigger, lua_State*, const std::string&>(&TickTrigger::setTarget))
     31//                             ->addMethod("setTriggerParent", Executor1<TickTrigger, lua_State*, const std::string&>(&TickTrigger::setTriggerParent))
     32//                             ->addMethod("setTriggerRemains", Executor1<TickTrigger, lua_State*, bool>(&TickTrigger::setTriggerRemains))
     33//                             ->addMethod("setActiveOnCreation", Executor1<TickTrigger, lua_State*, bool>(&TickTrigger::setActiveOnCreation))
     34//                             ->addMethod("setInvert", Executor1<TickTrigger, lua_State*, bool>(&TickTrigger::setInvert))
     35//                             ->addMethod("setRadius", Executor1<TickTrigger, lua_State*, float>(&TickTrigger::setRadius))
     36//                             ->addMethod("setScript", Executor1<TickTrigger, lua_State*, const std::string&>(&TickTrigger::setScript))
     37//                             ->addMethod("setFunction", Executor1<TickTrigger, lua_State*, const std::string&>(&TickTrigger::setFunction))
     38//                             ->addMethod("setDebugDraw", Executor1<TickTrigger, lua_State*, bool>(&TickTrigger::setDebugDraw))
     39//                             ->addMethod("setAddToScript", Executor1<TickTrigger, lua_State*, bool>(&TickTrigger::setAddToScript))
     40//                        );
     41
     42
     43/**
     44 * Constructs a new TickTrigger.
     45 * @param root the xml element to load the parameters from.
     46 *
     47 */
     48TickTrigger::TickTrigger(const TiXmlElement* root)
     49{
     50  this->registerObject(this, TickTrigger::_objectList);
     51  this->toList(OM_COMMON);
     52
     53}
     54
     55/**
     56 * Deletes the TickTrigger.
     57 *
     58 */
     59TickTrigger::~TickTrigger()
     60{
     61
     62}
     63
     64
     65void TickTrigger::tick(float timestep)
     66{
     67  if( scriptFinished ) return;
     68
     69  this->executeAction(timestep);
     70     
     71}
Note: See TracChangeset for help on using the changeset viewer.