CEL: Crystal Entity Layer: propclass/linmove.h Source File (CEL: Crystal Entity Layer Public API Reference)

| ## Public API Reference

- Main Page
- Classes
- Files

# 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, 1);
    00053
    00054   virtual void Callback () = 0;
    00055 };
    00056
    00088 struct iPcLinearMovement : public virtual iBase
    00089 {
    00090   SCF_INTERFACE (iPcLinearMovement, 0, 0, 2);
    00091
    00098   virtual void SetAnchor (iPcMesh* pcmesh) = 0;
    00099
    00103   virtual iPcMesh* GetAnchor () const = 0;
    00104
    00108   virtual void SetAngularVelocity (const csVector3& angle) = 0;
    00109
    00115   virtual void SetAngularVelocity (const csVector3& angle,
    00116         const csVector3& angle_to_reach) = 0;
    00117
    00121   virtual void SetSpeed (float speedZ) = 0;
    00122
    00126   virtual void SetVelocity (const csVector3& vel) = 0;
    00127
    00132   virtual void AddVelocity (const csVector3& vel) = 0;
    00133
    00135   virtual void ClearWorldVelocity () = 0;
    00136
    00137
    00141   virtual void GetVelocity (csVector3& v) const = 0;
    00142
    00146   virtual void GetAngularVelocity (csVector3& v) const = 0;
    00147
    00156   virtual bool InitCD (iMeshWrapper* mesh, float percentage,
    00157         iPcCollisionDetection* pc_cd = 0) = 0;
    00158
    00167   virtual bool InitCD (const csVector3& body, const csVector3& legs,
    00168         const csVector3& shift, iPcCollisionDetection *pc_cd = 0) = 0;
    00169
    00173   virtual void GetCDDimensions (csVector3& body, csVector3& legs,
    00174         csVector3& shift, iPcCollisionDetection*& pc_cd) = 0;
    00175
    00179   virtual bool InitCD (iPcCollisionDetection *pc_cd=0) = 0;
    00180
    00185   virtual csTicks TimeDiff (void) = 0;
    00186
    00188   virtual void GetDRData (bool& on_ground, float& speed, csVector3& pos,
    00189         float& yrot, iSector*& sector, csVector3& vel, csVector3& worldVel,
    00190         float& ang_vel) = 0;
    00191
    00192
    00194   virtual void SetDRData (bool on_ground,float speed, csVector3& pos,
    00195         float yrot, iSector *sector, csVector3& vel, csVector3& worldVel,
    00196         float ang_vel) = 0;
    00197
    00204   virtual void SetSoftDRData (bool on_ground,float speed, csVector3& pos,
    00205         float yrot,iSector *sector, csVector3& vel, csVector3& worldVel,
    00206         float ang_vel) = 0;
    00207
    00212   virtual void SetFullPosition (const csVector3& pos, float yrot,
    00213         const iSector* sector) = 0;
    00218   virtual void SetPosition (const csVector3& pos, float yrot,
    00219         const iSector* sector) = 0;
    00225   virtual void GetLastPosition (csVector3& pos, float& yrot,
    00226         iSector*& sector) = 0;
    00231   virtual void GetLastFullPosition (csVector3& pos, float& yrot,
    00232         iSector*& sector) = 0;
    00233
    00235   virtual bool IsPath () const = 0;
    00236
    00240   virtual iSector* GetSector () = 0;
    00241
    00246   virtual void ExtrapolatePosition (float delta) = 0;
    00247
    00254   virtual void UpdateDRDelta (csTicks ticksdelta) = 0;
    00255
    00263   virtual void UpdateDR (csTicks ticks) = 0;
    00264
    00270   virtual void SetPath (iPath *newpath) = 0;
    00271
    00276   virtual void SetPathTime (float timeval) = 0;
    00277
    00285   virtual void SetPathSpeed (float speed) = 0;
    00286
    00295   virtual void SetPathAction (int which, const char *action) = 0;
    00296
    00301   virtual void SetPathSector (const char *sectorname) = 0;
    00302
    00303   virtual bool IsOnGround () const = 0;
    00304
    00305   virtual void SetOnGround (bool onground) = 0;
    00306
    00308   virtual void SetHugGround (bool hugGround) = 0;
    00309
    00310   virtual void SetDeltaLimit(float deltaLimit) = 0;
    00311
    00312   virtual bool RotateV (float delta) = 0;
    00313
    00314   virtual void SetGravity (float grav) = 0;
    00315
    00316   virtual float GetGravity () = 0;
    00317
    00318   virtual void ResetGravity () = 0;
    00319
    00326   virtual void AddGravityCallback (iPcGravityCallback* callback) = 0;
    00327
    00331   virtual void RemoveGravityCallback (iPcGravityCallback* callback) = 0;
    00332
    00334   virtual csVector3 GetPortalDisplacement () = 0;
    00335
    00337   virtual void ClearPortalDisplacement () = 0;
    00338
    00344   virtual void SetFullPosition (const char* center_name, float yrot,
    00345         iSector* sector) = 0;
    00350   virtual void SetPosition (const char* center_name, float yrot,
    00351         iSector* sector) = 0;
    00352 };
    00353
    00354 #endif
    00355