propclass/linmove.h
00001 /* 00002 Crystal Space Entity Layer 00003 Copyright (C) 2001 PlaneShift Team (info@planeshift.it, 00004 Copyright (C) 2001-2003 by Jorrit Tyberghein 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public 00017 License along with this library; if not, write to the Free 00018 Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 /* 00022 * This code is heavily based on pslinmove from the PlaneShift project. 00023 * Thanks a lot for making this! 00024 */ 00025 00026 #ifndef __CEL_PF_LINEAR_MOVE__ 00027 #define __CEL_PF_LINEAR_MOVE__ 00028 00029 #include "cstypes.h" 00030 #include "csutil/scf.h" 00031 #include "csutil/strhash.h" 00032 00033 00034 struct iDataBuffer; 00035 struct iSector; 00036 struct iPath; 00037 struct iPcCollisionDetection; 00038 struct iPcMesh; 00039 struct iMeshWrapper; 00040 00041 00050 struct iPcGravityCallback : public virtual iBase 00051 { 00052 SCF_INTERFACE (iPcGravityCallback, 0, 0, 2); 00053 00054 virtual void Callback () = 0; 00055 }; 00056 00093 struct iPcLinearMovement : public virtual iBase 00094 { 00095 SCF_INTERFACE (iPcLinearMovement, 0, 0, 2); 00096 00103 virtual void SetAnchor (iPcMesh* pcmesh) = 0; 00104 00108 virtual iPcMesh* GetAnchor () const = 0; 00109 00113 virtual void SetAngularVelocity (const csVector3& angle) = 0; 00114 00119 virtual void SetAngularVelocity (const csVector3& angle, 00120 const csVector3& angle_to_reach) = 0; 00121 00125 virtual void SetSpeed (float speedZ) = 0; 00126 00130 virtual void SetVelocity (const csVector3& vel) = 0; 00131 00136 virtual void AddVelocity (const csVector3& vel) = 0; 00137 00139 virtual void ClearWorldVelocity () = 0; 00140 00141 00146 CS_DEPRECATED_METHOD_MSG("Use csVector3 GetVelocity () instead.") 00147 virtual void GetVelocity (csVector3& v) const = 0; 00148 00152 virtual const csVector3 GetVelocity () const = 0; 00153 00157 virtual void GetAngularVelocity (csVector3& v) const = 0; 00158 00167 virtual bool InitCD (iMeshWrapper* mesh, float percentage, 00168 iPcCollisionDetection* pc_cd = 0) = 0; 00169 00178 virtual bool InitCD (const csVector3& body, const csVector3& legs, 00179 const csVector3& shift, iPcCollisionDetection *pc_cd = 0) = 0; 00180 00184 virtual void GetCDDimensions (csVector3& body, csVector3& legs, 00185 csVector3& shift, iPcCollisionDetection*& pc_cd) = 0; 00186 00190 virtual bool InitCD (iPcCollisionDetection *pc_cd=0) = 0; 00191 00196 virtual csTicks TimeDiff (void) = 0; 00197 00199 virtual void GetDRData (bool& on_ground, float& speed, csVector3& pos, 00200 float& yrot, iSector*& sector, csVector3& vel, csVector3& worldVel, 00201 float& ang_vel) = 0; 00202 00203 00205 virtual void SetDRData (bool on_ground,float speed, csVector3& pos, 00206 float yrot, iSector *sector, csVector3& vel, csVector3& worldVel, 00207 float ang_vel) = 0; 00208 00215 virtual void SetSoftDRData (bool on_ground,float speed, csVector3& pos, 00216 float yrot,iSector *sector, csVector3& vel, csVector3& worldVel, 00217 float ang_vel) = 0; 00218 00223 virtual void SetFullPosition (const csVector3& pos, float yrot, 00224 const iSector* sector) = 0; 00229 virtual void SetPosition (const csVector3& pos, float yrot, 00230 const iSector* sector) = 0; 00236 virtual void GetLastPosition (csVector3& pos, float& yrot, 00237 iSector*& sector) = 0; 00242 virtual void GetLastFullPosition (csVector3& pos, float& yrot, 00243 iSector*& sector) = 0; 00244 00248 virtual float GetYRotation () = 0; 00254 virtual const csVector3 GetPosition () = 0; 00259 virtual const csVector3 GetFullPosition () = 0; 00260 00262 virtual bool IsPath () const = 0; 00263 00267 virtual iSector* GetSector () = 0; 00268 00273 virtual void ExtrapolatePosition (float delta) = 0; 00274 00281 virtual void UpdateDRDelta (csTicks ticksdelta) = 0; 00282 00290 virtual void UpdateDR (csTicks ticks) = 0; 00291 00299 virtual void UpdateDR () = 0; 00300 00306 virtual void SetPath (iPath *newpath) = 0; 00307 00312 virtual void SetPathTime (float timeval) = 0; 00313 00321 virtual void SetPathSpeed (float speed) = 0; 00322 00331 virtual void SetPathAction (int which, const char *action) = 0; 00332 00337 virtual void SetPathSector (const char *sectorname) = 0; 00338 00342 virtual bool IsOnGround () const = 0; 00343 00347 virtual void SetOnGround (bool onground) = 0; 00348 00352 virtual void SetHugGround (bool hugGround) = 0; 00353 00354 /* 00355 * Set maximum time delta to use when extrapolating positions. 00356 */ 00357 virtual void SetDeltaLimit (float deltaLimit) = 0; 00358 00359 /* 00360 * Rotates the mesh by a certain amount. This function is intended to be 00361 * used internally and should not be used. 00362 */ 00363 virtual bool RotateV (float delta) = 0; 00364 00365 /* 00366 * Set value of gravity affecting this object. 00367 */ 00368 virtual void SetGravity (float grav) = 0; 00369 00370 /* 00371 * Get current value of gravity affecting this object. 00372 */ 00373 virtual float GetGravity () = 0; 00374 00375 /* 00376 * Reset gravity to default (19.6f) for this object. 00377 */ 00378 virtual void ResetGravity () = 0; 00379 00386 virtual void AddGravityCallback (iPcGravityCallback* callback) = 0; 00387 00391 virtual void RemoveGravityCallback (iPcGravityCallback* callback) = 0; 00392 00394 virtual csVector3 GetPortalDisplacement () = 0; 00395 00397 virtual void ClearPortalDisplacement () = 0; 00398 00404 virtual void SetFullPosition (const char* center_name, float yrot, 00405 iSector* sector) = 0; 00410 virtual void SetPosition (const char* center_name, float yrot, 00411 iSector* sector) = 0; 00412 }; 00413 00414 #endif 00415
Generated for CEL: Crystal Entity Layer 1.4.1 by doxygen 1.7.1