Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 9, 2014, 9:50:45 PM (11 years ago)
Author:
noep
Message:

ShipParts can "die" and detach the corresponding Entity while doing so. Issue: The Entity being detached while a hit on a collisionshape is being handled causes a runtime-error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/modularships/src/orxonox/worldentities/pawns/ModularSpaceShip.h

    r10019 r10023  
    4848    /**
    4949    @brief
    50         The ModularSpaceShip is the principal entity through which the player interacts with the game. Its main function is to fly, however many things, such as @ref orxonox::Engine Engines or @ref orxonox::Weapon Weapons, can be attached to it.
     50        The SpaceShip is the principal entity through which the player interacts with the game. Its main function is to fly, however many things, such as @ref orxonox::Engine Engines or @ref orxonox::Weapon Weapons, can be attached to it.
     51        The ModularSpaceShip is an extension of a @ref orxonox::SpaceShip SpaceShip, which uses @ref orxonox::ShipPart ShipParts to allow entities attached to it to be destroyed individually.
    5152
    5253        There are several parameters that define the behavior of the ModularSpaceShip>
     
    5657        - The <b>lift</b> creates a more natural flight feeling through the addition of a lift force. There are again tow parameters that can be specified. The <b>lift</b> which is the lift force that is applied. And the <b>stallSpeed</b> which is the forward speed after which no more lift is generated.
    5758
    58         As mentioned @ref orxonox::Engine Engines can be mounted on the ModularSpaceShip. Here is a (primitive) example of a ModularSpaceShip defined in XML:
     59        As mentioned @ref orxonox::Engine Engines can be mounted on the ModularSpaceShip.
     60        In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag.
     61        Here is a (primitive) example of a ModularSpaceShip defined in XML:
    5962        @code
    6063        <ModularSpaceShip
     
    7780            angularDamping    = 0.9999999
    7881            >
     82                <attached>
     83                    <StaticEntity name="wing"  . . .  />
     84                    <StaticEntity name="tail" . . . />
     85                </attached>
     86                <parts>
     87                    <ShipPart name="wing" . . . />
     88                    <ShipPart name="tail" . . . />
     89                </parts>
    7990                <engines>
    8091                    <Engine />
     
    8596
    8697    @author
    87         Fabian 'x3n' Landau
     98        Fabian 'x3n' Landau, Noe Pedrazzini
    8899    */
    89100    class _OrxonoxExport ModularSpaceShip : public SpaceShip
     
    105116            ShipPart* getShipPart(unsigned int index);
    106117            bool hasShipPart(ShipPart* part) const;
     118            void removeShipPart(ShipPart* part);
    107119
    108120            virtual void updatePartAssignment();
Note: See TracChangeset for help on using the changeset viewer.