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
    00042 SCF_VERSION (iPcGravityCallback, 0, 0, 1);
    00043
    00052 struct iPcGravityCallback : public iBase
    00053 {
    00054 public:
    00055     virtual void Callback () = 0;
    00056 };
    00057
    00058 SCF_VERSION (iPcLinearMovement, 0, 0, 2);
    00059
    00088 struct iPcLinearMovement : public iBase
    00089 {
    00096   virtual void SetAnchor (iPcMesh* pcmesh) = 0;
    00097
    00101   virtual iPcMesh* GetAnchor () const = 0;
    00102
    00106   virtual void SetAngularVelocity (const csVector3& angle) = 0;
    00107
    00113   virtual void SetAngularVelocity (const csVector3& angle,
    00114         const csVector3& angle_to_reach) = 0;
    00115
    00119   virtual void SetSpeed (float speedZ) = 0;
    00120
    00124   virtual void SetVelocity (const csVector3& vel) = 0;
    00125
    00130   virtual void AddVelocity (const csVector3& vel) = 0;
    00131
    00133   virtual void ClearWorldVelocity () = 0;
    00134
    00135
    00139   virtual void GetVelocity (csVector3& v) const = 0;
    00140
    00144   virtual void GetAngularVelocity (csVector3& v) const = 0;
    00145
    00154   virtual bool InitCD (iMeshWrapper* mesh, float percentage,
    00155         iPcCollisionDetection* pc_cd = 0) = 0;
    00156
    00165   virtual bool InitCD (const csVector3& body, const csVector3& legs,
    00166         const csVector3& shift, iPcCollisionDetection *pc_cd = 0) = 0;
    00167
    00171   virtual void GetCDDimensions (csVector3& body, csVector3& legs,
    00172         csVector3& shift, iPcCollisionDetection*& pc_cd) = 0;
    00173
    00177   virtual bool InitCD (iPcCollisionDetection *pc_cd=0) = 0;
    00178
    00183   virtual csTicks TimeDiff (void) = 0;
    00184
    00186   virtual void GetDRData (bool& on_ground, float& speed, csVector3& pos,
    00187         float& yrot, iSector*& sector, csVector3& vel, csVector3& worldVel,
    00188         float& ang_vel) = 0;
    00189
    00190
    00192   virtual void SetDRData (bool on_ground,float speed, csVector3& pos,
    00193         float yrot, iSector *sector, csVector3& vel, csVector3& worldVel,
    00194         float ang_vel) = 0;
    00195
    00202   virtual void SetSoftDRData (bool on_ground,float speed, csVector3& pos,
    00203         float yrot,iSector *sector, csVector3& vel, csVector3& worldVel,
    00204         float ang_vel) = 0;
    00205
    00210   virtual void SetFullPosition (const csVector3& pos, float yrot,
    00211         const iSector* sector) = 0;
    00216   virtual void SetPosition (const csVector3& pos, float yrot,
    00217         const iSector* sector) = 0;
    00223   virtual void GetLastPosition (csVector3& pos, float& yrot,
    00224         iSector*& sector) = 0;
    00229   virtual void GetLastFullPosition (csVector3& pos, float& yrot,
    00230         iSector*& sector) = 0;
    00231
    00233   virtual bool IsPath () const = 0;
    00234
    00238   virtual iSector* GetSector () = 0;
    00239
    00244   virtual void ExtrapolatePosition (float delta) = 0;
    00245
    00252   virtual void UpdateDRDelta (csTicks ticksdelta) = 0;
    00253
    00261   virtual void UpdateDR (csTicks ticks) = 0;
    00262
    00268   virtual void SetPath (iPath *newpath) = 0;
    00269
    00274   virtual void SetPathTime (float timeval) = 0;
    00275
    00283   virtual void SetPathSpeed (float speed) = 0;
    00284
    00293   virtual void SetPathAction (int which, const char *action) = 0;
    00294
    00299   virtual void SetPathSector (const char *sectorname) = 0;
    00300
    00301   virtual bool IsOnGround () const = 0;
    00302
    00303   virtual void SetOnGround (bool onground) = 0;
    00304
    00306   virtual void SetHugGround (bool hugGround) = 0;
    00307
    00308   virtual void SetDeltaLimit(float deltaLimit) = 0;
    00309
    00310   virtual bool RotateV (float delta) = 0;
    00311
    00312   virtual void SetGravity (float grav) = 0;
    00313
    00314   virtual float GetGravity () = 0;
    00315
    00316   virtual void ResetGravity () = 0;
    00317
    00324   virtual void AddGravityCallback (iPcGravityCallback* callback) = 0;
    00325
    00329   virtual void RemoveGravityCallback (iPcGravityCallback* callback) = 0;
    00330
    00332   virtual csVector3 GetPortalDisplacement () = 0;
    00333
    00335   virtual void ClearPortalDisplacement () = 0;
    00336
    00342   virtual void SetFullPosition (const char* center_name, float yrot,
    00343         iSector* sector) = 0;
    00348   virtual void SetPosition (const char* center_name, float yrot,
    00349         iSector* sector) = 0;
    00350 };
    00351
    00352 #endif
    00353