Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4298 in orxonox.OLD


Ignore:
Timestamp:
May 26, 2005, 2:03:33 PM (19 years ago)
Author:
bensch
Message:

orxonox/branches/physics: lights are pNodes not world-entities

Location:
orxonox/branches/physics/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/physics/src/lib/graphics/light.h

    r3603 r4298  
    1111#define _LIGHT_H
    1212
    13 #include "world_entity.h"
     13#include "p_node.h"
    1414#include "glincl.h"
    1515
     
    2121
    2222//! A class that handles Lights. The LightManager operates on this.
    23 class Light : public WorldEntity
     23class Light : public PNode
    2424{
    2525 public:
  • orxonox/branches/physics/src/subprojects/particles/Makefile.am

    r4297 r4298  
    4040                  $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc \
    4141                  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
     42                  $(MAINSRCDIR)/lib/graphics/light.cc \
    4243                  $(MAINSRCDIR)/util/state.cc \
    4344                  $(MAINSRCDIR)/world_entities/camera.cc \
  • orxonox/branches/physics/src/subprojects/particles/Makefile.in

    r4297 r4298  
    5555am_particles_OBJECTS = framework.$(OBJEXT) particle_engine.$(OBJEXT) \
    5656        particle_system.$(OBJEXT) particle_emitter.$(OBJEXT) \
    57         state.$(OBJEXT) camera.$(OBJEXT) model.$(OBJEXT) \
    58         objModel.$(OBJEXT) primitive_model.$(OBJEXT) array.$(OBJEXT) \
    59         material.$(OBJEXT) texture.$(OBJEXT) graphics_engine.$(OBJEXT) \
    60         base_object.$(OBJEXT) vector.$(OBJEXT) \
    61         resource_manager.$(OBJEXT) text_engine.$(OBJEXT) \
    62         p_node.$(OBJEXT) null_parent.$(OBJEXT)
     57        light.$(OBJEXT) state.$(OBJEXT) camera.$(OBJEXT) \
     58        model.$(OBJEXT) objModel.$(OBJEXT) primitive_model.$(OBJEXT) \
     59        array.$(OBJEXT) material.$(OBJEXT) texture.$(OBJEXT) \
     60        graphics_engine.$(OBJEXT) base_object.$(OBJEXT) \
     61        vector.$(OBJEXT) resource_manager.$(OBJEXT) \
     62        text_engine.$(OBJEXT) p_node.$(OBJEXT) null_parent.$(OBJEXT)
    6363particles_OBJECTS = $(am_particles_OBJECTS)
    6464particles_DEPENDENCIES = $(MAINSRCDIR)/lib/physics/libORXphysics.a
     
    7070@AMDEP_TRUE@    ./$(DEPDIR)/framework.Po \
    7171@AMDEP_TRUE@    ./$(DEPDIR)/graphics_engine.Po \
    72 @AMDEP_TRUE@    ./$(DEPDIR)/material.Po ./$(DEPDIR)/model.Po \
    73 @AMDEP_TRUE@    ./$(DEPDIR)/null_parent.Po ./$(DEPDIR)/objModel.Po \
    74 @AMDEP_TRUE@    ./$(DEPDIR)/p_node.Po \
     72@AMDEP_TRUE@    ./$(DEPDIR)/light.Po ./$(DEPDIR)/material.Po \
     73@AMDEP_TRUE@    ./$(DEPDIR)/model.Po ./$(DEPDIR)/null_parent.Po \
     74@AMDEP_TRUE@    ./$(DEPDIR)/objModel.Po ./$(DEPDIR)/p_node.Po \
    7575@AMDEP_TRUE@    ./$(DEPDIR)/particle_emitter.Po \
    7676@AMDEP_TRUE@    ./$(DEPDIR)/particle_engine.Po \
     
    207207                  $(MAINSRCDIR)/lib/graphics/particles/particle_system.cc \
    208208                  $(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc \
     209                  $(MAINSRCDIR)/lib/graphics/light.cc \
    209210                  $(MAINSRCDIR)/util/state.cc \
    210211                  $(MAINSRCDIR)/world_entities/camera.cc \
     
    295296@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/framework.Po@am__quote@
    296297@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/graphics_engine.Po@am__quote@
     298@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/light.Po@am__quote@
    297299@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/material.Po@am__quote@
    298300@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/model.Po@am__quote@
     
    373375@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
    374376@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o particle_emitter.obj `if test -f '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/particles/particle_emitter.cc'; fi`
     377
     378light.o: $(MAINSRCDIR)/lib/graphics/light.cc
     379@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT light.o -MD -MP -MF "$(DEPDIR)/light.Tpo" -c -o light.o `test -f '$(MAINSRCDIR)/lib/graphics/light.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/light.cc; \
     380@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/light.Tpo" "$(DEPDIR)/light.Po"; else rm -f "$(DEPDIR)/light.Tpo"; exit 1; fi
     381@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/light.cc' object='light.o' libtool=no @AMDEPBACKSLASH@
     382@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/light.Po' tmpdepfile='$(DEPDIR)/light.TPo' @AMDEPBACKSLASH@
     383@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     384@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.o `test -f '$(MAINSRCDIR)/lib/graphics/light.cc' || echo '$(srcdir)/'`$(MAINSRCDIR)/lib/graphics/light.cc
     385
     386light.obj: $(MAINSRCDIR)/lib/graphics/light.cc
     387@am__fastdepCXX_TRUE@   if $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT light.obj -MD -MP -MF "$(DEPDIR)/light.Tpo" -c -o light.obj `if test -f '$(MAINSRCDIR)/lib/graphics/light.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/light.cc'; fi`; \
     388@am__fastdepCXX_TRUE@   then mv -f "$(DEPDIR)/light.Tpo" "$(DEPDIR)/light.Po"; else rm -f "$(DEPDIR)/light.Tpo"; exit 1; fi
     389@AMDEP_TRUE@@am__fastdepCXX_FALSE@      source='$(MAINSRCDIR)/lib/graphics/light.cc' object='light.obj' libtool=no @AMDEPBACKSLASH@
     390@AMDEP_TRUE@@am__fastdepCXX_FALSE@      depfile='$(DEPDIR)/light.Po' tmpdepfile='$(DEPDIR)/light.TPo' @AMDEPBACKSLASH@
     391@AMDEP_TRUE@@am__fastdepCXX_FALSE@      $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
     392@am__fastdepCXX_FALSE@  $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o light.obj `if test -f '$(MAINSRCDIR)/lib/graphics/light.cc'; then $(CYGPATH_W) '$(MAINSRCDIR)/lib/graphics/light.cc'; else $(CYGPATH_W) '$(srcdir)/$(MAINSRCDIR)/lib/graphics/light.cc'; fi`
    375393
    376394state.o: $(MAINSRCDIR)/util/state.cc
  • orxonox/branches/physics/src/subprojects/particles/framework.cc

    r4297 r4298  
    4848bool Framework::draw(float dt)
    4949{
    50  
    51 
    5250  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
    5351  glLoadIdentity(); // Reset the view
     
    9492        if (mouse1Down)
    9593          {
    96             int mX = event.button.x;
    97             int mY = event.button.y;
    98             int wH = GraphicsEngine::getInstance()->getResolutionY();
    99             int wW = GraphicsEngine::getInstance()->getResolutionX();
    100             Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
    101             //      PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
    102             p2 = tmpV-M;
    103             p2.y = -p2.y;
    104             rotAxis = p1.cross(p2);
    105             //  PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z);
    106 
    107             // in case that there is no rotation-axis defined
    108             if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0)
     94            /*
     95              int mX = event.button.x;
     96              int mY = event.button.y;
     97              int wH = GraphicsEngine::getInstance()->getResolutionY();
     98              int wW = GraphicsEngine::getInstance()->getResolutionX();
     99              Vector tmpV (mX, mY, sqrt ( (float) abs(wH * wH/4 - (wW/2-mX) * (wW/2-mX) - (wH/2-mY) * (wH/2-mY)) ));
     100              //            PRINTF(0)("tmpV: %f, %f, %f\n", tmpV.x, tmpV.y, tmpV.z);
     101              p2 = tmpV-M;
     102              p2.y = -p2.y;
     103              rotAxis = p1.cross(p2);
     104              //  PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z);
     105             
     106              // in case that there is no rotation-axis defined
     107              if (rotAxis.x != 0 || rotAxis.y != 0 || rotAxis.z != 0)
    109108              {
    110                 rotAxis.normalize();
    111                 //              PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle);
    112                                
    113                 rotAngle = angleRad (p1, p2);
    114                 rotQ = Quaternion (rotAngle, rotAxis);
    115                 rotQ = rotQ * rotQlast;
    116                 rotQ.matrix (matQ);
    117                 //      dir = rotQ.apply(dir);
    118                 //      dir.normalize();
    119                 //      PRINTF(0)("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle);
     109              rotAxis.normalize();
     110              //                PRINTF(0)("rotAxis: %f, %f, %f\n", rotAxis.x, rotAxis.y, rotAxis.z, rotAngle);
     111             
     112              rotAngle = angleRad (p1, p2);
     113              rotQ = Quaternion (rotAngle, rotAxis);
     114              rotQ = rotQ * rotQlast;
     115              rotQ.matrix (matQ);
     116              //        dir = rotQ.apply(dir);
     117              //      dir.normalize();
     118              //        PRINTF(0)("rotAxis: %f, %f, %f, %f\n", dir.x, dir.y, dir.z, rotAngle);
    120119              }
    121             rotQlast = rotQ;
    122             p1 = p2;
     120              rotQlast = rotQ;
     121              p1 = p2;
     122            */
    123123
    124124          }
     
    172172          {
    173173          case SDLK_x:
    174 
     174           
    175175            break;
    176176          case SDLK_c:
  • orxonox/branches/physics/src/world_entities/camera.h

    r3953 r4298  
    1919   This class controls the viewpoint from which the World is rendered.
    2020*/
    21 class Camera : public PNode 
     21class Camera : public PNode
    2222{
    2323 private:
Note: See TracChangeset for help on using the changeset viewer.