VR-Vantage 2.3 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtCamera.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2017 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 #pragma once
10 
19 
20 namespace makVrv{
21 
23  {
30  };
31 
33  {
35  };
36 
39  template <class T>
40  class DtCamera
41  {
42  public:
44  DtCamera();
46  virtual ~DtCamera();
47 
48  void setNearPlane(T fNearPlane);
49  T nearPlane(void) const;
50 
51  void setFarPlane(T fFarPlane);
52  T farPlane(void) const;
53 
55  void setFieldOfView(T fFOVy);
56  T fieldOfView(void) const;
57 
58  void setPosition(const DtVector3<T>& vPosition);
59  DtVector3<T> position(void) const;
60 
61  void setDirection(const DtVector3<T>& vDirection);
62  DtVector3<T> direction(void) const;
63 
64  DtVector3<T> upVector(void) const;
65  DtVector3<T> sideVector(void) const;
66 
68  void lookAt(const DtVector3<T>& vEye,const DtVector3<T>& vLook,const DtVector3<T>& vUp);
70  const DtMatrix4<T>& ViewMatrix(void) const;
71 
73  void SetPerspective(T fFOVy, T fAspectRatio, T fNearPlane, T fFarPlane);
75  const DtMatrix4<T>& ProjectionMatrix(void) const;
76 
78  const DtMatrix4<T>& ViewProjectionMatrix(void) const;
79 
80  void setFixedUpVector(bool fixed);
81  bool isFixedUpVector(void) const;
82 
84  T aspectRatio(void) const;
85 
87  bool IsVisible(const DtAxisAlignedBoundingBox<T>& box) const;
88 
91 
94  , const Vector2_uint32& viewPortSize) const;
95  private:
100 
105 
109 
111 
113  void updateFrustumPlanes(void);
114  void updateViewProjectionMatrix(void);
115  };
116 
117  template <class T>
119  {
120  public:
122  static DtVector2<T> project(const DtVector3<T>& vPosition
123  , const DtMatrix4<T>& view_projection_matrix);
124 
128  static Vector2_uint32 project(const DtVector3<T>& vPosition
129  , const DtMatrix4<T>& view_projection_matrix
130  , const Vector2_uint32& viewPortSize);
131 
134  , const DtMatrix4<T>& view_projection_matrix
135  , const Vector2_uint32& viewPortSize);
136 
137  };
138 
139 
142  template <class T>
143  class Frustum
144  {
145  public:
146  Frustum();
147  virtual ~Frustum();
148 
149  void SetPlane(FrustumPlane plane, T d, const DtVector3<T>& vNormal);
150  const DtPlane<T>& GetPlane(FrustumPlane plane);
151 
152  bool IsVisible(const DtAxisAlignedBoundingBox<T>& box) const;
154 
155  private:
156  std::vector< DtPlane<T> > m_FrustumPlanes;
157  };
158 
159 } //namespace makVrv
160 
161 #include "DtCamera.inl"


Copyright © 2005-2018 VT MAK. All Rights Reserved (www.mak.com)