[Orxonox-commit 3954] r8628 - in code/branches/presentation: data/levels src/modules/portals
dafrick at orxonox.net
dafrick at orxonox.net
Fri May 27 22:54:35 CEST 2011
Author: dafrick
Date: 2011-05-27 22:54:34 +0200 (Fri, 27 May 2011)
New Revision: 8628
Modified:
code/branches/presentation/data/levels/presentationFS11.oxw
code/branches/presentation/src/modules/portals/PortalEndPoint.cc
code/branches/presentation/src/modules/portals/PortalEndPoint.h
Log:
Some changes in prsentation level. Making PortalEndPoints radar viewable.
Modified: code/branches/presentation/data/levels/presentationFS11.oxw
===================================================================
--- code/branches/presentation/data/levels/presentationFS11.oxw 2011-05-27 19:54:03 UTC (rev 8627)
+++ code/branches/presentation/data/levels/presentationFS11.oxw 2011-05-27 20:54:34 UTC (rev 8628)
@@ -53,7 +53,6 @@
<!-- BOUNDARIES AND PORTALS -->
-
<Template name=PortalDefault>
<PortalEndPoint>
@@ -63,68 +62,22 @@
</PortalEndPoint>
</Template>
- <PortalEndPoint position="350,0,0" id="1" distance="40" target="MobileEntity" design="PortalDefault"/>
- <PortalEndPoint position="-30300,0,0" id="2" distance="40" target="MobileEntity" design="PortalDefault"/>
+ <SpaceBoundaries warnDistance="1" maxDistance="400" showDistance="300" healthDecrease="0.1" position="-90000,0,0"/>
+ <PortalEndPoint position="-350,0,0" id="3" distance="40" target="MobileEntity" design="PortalDefault"/>
+ <PortalEndPoint position="-72000,0,0" id="4" distance="40" target="MobileEntity" design="PortalDefault"/>
+ <SpaceBoundaries warnDistance="1" maxDistance="400" showDistance="300" healthDecrease="0.1" position="0,10000,0"/>
<SpaceBoundaries warnDistance="1" maxDistance="450" showDistance="300" healthDecrease="0.1" position="0,0,0"/>
<SpaceBoundaries warnDistance="1" maxDistance="400" showDistance="300" healthDecrease="0.1" position="-30000,0,0"/>
- <PortalLink fromID="1" toID="2" />
- <PortalLink fromID="2" toID="1" />
+ <PortalLink fromID="3" toID="4" />
+ <PortalLink fromID="4" toID="3" />
<!-- MODELS, DEBRIS, ETC -->
- <!-- hydrogen farmer -->
- <SpaceShip position="0,1750,0" roll=90 mass=10000 >
- <attached>
- <!-- Docking -->
- <DistanceTriggerBeacon name="bcnDestroyer" />
- <DockingTarget name="destroyer" />
-
- <Dock orientation="0.5, 0.5, 0.5, 0.5" position="-1500,0,0" >
- <animations>
- <MoveToDockingTarget target="destroyer" position="-1300,0,0" />
- </animations>
- <effects>
- <DockToShip target="spaceShip" />
- </effects>
- <events>
- <execute>
- <EventListener event="dockMe" />
- </execute>
- </events>
- <attached>
- <DistanceTrigger position="0,0,-200" distance="30" target="Pawn"
- beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
- />
- <Billboard position="0,0,-200" material="Examples/Flare" colour="1.0, 0, 0" />
- </attached>
- </Dock>
-
- <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=100 />
- <!-- <Model mesh="cube.mesh" mass=10 position="-1120,0,0" scale3D="230,200,490" /> -->
- <!-- <Model mesh="cube.mesh" mass=10 position="580,0,-960" scale3D="230,200,490" yaw=-120 /> -->
- <!-- <Model mesh="cube.mesh" mass=10 position="580,0,960" scale3D="230,200,490" yaw=-240 /> -->
- <!-- <Model mesh="cube.mesh" mass=10 position="0,0,0" scale3D="600,200,100" /> -->
- </attached>
- <collisionShapes>
- <BoxCollisionShape position="-1120,0,0" halfExtents="230,200,490" />
- <BoxCollisionShape position="580,0,-960" halfExtents="230,200,490" yaw=-120 />
- <BoxCollisionShape position="580,0,960" halfExtents="230,200,490" yaw=-240 />
- </collisionShapes>
- </SpaceShip>
-
- <SpaceShip template="spaceshipassff2" position="0,3500,0" >
- <attached>
- <DockingTarget name="spaceShip" />
- </attached>
-
- </SpaceShip>
-
-
<!-- This is a model of Earth: mass=EarthMass/1000 and radius=EarthRadius[km]*10 -->
<Planet
- position="70500,0,0"
+ position="80500,0,0"
scale="63000"
collisionType="dynamic"
linearDamping="0.8"
@@ -149,9 +102,11 @@
</collisionShapes>
</Planet>
+ <!-- MOON AREA -->
+
<!-- This is a model of our Moon: mass=MoonMass/1000 and radius=MoonRadius[km]*10 and position=DistanceFromEarth[km]*10 -->
<Planet
- position="-15000,0,0"
+ position="-80000,0,0"
scale="4000"
collisionType="dynamic"
linearDamping="0.8"
@@ -175,7 +130,53 @@
</collisionShapes>
</Planet>
+ <!-- Hydrogen farmer -->
+ <SpaceShip position="-74000,2500,0" roll=90 yaw=180 pitch=20 mass=10000 >
+ <attached>
+ <!-- Docking -->
+ <DistanceTriggerBeacon name="bcnDestroyer" />
+ <DockingTarget name="destroyer" />
+ <Model mesh="HydroHarvester.mesh" mass=10 position="0,0,0" scale=100 />
+ <!-- <Model mesh="cube.mesh" mass=10 position="-1120,0,0" scale3D="230,200,490" /> -->
+ <!-- <Model mesh="cube.mesh" mass=10 position="580,0,-960" scale3D="230,200,490" yaw=-120 /> -->
+ <!-- <Model mesh="cube.mesh" mass=10 position="580,0,960" scale3D="230,200,490" yaw=-240 /> -->
+ <!-- <Model mesh="cube.mesh" mass=10 position="0,0,0" scale3D="600,200,100" /> -->
+ </attached>
+ <collisionShapes>
+ <BoxCollisionShape position="-1120,0,0" halfExtents="230,200,490" />
+ <BoxCollisionShape position="580,0,-960" halfExtents="230,200,490" yaw=-120 />
+ <BoxCollisionShape position="580,0,960" halfExtents="230,200,490" yaw=-240 />
+ </collisionShapes>
+ </SpaceShip>
+
+ <Dock position="-73942, 1288, -255" roll=90 yaw=180 >
+ <animations>
+ <MoveToDockingTarget target="destroyer" />
+ </animations>
+ <effects>
+ <DockToShip target="spaceShip" />
+ </effects>
+ <events>
+ <execute>
+ <EventListener event="dockMe" />
+ </execute>
+ </events>
+ <attached>
+ <DistanceTrigger position="10,-202, -42" distance="400" target="Pawn"
+ beaconMode="exclude" targetname="bcnDestroyer" name="dockMe"
+ />
+ <Billboard position="10,-202,-42" material="Examples/Flare" colour="1.0, 0, 0" />
+ </attached>
+ </Dock>
+
+ <SpaceShip template="spaceshipassff2" position="-73915,3786,67" orientation="-0.14045, 0.68254, 0.68144, 0.223774" >
+ <attached>
+ <DockingTarget name="spaceShip" />
+ </attached>
+ </SpaceShip>
+
+
<PickupSpawner position="-25,-50,-125" respawnTime="10" triggerDistance="20" maxSpawnedItems="5">
<pickup>
<ShrinkPickup template ="smallshrinkpickup"/>
Modified: code/branches/presentation/src/modules/portals/PortalEndPoint.cc
===================================================================
--- code/branches/presentation/src/modules/portals/PortalEndPoint.cc 2011-05-27 19:54:03 UTC (rev 8627)
+++ code/branches/presentation/src/modules/portals/PortalEndPoint.cc 2011-05-27 20:54:34 UTC (rev 8628)
@@ -41,13 +41,17 @@
std::map<unsigned int, PortalEndPoint *> PortalEndPoint::idMap_s;
- PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), id_(0), trigger_(NULL), reenterDelay_(0)
+ PortalEndPoint::PortalEndPoint(BaseObject* creator) : StaticEntity(creator), RadarViewable(creator, static_cast<WorldEntity*>(this)), id_(0), trigger_(NULL), reenterDelay_(0)
{
RegisterObject(PortalEndPoint);
this->trigger_ = new DistanceMultiTrigger(this);
this->trigger_->setName("portal");
this->attach(trigger_);
+
+ this->setRadarObjectColour(ColourValue::White);
+ this->setRadarObjectShape(RadarViewable::Dot);
+ this->setRadarVisibility(true);
}
PortalEndPoint::~PortalEndPoint()
@@ -116,6 +120,13 @@
return true;
}
+ void PortalEndPoint::changedActivity(void)
+ {
+ SUPER(PortalEndPoint, changedActivity);
+
+ this->setRadarVisibility(this->isActive());
+ }
+
bool PortalEndPoint::letsEnter(MobileEntity* entity)
{
// not allowed to enter if reenterDelay hasn't expired yet
Modified: code/branches/presentation/src/modules/portals/PortalEndPoint.h
===================================================================
--- code/branches/presentation/src/modules/portals/PortalEndPoint.h 2011-05-27 19:54:03 UTC (rev 8627)
+++ code/branches/presentation/src/modules/portals/PortalEndPoint.h 2011-05-27 20:54:34 UTC (rev 8628)
@@ -42,6 +42,7 @@
#include <map>
#include "worldentities/StaticEntity.h"
+#include "interfaces/RadarViewable.h"
#include "graphics/Billboard.h"
#include "objects/triggers/DistanceMultiTrigger.h"
#include "core/EventIncludes.h"
@@ -56,49 +57,37 @@
@ingroup Portals
*/
- class _PortalsExport PortalEndPoint : public StaticEntity
+ class _PortalsExport PortalEndPoint : public StaticEntity, public RadarViewable
{
public:
PortalEndPoint(BaseObject* creator);
virtual ~PortalEndPoint();
+
virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
+ virtual void changedActivity(void);
+
inline void setTarget(const std::string & target) //!< add types which are allowed to activate the PortalEndPoint
- {
- this->trigger_->addTarget(target);
- }
+ { this->trigger_->addTarget(target); }
void XMLEventPort(Element& xmlelement, XMLPort::Mode mode);
static std::map<unsigned int, PortalEndPoint *> idMap_s; //!< Maps the id of each PortalEndPoint to a pointer to that PortalEndPoint
inline void setReenterDelay(unsigned int seconds)
- {
- this->reenterDelay_ = seconds;
- }
+ { this->reenterDelay_ = seconds; }
inline unsigned int getReenterDelay()
- {
- return this->reenterDelay_;
- }
+ { return this->reenterDelay_; }
inline void setID(unsigned int id)
- {
- this->id_ = id;
- }
+ { this->id_ = id; }
inline unsigned int getID() const
- {
- return this->id_;
- }
+ { return this->id_; }
/// \brief Set templateName_ (the name of the design Template) and add that Template to this Object
inline void setTemplate(const std::string & name)
- {
- this->templateName_ = name;
- this->addTemplate(name);
- }
+ { this->templateName_ = name; this->addTemplate(name); }
/// \brief Get the name of the attached design template
inline const std::string & getTemplate()
- {
- return this->templateName_;
- }
+ { return this->templateName_; }
/*! \brief This function is called each time the DistanceMultiTrigger of this PortalEndPoint changed
\param bTriggered true if the trigger was triggered on, false if the trigger has switched to off
More information about the Orxonox-commit
mailing list