CEL

Public API Reference

propclass/wheeled.h

00001 /*
00002     Crystal Space Entity Layer
00003     Copyright (C) 2006 by Jorrit Tyberghein
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Library General Public
00007     License as published by the Free Software Foundation; either
00008     version 2 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Library General Public License for more details.
00014 
00015     You should have received a copy of the GNU Library General Public
00016     License along with this library; if not, write to the Free
00017     Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 #ifndef __CEL_PF_WHEELED__
00021 #define __CEL_PF_WHEELED__
00022 
00023 #include "cstypes.h"
00024 #include "csutil/scf.h"
00025 #include "csgeom/matrix3.h"
00026 
00046 struct iCelEntity;
00047 struct iBodyGroup;
00048 struct iMeshFactoryWrapper;
00049 struct iODEHinge2Joint;
00050 struct iRigidBody;
00051 
00052 struct iPcWheeled : public virtual iBase
00053 {
00054   SCF_INTERFACE (iPcWheeled, 0, 0, 1);
00055 
00063   virtual void SetWheelMesh(const char* wheelfact, const char* wheelfile) = 0;
00064 
00072   virtual void SetWheelMesh(size_t wheelnum, const char* wheelfact,
00073       const char* wheelfile) = 0;
00074 
00079   virtual void SetTankMode(bool tankmode) = 0;
00080 
00084   virtual bool GetTankMode() = 0;
00085 
00096   virtual size_t AddWheelAuto(csVector3 position, const char* wheelfact = 0,
00097      const char* wheelfile = 0,
00098      csMatrix3 rotation = csMatrix3(0.0f,0.0f,0.0f,0.0f)) = 0;
00099 
00120   virtual size_t AddWheel(csVector3 position,
00121                        float turnspeed, float returnspeed,
00122                        float suspensionsoftness, float suspensiondamping,
00123                        float brakepower, float enginepower,
00124                        float leftsteersensitivity,
00125                        float rightsteersensitivity, bool handbrakeaffect,
00126                        bool steerinvert, const char* wheelfact = 0, 
00127                        const char* wheelfile = 0,
00128                        csMatrix3 rotation = csMatrix3(0.0f,0.0f,0.0f,0.0f)) = 0;
00129 
00134   virtual void DeleteWheel(size_t wheelnum) = 0;
00135 
00139   virtual void DeleteAllWheels() = 0;
00140 
00145   virtual void DestroyWheel(size_t wheelnum) = 0;
00146 
00151   virtual void DestroyAllWheels() = 0;
00152 
00156   virtual void RestoreWheel(size_t wheelnum) = 0;
00157 
00161   virtual void RestoreAllWheels() = 0;
00162 
00171   virtual void SetOuterWheelSteerPreset(float sensitivity) = 0;
00172 
00184   virtual void SetFrontWheelPreset(float sensitivity,float power,
00185      float suspensionsoftness, float suspensiondamping) = 0;
00186 
00198   virtual void SetRearWheelPreset(float sensitivity,float power,
00199      float suspensionsoftness, float suspensiondamping) = 0;
00200 
00205   virtual void Accelerate(bool applied) = 0;
00206 
00210   virtual bool IsAccelerating() = 0;
00211 
00216   virtual void Brake(bool applied) = 0;
00217 
00221   virtual bool IsBraking() = 0;
00222 
00227   virtual void Handbrake(bool applied) = 0;
00228 
00232   virtual bool IsHandbraking() = 0;
00233 
00234 
00239   virtual void SetSteerAmount(float amount) = 0;
00240 
00245   virtual void SetBrakeForce(float force) = 0;
00246 
00250   virtual float GetSteerAmount() = 0;
00251 
00255   virtual void SteerLeft() = 0;
00256 
00260   virtual void SteerRight() = 0;
00261 
00265   virtual void SteerStraight() = 0;
00266 
00270   virtual void Reverse() = 0;
00271 
00276   virtual void Neutral() = 0;
00277 
00283   virtual void SetAutoTransmission(bool auto) = 0;
00284 
00290   virtual void SetGear(int gear) = 0;
00291 
00295   virtual int GetGear() = 0;
00296 
00300   virtual void SetGearSettings(int gear,float velocity, float force) = 0;
00301 
00305   virtual int GetTopGear() = 0;
00306 
00312   virtual void SetAutoReverse(bool autoreverse) = 0;
00313 
00317   virtual iBodyGroup* GetBodyGroup() = 0;
00318 
00324   virtual void SetWheelPosition(size_t wheelnum, csVector3 position) = 0;
00325 
00331   virtual void SetWheelRotation(size_t wheelnum, csMatrix3 rotation) = 0;
00332 
00338   virtual void SetWheelSuspensionSoftness(size_t wheelnum, float softness) = 0;
00339 
00345   virtual void SetWheelSuspensionDamping(size_t wheelnum, float damping) = 0;
00346 
00355   virtual void SetWheelLeftSteerSensitivity(size_t wheelnum,
00356       float sensitivity) = 0;
00357 
00366   virtual void SetWheelRightSteerSensitivity(size_t wheelnum,
00367       float sensitivity) = 0;
00368 
00375   virtual void SetWheelTurnSpeed(size_t wheelnum, float speed) = 0;
00376 
00382   virtual void SetWheelReturnSpeed(size_t wheelnum, float speed) = 0;
00383 
00390   virtual void SetWheelEnginePower(size_t wheelnum, float power) = 0;
00391 
00398   virtual void SetWheelBrakePower(size_t wheelnum, float power) = 0;
00399 
00407   virtual void SetWheelSteerInverted(size_t wheelnum, bool inverted) = 0;
00408 
00416   virtual void SetWheelHandbrakeAffected(size_t wheelnum,
00417       bool handbrakeaffected) = 0;
00418 
00423   virtual csVector3 GetWheelPosition(size_t wheelnum) = 0;
00424 
00429   virtual csMatrix3 GetWheelRotation(size_t wheelnum) = 0;
00430 
00435   virtual float GetWheelSuspensionSoftness(size_t wheelnum) = 0;
00436 
00441   virtual float GetWheelSuspensionDamping(size_t wheelnum) = 0;
00442 
00447   virtual float GetWheelLeftSteerSensitivity(size_t wheelnum) = 0;
00448 
00453   virtual float GetWheelRightSteerSensitivity(size_t wheelnum) = 0;
00454 
00459   virtual float GetWheelTurnSpeed(size_t wheelnum) = 0;
00460 
00465   virtual float GetWheelReturnSpeed(size_t wheelnum) = 0;
00466 
00472   virtual float GetWheelEnginePower(size_t wheelnum) = 0;
00473 
00478   virtual float GetWheelBrakePower(size_t wheelnum) = 0;
00479 
00484   virtual bool GetWheelSteerInverted(size_t wheelnum) = 0;
00485 
00490   virtual bool GetWheelHandbrakeAffected(size_t wheelnum) = 0;
00491 
00495   virtual size_t GetWheelCount() = 0;
00496 
00501   virtual iRigidBody* GetWheelBody(size_t wheelnum) = 0;
00502 
00507   virtual iODEHinge2Joint* GetWheelJoint(size_t wheelnum) = 0;
00508 };
00509 
00510 #endif // __CEL_PF_WHEELED__
00511 

Generated for CEL: Crystal Entity Layer by doxygen 1.4.7