| ## Public API Reference

- Main Page
- Classes
- Files

# propclass/newcamera.h

    00001 /*
    00002     Crystal Space Entity Layer
    00003     Copyright (C) 2001 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., 675 Mass Ave, Cambridge, MA 02139, USA.
    00018 */
    00019
    00020 #ifndef __CEL_PF_NEW_CAMERA__
    00021 #define __CEL_PF_NEW_CAMERA__
    00022
    00023 #include "cstypes.h"
    00024 #include "iutil/comp.h"
    00025 #include "iutil/eventh.h"
    00026 #include "csutil/scf.h"
    00027 #include "csutil/weakref.h"
    00028 #include "csutil/weakrefarr.h"
    00029 #include "csutil/refarr.h"
    00030 #include "physicallayer/propclas.h"
    00031 #include "physicallayer/propfact.h"
    00032 #include "physicallayer/facttmpl.h"
    00033 #include "celtool/stdpcimp.h"
    00034 #include "celtool/stdparams.h"
    00035 #include "celtool/camera.h"
    00036 #include "propclass/region.h"
    00037 #include "propclass/mesh.h"
    00038
    00039 struct iCelEntity;
    00040 struct iObjectRegistry;
    00041 struct iGraphics3D;
    00042 struct iEngine;
    00043 struct iVirtualClock;
    00044 struct iKeyboardDriver;
    00045 struct iMouseDriver;
    00046 struct iCollideSystem;
    00047 struct iView;
    00048 class csView;
    00049 class celPcNewCamera;
    00050 class csReversibleTransform;
    00051 struct iPcZoneManager;
    00052
    00053 struct iPcNewCamera;
    00054
    00055 struct iCelCameraMode
    00056 {
    00060   virtual void SetParentCamera(iPcNewCamera * camera) = 0;
    00061
    00065   virtual bool UseSpringPos() const = 0;
    00066
    00070   virtual bool UseSpringTarget() const = 0;
    00071
    00075   virtual bool UseSpringUp() const = 0;
    00076
    00080   virtual bool AllowCollisionDetection() const = 0;
    00081
    00087   virtual bool DrawAttachedMesh() const = 0;
    00088
    00092   virtual float GetSpringCoefficient() const = 0;
    00093
    00097   virtual const csVector3 & GetPosition() const = 0;
    00098
    00102   virtual const csVector3 & GetTarget() const = 0;
    00103
    00107   virtual const csVector3 & GetUp() const = 0;
    00108
    00113   virtual bool DecideCameraState() = 0;
    00114 };
    00115
    00116 SCF_VERSION(iPcNewCamera, 0, 0, 1);
    00120 struct iPcNewCamera : public iPcCamera
    00121 {
    00126   virtual const csVector3 & GetBasePos() const = 0;
    00127
    00132   virtual const csVector3 & GetBaseDir() const = 0;
    00133
    00138   virtual const csVector3 & GetBaseUp() const = 0;
    00139
    00144   virtual const csReversibleTransform & GetBaseTrans() const = 0;
    00145
    00150   virtual const csVector3 & GetPos() const = 0;
    00151
    00156   virtual const csVector3 & GetTarget() const = 0;
    00157
    00162   virtual const csVector3 & GetUp() const = 0;
    00163
    00170   virtual void SetPositionOffset(const csVector3 & offset) = 0;
    00171
    00176   virtual bool DetectCollisions() const = 0;
    00177
    00182   virtual void SetCollisionDetection(bool detectCollisions) = 0;
    00183
    00188   virtual void SetCollisionSpringCoefficient(float springCoef) = 0;
    00189
    00194   virtual float GetCollisionSpringCoefficient() const = 0;
    00195
    00201   virtual bool InCameraTransition() const = 0;
    00202
    00208   virtual void SetTransitionSpringCoefficient(float springCoef) = 0;
    00209
    00215   virtual float GetTransitionSpringCoefficient() const = 0;
    00216
    00224   virtual void SetTransitionCutoffDistance(float cutOffPosDist, float cutOffTargetDist) = 0;
    00225
    00231   virtual float GetTransitionCutoffPosDistance() const = 0;
    00232
    00238   virtual float GetTransitionCutoffTargetDistance() const = 0;
    00239
    00244   virtual size_t AttachCameraMode(iCelCameraMode * mode) = 0;
    00245
    00246   typedef enum _CEL_CAMERA_MODE
    00247   {
    00248     CCM_FIRST_PERSON,
    00249     CCM_THIRD_PERSON,
    00250
    00251     CCM_COUNT
    00252   } CEL_CAMERA_MODE;
    00253
    00258   virtual size_t AttachCameraMode(CEL_CAMERA_MODE mode) = 0;
    00259
    00263   virtual size_t GetCurrentCameraModeIndex() const = 0;
    00264
    00268   virtual iCelCameraMode * GetCurrentCameraMode() = 0;
    00269
    00274   virtual bool SetCurrentCameraMode(size_t modeIndex) = 0;
    00275
    00278   virtual void NextCameraMode() = 0;
    00279
    00282   virtual void PrevCameraMode() = 0;
    00283
    00287   virtual void Draw() = 0;
    00288 };
    00289
    00290 #endif // __CEL_PF_NEW_CAMERA__
    00291