Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

space trigger and tick trigger are now scriptable

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);
21
22CREATE_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("setScript", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setScript))
31                            ->addMethod("setFunction", Executor1<ScriptTrigger, lua_State*, const std::string&>(&ScriptTrigger::setFunction))
32                            ->addMethod("setDebugDraw", Executor1<ScriptTrigger, lua_State*, bool>(&ScriptTrigger::setDebugDraw))
33             );
34
35
36/**
37 * Constructs a new TickTrigger.
38 * @param root the xml element to load the parameters from.
39 *
40 */
41TickTrigger::TickTrigger(const TiXmlElement* root)
42{
43  this->registerObject(this, TickTrigger::_objectList);
44  this->toList(OM_COMMON);
45
46}
47
48/**
49 * Deletes the TickTrigger.
50 *
51 */
52TickTrigger::~TickTrigger()
53{
54
55}
56
57
58void TickTrigger::tick(float timestep)
59{
60  if( scriptFinished ) return;
61
62  this->executeAction(timestep);
63     
64}
Note: See TracBrowser for help on using the repository browser.