1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef CL_PLAYER_R2_CL_H
20 #define CL_PLAYER_R2_CL_H
27 #include "nel/misc/types_nl.h"
29 #include "nel/3d/u_point_light.h"
31 #include "character_cl.h"
33 #include "client_sheets/race_stats_sheet.h"
35 #include "game_share/people.h"
44 * Class to manage a R2 player.
45 * \author Typhaine Le Gallo
46 * \author Nevrax France
49 class CPlayerR2CL
: public CCharacterCL
52 NLMISC_DECLARE_CLASS(CPlayerR2CL
);
57 virtual ~CPlayerR2CL();
59 /// Build the entity from a sheet.
60 virtual bool build(const CEntitySheet
*sheet
);
62 /// Method to return the attack radius of an entity
63 virtual double attackRadius() const;
64 /** Return the position the attacker should have to combat according to the attack angle.
65 * \param ang : 0 = the front, >0 and <Pi = left side, <0 and >-Pi = right side.
67 virtual NLMISC::CVectorD
getAttackerPos(double ang
, double dist
) const;
70 * Methods only here for the debug.
73 /// Display Debug Information.
74 virtual void displayDebug(float x
, float &y
, float lineStep
);
77 /// Return the People for the entity.
78 //virtual EGSPD::CPeople::TPeople people() const;
79 //virtual void setPeople(EGSPD::CPeople::TPeople people);
81 /// Return a pointer on the sheet used to create this player.
82 //const CRaceStatsSheet *playerSheet() const {return _PlayerSheet;}
84 /// Return the entity scale. (return 1.0 if there is any problem).
85 virtual float getScale() const;
86 // return vector of ground fxs sorted by ground type, or NULL is ground fxs are not supported for the entity
87 //virtual const std::vector<CGroundFXSheet> *getGroundFX() const;
88 virtual bool supportGroundFX() const { return true; }
90 /// Return true if this player is in the same faction as the user's (except if neutral)
91 bool isFromSameNonNeutralPvpClanAsUser() const;
94 //const char *getBoneNameFromBodyPart(BODY::TBodyPart part, BODY::TSide side) const;
96 // retrieve right hand item sheet
97 virtual const CItemSheet
*getRightHandItemSheet() const;
98 virtual const CItemSheet
*getLeftHandItemSheet() const;
100 //virtual const CAttack *getAttack(const CAttackIDSheet &id) const;
102 virtual float getScaleRef() const;
105 void makeTransparent(bool t
);
106 virtual void setDiffuse(bool onOff
, NLMISC::CRGBA diffuse
);
109 /// Pointer on the Sheet with basic parameters.
110 //const CPlayerSheet *_Sheet;
111 /// Pointer on the Sheet with basic parameters.
112 //const CRaceStatsSheet *_PlayerSheet;
116 std::string _DefaultChest
;
117 std::string _DefaultLegs
;
118 std::string _DefaultArms
;
119 std::string _DefaultHands
;
120 std::string _DefaultFeet
;
121 std::string _DefaultHair
;
124 /// 'true' while the entity is not ready to be displayed.
125 bool _WaitForAppearance
;
126 // AsyncTexturing: true if all instances are not loaded.
127 bool _PlayerCLAsyncTextureLoading
;
128 // Is the light On or Off.
131 NL3D::UPointLight _Light
;
133 std::string _CacheSkeletonShapeName
;
136 // Return the automaton type of the entity (homin, creature, etc.)
137 //virtual std::string automatonType() const;
139 // Initialize the graphic for the player.
142 /// Initialize properties of the entity (according to the class).
143 virtual void initProperties();
145 /// Set the equipmenent worn.
146 void equip(SLOTTYPE::EVisualSlot slot
, const std::string
&shapeName
, const CItemSheet
*item
= 0);
147 /// Compute the equipmenent worn.
148 void equip(SLOTTYPE::EVisualSlot slot
, uint index
, uint color
);
150 /// Update the Visual Property A
151 virtual void updateVisualPropertyVpa(const NLMISC::TGameCycle
&gameCycle
, const sint64
&prop
);
152 /// Update the Visual Property B
153 virtual void updateVisualPropertyVpb(const NLMISC::TGameCycle
&gameCycle
, const sint64
&prop
);
154 /// Update the Visual Property C
155 virtual void updateVisualPropertyVpc(const NLMISC::TGameCycle
&gameCycle
, const sint64
&prop
);
156 // Get The Entity Skin
157 //virtual sint skin() const;
160 virtual SInstanceCL
*getFace ();
163 virtual void drawName(const NLMISC::CMatrix
&mat
);
166 * Methods to manage basics 3D systems
169 /** update the display of the AsyncTexture of the entity. called in updateDisplay()
170 * Deriver: See CPlayerCL implementation
171 * \return distance from entity to camera computed (helper for deriver)
173 virtual float updateAsyncTexture();
175 /// Update the Lod Texture When needed
176 virtual void updateLodTexture();
178 /// Return the basic max speed for the entity in meter per sec
179 virtual double getMaxSpeed() const;
181 // Read/Write Variables from/to the stream.
182 virtual void readWrite(NLMISC::IStream
&f
);
183 // To call after a read from a stream to re-initialize the entity.
186 /// Return name position on Z axis defined in sheet
187 //virtual float getNamePosZ() const;
189 // virtual for special PlayerCL _Face mgt
190 virtual void doSetVisualSelectionBlink(bool bOnOff
, NLMISC::CRGBA emitColor
);
192 CGenderInfo
* getGenderInfo();
197 #endif // CL_PLAYER_R2_CL_H
199 /* End of player_r2_cl.h */