Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/scriptimprovements/src/world_entities/script_triggers/tick_trigger.cc @ 10611

Last change on this file since 10611 was 10611, checked in by snellen, 17 years ago

Triggers can now be creater from the xml file… again

File size: 1.8 KB
Line 
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);
21CREATE_FACTORY(TickTrigger);
22
23CREATE_SCRIPTABLE_CLASS(TickTrigger,
24             // Coordinates
25                        addMethod("setAbsCoor", Executor3<PNode, lua_State*,float,float,float>(&PNode::setAbsCoor))
26                            ->addMethod("getAbsCoorX", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorX))
27                            ->addMethod("getAbsCoorY", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorY))
28                            ->addMethod("getAbsCoorZ", Executor0ret<PNode, lua_State*, float>(&PNode::getAbsCoorZ))
29             //Properties
30                            ->addMethod("setName", Executor1<BaseObject, lua_State*, const std::string&>(&BaseObject::setName))
31                            ->addMethod("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript))
32                            ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction))
33                            ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw))
34             );
35
36
37/**
38 * Constructs a new TickTrigger.
39 * @param root the xml element to load the parameters from.
40 *
41 */
42TickTrigger::TickTrigger(const TiXmlElement* root)
43{
44  this->registerObject(this, TickTrigger::_objectList);
45  this->toList(OM_COMMON);
46
47}
48
49/**
50 * Deletes the TickTrigger.
51 *
52 */
53TickTrigger::~TickTrigger()
54{
55
56}
57
58
59void TickTrigger::tick(float timestep)
60{
61  if( scriptFinished ) return;
62
63  this->executeAction(timestep);
64     
65}
Note: See TracBrowser for help on using the repository browser.