CEL

Public API Reference

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 
00043 struct iPcMechanicsThruster : public iBase
00044 {
00049   virtual void SetMechanicsObject (iPcMechanicsObject* mechsys) = 0;
00050 
00054   virtual iPcMechanicsObject* GetMechanicsObject () = 0;
00055 
00056 
00058   //Set thruster properties
00059 
00064   virtual void SetPosition (const csVector3& pos) = 0;
00065 
00069   virtual const csVector3& GetPosition () = 0;
00070 
00075   virtual void SetOrientation (const csVector3& orientation) = 0;
00076 
00080   virtual const csVector3& GetOrientation () = 0;
00081 
00087   virtual void SetMaxThrust (float maxthrust) = 0;
00088 
00092   virtual float GetMaxThrust () = 0;
00093 
00099   virtual float GetThrustForce (float thrust) = 0;
00100 
00104   virtual float AvailableThrust () = 0;
00105 
00106 
00108   //Applying thrust
00109 
00114   virtual void ThrustChange (float deltathrust) = 0;
00115 };
00116 
00117 
00118 SCF_VERSION (iPcMechanicsBalancedGroup, 0, 0, 1);
00119 
00120 enum celAxisType
00121 {
00122   CEL_AT_NONE,
00123   CEL_AT_ROTATION,
00124   CEL_AT_TRANSLATION
00125 };
00126 
00137 struct iPcMechanicsBalancedGroup : public iBase
00138 {
00143   virtual void SetType (celAxisType type) = 0;
00144 
00148   virtual celAxisType GetType () = 0;
00149 
00150 
00157   virtual void AddThruster (iPcMechanicsThruster* thruster,
00158       float multiplier) = 0;
00159 
00164   virtual void RemoveThruster (const char* tag) = 0;
00165 
00170   virtual iPcMechanicsThruster* GetThruster (const char* tag) = 0;
00171 
00176   virtual float AvailableThrust () = 0;
00177 
00182   virtual float AvailableThrustForce () = 0;
00183 
00188   virtual void ChangeThrust (float deltathrust) = 0;
00189 };
00190 
00191 
00192 SCF_VERSION (iPcMechanicsThrusterController, 0, 0, 1);
00193 
00207 struct iPcMechanicsThrusterController : public iBase
00208 {
00213   virtual void SetMechanicsObject (iPcMechanicsObject* mechobj) = 0;
00214 
00218   virtual iPcMechanicsObject* GetMechanicsObject () = 0;
00219 
00229   virtual void AddAxis (const char* name, celAxisType type, const
00230         csVector3 axis) = 0;
00231 
00236   virtual const csVector3 GetAxis (const char* name) = 0;
00237 
00242   virtual const celAxisType GetAxisType (const char* name) = 0;
00243 
00248   virtual const float GetAxisVelocity (const char* name) = 0;
00249 
00254   virtual float GetAxisMaxForce (const char* name) = 0;
00255 
00261   virtual float GetAxisMaxThrust (const char* name) = 0;
00262 
00268   virtual void AddBalancedGroup (iPcMechanicsBalancedGroup* group,
00269         const char* axisname) = 0;
00270 
00276   virtual void RemoveBalancedGroup (const char* grouptag, const char*
00277         axisname) = 0;
00278 
00285   virtual void ApplyThrust (float thrust, const char* axisname,
00286         uint32& id) = 0;
00287 
00292   virtual void CancelThrust (uint32 id) = 0;
00293 };
00294 
00295 #endif //__CEL_PF_MECHANICS_THRUSTER__

Generated for CEL: Crystal Entity Layer by doxygen 1.4.7