Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8439 in orxonox.OLD for branches/bsp_model/src


Ignore:
Timestamp:
Jun 15, 2006, 1:50:54 AM (18 years ago)
Author:
patrick
Message:

bsp: md3 model data read in as it seams correctly. no drawing yet! interactive model introduced

Location:
branches/bsp_model/src
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/bsp_model/src/defs/class_id.h

    r8338 r8439  
    291291  CL_STATIC_MODEL               =    0x00902000,
    292292  CL_VERTEX_ARRAY_MODEL         =    0x00904000,
     293  CL_INTERACTIVE_MODEL          =    0x00908000,        ///FIXME: is this ok bensch?
    293294
    294295  // Models
  • branches/bsp_model/src/lib/graphics/importer/Makefile.am

    r8351 r8439  
    55
    66libORXimporter_a_SOURCES = model.cc \
     7                           interactive_model.cc \
    78                           md_model_structure.cc \
    89                           vertex_array_model.cc \
     
    3940noinst_HEADERS = \
    4041                model.h \
     42                interactive_model.h \
    4143                md_model_structure.cc \
    4244                tc.h \
  • branches/bsp_model/src/lib/graphics/importer/md2/md2Model.cc

    r8346 r8439  
    9090  this->animationState.type = STAND;
    9191  this->animationState.numPlays = 1;
    92   this->setAnim(STAND);
     92  this->setAnimation(STAND);
    9393
    9494  this->debug();
     
    164164  the animation types can be looked up in the animationType table
    165165*/
    166 void MD2Model::setAnim(int type, int animPlayback)
     166void MD2Model::setAnimation(int type, int animPlayback)
    167167{
    168168  if( (type < 0) || (type > MAX_ANIMATIONS) )
  • branches/bsp_model/src/lib/graphics/importer/md2/md2Model.h

    r8346 r8439  
    2121#include "base_object.h"
    2222
    23 #include "model.h"
     23#include "interactive_model.h"
    2424#include "material.h"
    2525
     
    147147
    148148//! This is a MD2 Model class
    149 class MD2Model : public Model {
     149class MD2Model : public InteractiveModel {
    150150
    151151public:
     
    157157
    158158
    159   void setAnim(int type, int animPlayback = MD2_ANIM_LOOP);
     159  virtual void setAnimation(int type, int animPlayback = MD2_ANIM_LOOP);
    160160  /**  returns the current animation @returns animation type */
    161161  inline int MD2Model::getAnim() { return this->animationState.type; }
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_data.cc

    r8436 r8439  
    381381    this->meshes[mesh]->normals[i].vertexNormal[0] = vc->vertexNormal[0];
    382382    this->meshes[mesh]->normals[i].vertexNormal[1] = vc->vertexNormal[1];
     383
     384    delete vc;
    383385  }
    384386
  • branches/bsp_model/src/lib/graphics/importer/md3/md3_model.h

    r8357 r8439  
    1010
    1111#include <string>
    12 #include "model.h"
     12#include "interactive_model.h"
    1313
    1414
     
    1919class MD3Data;
    2020
    21 class MD3Model : public Model
     21class MD3Model : public InteractiveModel
    2222{
    2323
     
    2626    ~MD3Model();
    2727
     28    virtual void tick(float dt) {}
     29    virtual void setAnimation(int animNum, int playbackMode = 0) {}
    2830
    2931  private:
  • branches/bsp_model/src/world_entities/creatures/md2_creature.cc

    r8346 r8439  
    256256  if( this->bJump && likely(this->getModel(0) != NULL))
    257257  {
    258     ((MD2Model*)this->getModel(0))->setAnim(JUMP);
     258    ((MD2Model*)this->getModel(0))->setAnimation(JUMP);
    259259  }
    260260  else if( this->bFire && likely(this->getModel(0) != NULL))
    261261  {
    262     if( ((MD2Model*)this->getModel(0))->getAnim() != ATTACK) ((MD2Model*)this->getModel(0))->setAnim(ATTACK);
     262    if( ((MD2Model*)this->getModel(0))->getAnim() != ATTACK) ((MD2Model*)this->getModel(0))->setAnimation(ATTACK);
    263263  }
    264264  else if( fabs(move.len()) > 0.0f && likely(this->getModel(0) != NULL))
    265265  {
    266     if( ((MD2Model*)this->getModel(0))->getAnim() != RUN) ((MD2Model*)this->getModel(0))->setAnim(RUN);
     266    if( ((MD2Model*)this->getModel(0))->getAnim() != RUN) ((MD2Model*)this->getModel(0))->setAnimation(RUN);
    267267  }
    268268  else if (likely(this->getModel(0) != NULL))
    269269  {
    270     if( ((MD2Model*)this->getModel(0))->getAnim() != STAND) ((MD2Model*)this->getModel(0))->setAnim(STAND);
     270    if( ((MD2Model*)this->getModel(0))->getAnim() != STAND) ((MD2Model*)this->getModel(0))->setAnimation(STAND);
    271271  }
    272272
  • branches/bsp_model/src/world_entities/test_entity.cc

    r8346 r8439  
    2626
    2727#include "test_entity.h"
    28 #include "stdincl.h"
    29 #include "model.h"
     28
     29
     30#include "interactive_model.h"
    3031#include "md2/md2Model.h"
    31 #include "obb_tree.h"
     32
    3233#include "state.h"
    3334
     
    9091{
    9192  if( likely(this->getModel(0) != NULL))
    92     ((MD2Model*)this->getModel(0))->setAnim(animationIndex, animPlaybackMode);
     93    ((InteractiveModel*)this->getModel(0))->setAnimation(animationIndex, animPlaybackMode);
    9394}
    9495
     
    9798{
    9899  if( likely(this->getModel(0) != NULL))
    99     ((MD2Model*)this->getModel(0))->tick(time);
     100    ((InteractiveModel*)this->getModel(0))->tick(time);
    100101
    101102}
     
    122123
    123124  this->bDeath = true;
    124   float anim;
    125125  int randi = (int)(5.0f * (float)rand()/(float)RAND_MAX);
    126126
Note: See TracChangeset for help on using the changeset viewer.