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 class csReversibleTransform; 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 00058 virtual void Callback () = 0; 00059 }; 00060 00097 struct iPcLinearMovement : public virtual iBase 00098 { 00099 SCF_INTERFACE (iPcLinearMovement, 0, 0, 3); 00100 00107 virtual void SetAnchor (iPcMesh* pcmesh) = 0; 00108 00112 virtual iPcMesh* GetAnchor () const = 0; 00113 00117 virtual void SetAngularVelocity (const csVector3& angle) = 0; 00118 00123 virtual void SetAngularVelocity (const csVector3& angle, 00124 const csVector3& angle_to_reach) = 0; 00125 00129 virtual void SetSpeed (float speedZ) = 0; 00131 virtual float GetSpeed () const = 0; 00132 00133 CS_DEPRECATED_METHOD_MSG("Use void SetBodyVelocity () instead.") 00137 virtual void SetVelocity (const csVector3& vel) = 0; 00138 00142 virtual void SetBodyVelocity (const csVector3& vel) = 0; 00143 00147 virtual void SetWorldVelocity (const csVector3& vel) = 0; 00148 00152 virtual void AddVelocity (const csVector3& vel) = 0; 00153 00155 virtual void ClearWorldVelocity () = 0; 00156 00161 CS_DEPRECATED_METHOD_MSG("Use csVector3 GetVelocity () instead.") 00162 virtual void GetVelocity (csVector3& v) const = 0; 00163 00167 virtual const csVector3 &GetBodyVelocity () const = 0; 00168 00172 virtual const csVector3 &GetWorldVelocity () const = 0; 00173 00178 virtual const csVector3 GetVelocity () const = 0; 00179 00183 virtual void GetAngularVelocity (csVector3& v) const = 0; 00184 00193 virtual bool InitCD (iMeshWrapper* mesh, float percentage, 00194 iPcCollisionDetection* pc_cd = 0) = 0; 00195 00204 virtual bool InitCD (const csVector3& body, const csVector3& legs, 00205 const csVector3& shift, iPcCollisionDetection *pc_cd = 0) = 0; 00206 00210 virtual void GetCDDimensions (csVector3& body, csVector3& legs, 00211 csVector3& shift, iPcCollisionDetection*& pc_cd) = 0; 00212 00216 virtual bool InitCD (iPcCollisionDetection *pc_cd=0) = 0; 00217 00222 virtual csTicks TimeDiff (void) = 0; 00223 00225 virtual void GetDRData (bool& on_ground, float& speed, csVector3& pos, 00226 float& yrot, iSector*& sector, csVector3& vel, csVector3& worldVel, 00227 float& ang_vel) = 0; 00228 00229 00231 virtual void SetDRData (bool on_ground,float speed, csVector3& pos, 00232 float yrot, iSector *sector, csVector3& vel, csVector3& worldVel, 00233 float ang_vel) = 0; 00234 00241 virtual void SetSoftDRData (bool on_ground,float speed, csVector3& pos, 00242 float yrot,iSector *sector, csVector3& vel, csVector3& worldVel, 00243 float ang_vel) = 0; 00244 00249 virtual void SetFullPosition (const csVector3& pos, float yrot, 00250 const iSector* sector) = 0; 00255 virtual void SetPosition (const csVector3& pos, float yrot, 00256 const iSector* sector) = 0; 00262 virtual void GetLastPosition (csVector3& pos, float& yrot, 00263 iSector*& sector) = 0; 00268 virtual void GetLastFullPosition (csVector3& pos, float& yrot, 00269 iSector*& sector) = 0; 00270 00274 virtual float GetYRotation () = 0; 00280 virtual const csVector3 GetPosition () = 0; 00285 virtual const csVector3 GetFullPosition () = 0; 00286 00290 virtual const csReversibleTransform GetFullTransform () = 0; 00291 00293 virtual bool IsPath () const = 0; 00294 00298 virtual iSector* GetSector () = 0; 00299 00304 virtual void ExtrapolatePosition (float delta) = 0; 00305 00312 virtual void UpdateDRDelta (csTicks ticksdelta) = 0; 00313 00321 virtual void UpdateDR (csTicks ticks) = 0; 00322 00330 virtual void UpdateDR () = 0; 00331 00337 virtual void SetPath (iPath *newpath) = 0; 00338 00343 virtual void SetPathTime (float timeval) = 0; 00344 00352 virtual void SetPathSpeed (float speed) = 0; 00353 00362 virtual void SetPathAction (int which, const char *action) = 0; 00363 00368 virtual void SetPathSector (const char *sectorname) = 0; 00369 00373 virtual bool IsOnGround () const = 0; 00374 00378 virtual void SetOnGround (bool onground) = 0; 00379 00383 virtual void SetHugGround (bool hugGround) = 0; 00384 00385 /* 00386 * Set maximum time delta to use when extrapolating positions. 00387 */ 00388 virtual void SetDeltaLimit (float deltaLimit) = 0; 00389 00391 virtual float GetDeltaLimit () const = 0; 00392 00393 /* 00394 * Rotates the mesh by a certain amount. This function is intended to be 00395 * used internally and should not be used. 00396 */ 00397 virtual bool RotateV (float delta) = 0; 00398 00399 /* 00400 * Set value of gravity affecting this object. 00401 */ 00402 virtual void SetGravity (float grav) = 0; 00403 00404 /* 00405 * Get current value of gravity affecting this object. 00406 */ 00407 virtual float GetGravity () = 0; 00408 00409 /* 00410 * Reset gravity to default (19.6f) for this object. 00411 */ 00412 virtual void ResetGravity () = 0; 00413 00420 virtual void AddGravityCallback (iPcGravityCallback* callback) = 0; 00421 00425 virtual void RemoveGravityCallback (iPcGravityCallback* callback) = 0; 00426 00428 virtual csVector3 GetPortalDisplacement () = 0; 00429 00431 virtual void ClearPortalDisplacement () = 0; 00432 00438 virtual void SetFullPosition (const char* center_name, float yrot, 00439 iSector* sector) = 0; 00444 virtual void SetPosition (const char* center_name, float yrot, 00445 iSector* sector) = 0; 00446 }; 00447 00448 #endif 00449
Generated for CEL: Crystal Entity Layer 2.0 by doxygen 1.6.1
