Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/world_entities/test_entity.cc @ 6265

Last change on this file since 6265 was 6222, checked in by bensch, 19 years ago

orxonox/trunk: merged the christmas branche to the trunk
merged with command:
svn merge -r6165:HEAD christmas_branche/ ../trunk/
no conflicts

File size: 1.8 KB
RevLine 
[4245]1
2
[4679]3/*
[4245]4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific
14   main-programmer: Patrick Boenzli
[4679]15   co-programmer:
[4245]16*/
[5357]17#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_WORLD_ENTITY
[4245]18
19
[6222]20#include "executor/executor.h"
21#include "factory.h"
22#include "load_param.h"
23
[4245]24#include "test_entity.h"
25#include "stdincl.h"
26#include "model.h"
27#include "md2Model.h"
[4682]28#include "obb_tree.h"
[5087]29#include "state.h"
[4245]30
31using namespace std;
32
33
[6222]34CREATE_FACTORY(TestEntity, CL_TEST_ENTITY);
[4245]35
[6222]36
[4762]37TestEntity::TestEntity ()
[4679]38{
[6222]39  this->init();
40}
[4245]41
[4714]42
[5994]43
[6222]44TestEntity::TestEntity(const TiXmlElement* root)
45{
46  this->init();
47  if (root != NULL)
48    this->loadParams(root);
49
50  this->init();
[4245]51}
52
53
[4679]54TestEntity::~TestEntity ()
[6222]55{}
56
57
58
59void TestEntity::init()
[4462]60{
[6222]61  this->setClassID(CL_TEST_ENTITY, "TestEntity");
62  this->toList(OM_COMMON);
[4462]63}
[4245]64
[6222]65/**
66 * loads the Settings of a MD2Creature from an XML-element.
67 * @param root the XML-element to load the MD2Creature's properties from
68 */
69void TestEntity::loadParams(const TiXmlElement* root)
70{
71  static_cast<WorldEntity*>(this)->loadParams(root);
[4245]72
[6222]73  LoadParam(root, "md2animation", this, TestEntity, setAnim)
74      .describe("sets the animation of the md2 model")
75      .defaultValues(1, 1);
76
77}
78
79
[4488]80void  TestEntity::setAnim(int animationIndex)
81{
[6222]82  if( likely(this->getModel(0) != NULL))
83    ((MD2Model*)this->getModel(0))->setAnim(animationIndex);
[4488]84}
85
86
[4679]87void TestEntity::tick (float time)
[4245]88{
[6222]89  if( likely(this->getModel(0) != NULL))
90    ((MD2Model*)this->getModel(0))->tick(time);
91
[4245]92}
93
94
[5087]95void TestEntity::collidesWith(WorldEntity* entity, const Vector& location)
[6222]96{}
[5087]97
[4245]98
99
[5500]100void TestEntity::draw () const
[4245]101{
[6222]102  this->drawLODsafe();
[4245]103}
104
Note: See TracBrowser for help on using the repository browser.