Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Types | Public Member Functions | List of all members
V3DPerspectiveCamera Class Reference

3D Camera with a Perspective View More...

#include <V3DCamera.h>

Inheritance diagram for V3DPerspectiveCamera:
V3DCamera

Public Types

typedef V3DCamera VSUPERCLASS
 Used to call parent class functions when they are overrided in class.
 

Public Member Functions

 V3DPerspectiveCamera (const sf::Vector3f &pos, float fov, float aspectRatio, float zNear=0.1f, float zFar=500.0f)
 
virtual glm::mat4 ProjectionMatrix () const
 
float GetAspectRatio ()
 
void SetAspectRatio (float value)
 
float GetFOV ()
 
void SetFOV (float value)
 
- Public Member Functions inherited from V3DCamera
 V3DCamera (const sf::Vector3f &pos, float zNear=0.1f, float zFar=500.0f)
 
glm::mat4 Orientation () const
 
void LookAt (const sf::Vector3f &pos)
 
glm::mat4 ViewMatrix () const
 
glm::mat4 PVMatrix () const
 
sf::Vector3f Forward () const
 Camera's Forward Vector.
 
sf::Vector3f Right () const
 Camera's Right Vector.
 
sf::Vector3f Up () const
 Camera's Up Vector.
 
virtual bool PointInView (sf::Vector3f p)
 
virtual bool SphereInView (sf::Vector3f p, float radius)
 
virtual bool BoxInView (sf::Vector3f p, sf::Vector3f min, sf::Vector3f max)
 

Additional Inherited Members

- Public Attributes inherited from V3DCamera
sf::Vector3f Position
 The Camera Position.
 
sf::Vector3f Rotation
 The Camera Angle.
 
sf::FloatRect Viewport
 Render Viewport Area to apply a Renderscene.
 
- Protected Types inherited from V3DCamera
enum  FrustumPlane : unsigned char {
  PRIGHT, PLEFT, PTOP, PBOTTOM,
  PNEAR, PFAR
}
 Sides of a Frustum plane for box overlap.
 
- Protected Member Functions inherited from V3DCamera
void normalizeAngles ()
 Normalize the rotation angles.
 
void updatePlanes ()
 Updates the plane coordinates based on the view-projection transform.
 
float pointPlaneDistance (const glm::vec4 &plane, const glm::vec3 &point)
 Works out the distance between a point and plane based on dot-product.
 
- Protected Attributes inherited from V3DCamera
float fnear
 Field Near value.
 
float ffar
 Field Far value.
 
glm::vec4 planes [6]
 The plane coordinates for all six size.
 

Detailed Description

3D Camera with a Perspective View

Constructor & Destructor Documentation

◆ V3DPerspectiveCamera()

V3DPerspectiveCamera::V3DPerspectiveCamera ( const sf::Vector3f &  pos,
float  fov,
float  aspectRatio,
float  zNear = 0.1f,
float  zFar = 500.0f 
)
Parameters
posInitial Camera Position.
fovField of View Angle.
aspectRatioThe Aspect Ratio of the Camera (Width/Height)
zNearThe near z value for the projection matrix.
zFarThe far z value for the projection matrix.

Member Function Documentation

◆ GetAspectRatio()

float V3DPerspectiveCamera::GetAspectRatio ( )
Returns
Current aspect ratio.

◆ GetFOV()

float V3DPerspectiveCamera::GetFOV ( )
Returns
Field of View Angle.

◆ ProjectionMatrix()

virtual glm::mat4 V3DPerspectiveCamera::ProjectionMatrix ( ) const
virtual
Returns
The calculated Projection Matrix of the Camera.

Implements V3DCamera.

◆ SetAspectRatio()

void V3DPerspectiveCamera::SetAspectRatio ( float  value)
Parameters
valueNew aspect ratio.

◆ SetFOV()

void V3DPerspectiveCamera::SetFOV ( float  value)
Parameters
valueNew Field of View Angle.

The documentation for this class was generated from the following file: