Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/mount_points/src/world_entities/mount_point.cc @ 10216

Last change on this file since 10216 was 10216, checked in by patrick, 17 years ago

nicer mounting point implementation, some more skeletton

File size: 2.2 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: Patrick Boenzli patrick@orxonox.net
13   co-programmer:
14*/
15#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
16
17
18#include "executor/executor.h"
19#include "util/loading/factory.h"
20#include "util/loading/load_param.h"
21
22
23#include "mount_point.h"
24#include "debug.h"
25#include "state.h"
26
27
28ObjectListDefinition(MountPoint);
29CREATE_FACTORY(MountPoint);
30
31
32/**
33 * construct
34 */
35MountPoint::MountPoint (const Vector& up, const Vector& forward, const Vector& center, const std::string& name)
36{
37  PRINTF(0)("Created mount point %s\n", name.c_str());
38
39  this->_name = name;
40  this->setAbsCoor( center);
41  this->setAbsDir( Quaternion(forward, up));
42
43  this->init();
44}
45
46
47/**
48 * constructor
49 * @param root the xml root element
50 */
51MountPoint::MountPoint(const TiXmlElement* root)
52{
53  this->init();
54
55  if( root != NULL)
56    this->loadParams(root);
57}
58
59
60/**
61 * deconstructor
62 */
63MountPoint::~MountPoint ()
64{}
65
66
67/**
68 * initializing function
69 */
70void MountPoint::init()
71{
72  this->registerObject(this, MountPoint::_objectList);
73  this->toList(OM_GROUP_00);
74
75  this->_mount = NULL;
76}
77
78
79/**
80 * loads the Settings of a MD2Creature from an XML-element.
81 * @param root the XML-element to load the MD2Creature's properties from
82 */
83void MountPoint::loadParams(const TiXmlElement* root)
84{
85  WorldEntity::loadParams(root);
86}
87
88
89
90/**
91 * tick
92 * @param time  time passed since the last tick
93 */
94void MountPoint::tick (float time)
95{
96
97
98}
99
100
101/**
102 * draw this entity
103 */
104void MountPoint::draw() const
105{
106
107}
108
109
110
111/**
112 *  function called to draw the mount point itself for debug purposes only
113 */
114void MountPoint::debugDraw() const
115{
116  // invoke the underlying pnode debug draw
117  this->debugDraw();
118}
119
120
121/**
122 * adds an entity to this mount point
123 * @param entity entity to be added
124 */
125void MountPoint::mount(WorldEntity* entity)
126{
127  this->_mount = entity;
128}
129
130
131/**
132 * removes an entity from this mount point
133 */
134void MountPoint::unmount()
135{
136  this->_mount = NULL;
137}
138
Note: See TracBrowser for help on using the repository browser.