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

| ## Public API Reference

- Main Page
- Classes
- Files

# propclass/mechthruster.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2005 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_MECHANICS_THRUSTER__
    00021 #define __CEL_PF_MECHANICS_THRUSTER__
    00022
    00023 #include "cstypes.h"
    00024 #include "csutil/scf.h"
    00025
    00026 #include "propclass/mechcommon.h"
    00027
    00028 class csVector3;
    00029 struct iPcMechanicsObject;
    00030 struct iPcMechanicsThrusterGroup;
    00031
    00032 SCF_VERSION (iPcMechanicsThruster, 0, 0, 1);
    00033
    00045 struct iPcMechanicsThruster : public iBase
    00046 {
    00051   virtual void SetMechanicsObject (iPcMechanicsObject* mechsys) = 0;
    00052
    00056   virtual iPcMechanicsObject* GetMechanicsObject () = 0;
    00057
    00058
    00060   //Set thruster properties
    00061
    00066   virtual void SetPosition (const csVector3& pos) = 0;
    00067
    00071   virtual const csVector3& GetPosition () = 0;
    00072
    00077   virtual void SetOrientation (const csVector3& orientation) = 0;
    00078
    00082   virtual const csVector3& GetOrientation () = 0;
    00083
    00089   virtual void SetMaxThrust (float maxthrust) = 0;
    00090
    00094   virtual float GetMaxThrust () = 0;
    00095
    00101   virtual float GetThrustForce (float thrust) = 0;
    00102
    00106   virtual float AvailableThrust () = 0;
    00107
    00108
    00110   //Applying thrust
    00111
    00116   virtual void ThrustChange (float deltathrust) = 0;
    00117 };
    00118
    00119
    00120 SCF_VERSION (iPcMechanicsBalancedGroup, 0, 0, 1);
    00121
    00122 enum celAxisType {
    00123   CEL_AT_NONE,
    00124   CEL_AT_ROTATION,
    00125   CEL_AT_TRANSLATION
    00126 };
    00127
    00140 struct iPcMechanicsBalancedGroup : public iBase
    00141 {
    00146   virtual void SetType (celAxisType type) = 0;
    00147
    00151   virtual celAxisType GetType () = 0;
    00152
    00153
    00160   virtual void AddThruster (iPcMechanicsThruster* thruster, float multiplier) = 0;
    00161
    00166   virtual void RemoveThruster (const char* tag) = 0;
    00167
    00172   virtual iPcMechanicsThruster* GetThruster (const char* tag) = 0;
    00173
    00178   virtual float AvailableThrust () = 0;
    00179
    00184   virtual float AvailableThrustForce () = 0;
    00185
    00190   virtual void ChangeThrust (float deltathrust) = 0;
    00191 };
    00192
    00193
    00194 SCF_VERSION (iPcMechanicsThrusterController, 0, 0, 1);
    00195
    00211 struct iPcMechanicsThrusterController : public iBase
    00212 {
    00217   virtual void SetMechanicsObject (iPcMechanicsObject* mechobj) = 0;
    00218
    00222   virtual iPcMechanicsObject* GetMechanicsObject () = 0;
    00223
    00233   virtual void AddAxis (const char* name, celAxisType type, const
    00234         csVector3 axis) = 0;
    00235
    00240   virtual const csVector3 GetAxis (const char* name) = 0;
    00241
    00246   virtual const celAxisType GetAxisType (const char* name) = 0;
    00247
    00252   virtual const float GetAxisVelocity (const char* name) = 0;
    00253
    00258   virtual float GetAxisMaxForce (const char* name) = 0;
    00259
    00265   virtual float GetAxisMaxThrust (const char* name) = 0;
    00266
    00272   virtual void AddBalancedGroup (iPcMechanicsBalancedGroup* group,
    00273         const char* axisname) = 0;
    00274
    00280   virtual void RemoveBalancedGroup (const char* grouptag, const char*
    00281         axisname) = 0;
    00282
    00289   virtual void ApplyThrust (float thrust, const char* axisname,
    00290         uint32& id) = 0;
    00291
    00296   virtual void CancelThrust (uint32 id) = 0;
    00297 };
    00298
    00299 #endif //__CEL_PF_MECHANICS_THRUSTER__