Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8200


Ignore:
Timestamp:
Apr 7, 2011, 12:55:24 PM (13 years ago)
Author:
FelixSchulthess
Message:

blah

Location:
code/branches/portals
Files:
9 edited
2 moved

Legend:

Unmodified
Added
Removed
  • code/branches/portals/data/levels/portals.oxw

    r8177 r8200  
    2727
    2828
    29    <PortalEndPoint position="0,0,0" material="Examples/Flare" id="1"/>
    30    <PortalEndPoint position="-100,0,0" material="Examples/Flare" id="2"/>
    31    <PortalLink fromID="1" toID="2" />
     29        <PortalEndPoint position="0,0,0" id="1">
     30                <attached>
     31                        <Billboard material="Examples/Flare" />
     32                </attached>
     33        </PortalEndPoint>
     34        <PortalEndPoint position="-100,0,0" id="2">
     35                <attached>
     36                        <Billboard material="Examples/Flare2" />
     37                </attached>
     38        </PortalEndPoint>
     39        <PortalLink fromID="1" toID="2" />
    3240
    3341    <Light type=directional position="0,0,0" direction="0.253, 0.593, -0.765" diffuse="1.0, 0.9, 0.9, 1.0" specular="1.0, 0.9, 0.9, 1.0" />
  • code/branches/portals/src/modules/CMakeLists.txt

    r7401 r8200  
    3232ADD_SUBDIRECTORY(pickup)
    3333ADD_SUBDIRECTORY(pong)
     34ADD_SUBDIRECTORY(portals)
    3435ADD_SUBDIRECTORY(questsystem)
    3536ADD_SUBDIRECTORY(weapons)
  • code/branches/portals/src/modules/objects/triggers/MultiTrigger.cc

    r7601 r8200  
    116116        }
    117117
    118         // Check if the object is active (this is NOT MultiTrigger::isActive()!)
     118        // Check if the object is active (this is NOT MultiTrigger::isActive()!), it is whether the MultiTrigger actually does anything, ever.
    119119        if (!this->BaseObject::isActive())
    120120            return;
     
    205205                            {
    206206                                // If the MultiTrigger has not exceeded its remaining activations.
    207                                 if(this->remainingActivations_ > 0)
     207                                if(this->hasRemainingActivations())
    208208                                {
    209209                                    this->active_.insert(state->originator);
     
    218218                            {
    219219                                // If the MultiTrigger doesn't stay active or hasn't' exceeded its remaining activations.
    220                                 if(!this->getStayActive() || this->remainingActivations_ > 0)
     220                                if(!this->getStayActive() || this->hasRemainingActivations())
    221221                                    this->active_.erase(state->originator);
    222222                                else
  • code/branches/portals/src/modules/objects/triggers/TriggerBase.h

    r7652 r8200  
    186186                { if(activations >= 0 || activations == INF_s) this->remainingActivations_ = activations; }
    187187
     188                        inline bool hasRemainingActivations(void)
     189                                { return this->remainingActivations_ == INF_s || this->remainingActivations_  > 0; }
     190
    188191            /**
    189192            @brief Adds the parent of a MultiTrigger.
  • code/branches/portals/src/modules/portals/CMakeLists.txt

    r8199 r8200  
    99  TOLUA_FILES
    1010  PCH_FILE
    11     PickupPrecompiledHeaders.h
     11    PortalsPrecompiledHeaders.h
    1212  LINK_LIBRARIES
    1313    orxonox
  • code/branches/portals/src/modules/portals/PortalEndPoint.cc

    r8199 r8200  
    88    std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
    99
    10     PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), material_(""), billboard_(0)
     10    PortalEndPoint::PortalEndPoint(BaseObject* creator) : DistanceMultiTrigger(creator), id_(0)
    1111    {
    1212        RegisterObject(PortalEndPoint);
     
    2222        SUPER(PortalEndPoint, XMLPort, xmlelement, mode);
    2323        XMLPortParam(PortalEndPoint, "id", setID, getID, xmlelement, mode);
    24         XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "material", setMaterial, getMaterial, xmlelement, mode);
    25         XMLPortParamExtern(PortalEndPoint, Billboard, this->billboard_, "colour", setColour, getColour, xmlelement, mode).defaultValues(ColourValue::White);
    2624       
    2725        if(mode == XMLPort::LoadObject)
     
    3331    void PortalEndPoint::tick(float dt)
    3432    {
    35         SUPER(PortalEndPoint, tick);
     33        SUPER(PortalEndPoint, tick, dt);
    3634    }
    3735
  • code/branches/portals/src/modules/portals/PortalEndPoint.h

    r8199 r8200  
    11#ifndef _PortalEndPoint_H__
    22#define _PortalEndPoint_H__
     3
     4#include "portals/PortalsPrereqs.h"
    35
    46#include <set>
     
    68#include <map>
    79
    8 #include "StaticEntity.h"
     10#include "worldentities/StaticEntity.h"
    911#include "graphics/Billboard.h"
    10 #include "modules/objects/triggers/DistanceMultiTrigger.h"
     12#include "objects/triggers/DistanceMultiTrigger.h"
    1113
    1214namespace orxonox
    1315{
    14     class _OrxonoxExport PortalEndPoint : public DistanceMultiTrigger
     16    class _PortalsExport PortalEndPoint : public DistanceMultiTrigger
    1517    {
    1618        public:
     
    3638            unsigned int id_;
    3739            std::set<WorldEntity *> recentlyJumpedOut_; //!< Entities which recently jumped out of this EndPoint, hence they shouldn't be pulled in again if the endpoint is the beginning of a link
    38             Billboard billboard_;
    3940    };
    4041
  • code/branches/portals/src/modules/portals/PortalLink.cc

    r8199 r8200  
    77    CreateFactory(PortalLink);
    88   
    9     PortalLink::PortalLink(BaseObject* creator) : BaseObject(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20)
     9    PortalLink::PortalLink(BaseObject* creator) : EventListener(creator), fromID_(0), toID_(0), from_(0), to_(0), activationRadius_(20)
    1010    {
    1111        RegisterObject(PortalLink);
     
    3232    void PortalLink::tick(float dt)
    3333    {
    34         SUPER(PortalLink, tick)
     34        SUPER(PortalLink, tick, dt);
    3535    }
    3636   
    3737    void PortalLink::processEvent(Event& event)
    3838    {
    39         SUPER(PortalLink, processEvent);
     39        EventListener::processEvent(event);
    4040        if(!event.activate_)
    4141        {
     
    5353            return;
    5454        }
    55         to_->jumpOut(entity);
     55        to_->jumpOut(eventEntity);
    5656    }
    5757
  • code/branches/portals/src/modules/portals/PortalLink.h

    r8199 r8200  
    22#define _PortalLink_H__
    33
    4 #include "OrxonoxPrereqs.h"
     4#include "portals/PortalsPrereqs.h"
    55#include "tools/interfaces/Tickable.h"
    66#include "core/BaseObject.h"
     
    1212namespace orxonox
    1313{
    14     class _OrxonoxExport PortalLink : public EventListener
     14    class _PortalsExport PortalLink : public EventListener
    1515    {
    1616        public:
Note: See TracChangeset for help on using the changeset viewer.