#include <WCamera.hpp>
|
| virtual std::string | GetTypeName () const override |
| |
| virtual void | SetID (uint32_t newID) override |
| |
| virtual void | SetName (std::string newName) override |
| |
|
| WCamera (Wasabi *const app, uint32_t ID=0) |
| |
| void | OnStateChange (STATE_CHANGE_TYPE type) override |
| |
| void | UpdateInternals () |
| |
| void | EnableAutoAspect () |
| |
| void | DisableAutoAspect () |
| |
| void | SetRange (float min, float max) |
| |
| void | SetFOV (float fValue) |
| |
| void | SetAspect (float aspect) |
| |
| void | SetProjectionType (W_PROJECTIONTYPE type) |
| |
| void | Render (uint32_t width, uint32_t height) |
| |
| WMatrix | GetViewMatrix () const |
| |
| WMatrix | GetProjectionMatrix (bool bForceOrtho=false) const |
| |
| float | GetMinRange () const |
| |
| float | GetMaxRange () const |
| |
| float | GetFOV () const |
| |
| float | GetAspect () const |
| |
| bool | CheckPointInFrustum (float x, float y, float z) const |
| |
| bool | CheckPointInFrustum (WVector3 point) const |
| |
| bool | CheckCubeInFrustum (float x, float y, float z, float radius) const |
| |
| bool | CheckCubeInFrustum (WVector3 pos, float radius) const |
| |
| bool | CheckSphereInFrustum (float x, float y, float z, float radius) const |
| |
| bool | CheckSphereInFrustum (WVector3 pos, float radius) const |
| |
| bool | CheckBoxInFrustum (float x, float y, float z, float xSize, float ySize, float zSize) const |
| |
| bool | CheckBoxInFrustum (WVector3 pos, WVector3 size) const |
| |
| virtual bool | Valid () const override |
| |
|
| WBase (class Wasabi *const app, uint32_t ID=0) |
| |
| uint32_t | GetID () const |
| |
| std::string | GetName () const |
| |
| class Wasabi * | GetAppPtr () const |
| |
| void | AddReference () |
| |
| void | RemoveReference () |
| |
| void | SetPosition (float x, float y, float z) |
| |
| void | SetPosition (const WVector3 pos) |
| |
| void | Point (float x, float y, float z) |
| |
| void | Point (WVector3 target) |
| |
| void | SetAngle (WQuaternion quat) |
| |
| void | SetToRotation (const WOrientation *const device) |
| |
| void | SetULRVectors (WVector3 up, WVector3 look, WVector3 right) |
| |
| void | SetToTransformation (WMatrix mtx) |
| |
| void | Yaw (float angle) |
| |
| void | Roll (float angle) |
| |
| void | Pitch (float angle) |
| |
| void | Move (float units) |
| |
| void | Strafe (float units) |
| |
| void | Fly (float units) |
| |
| float | GetPositionX () const |
| |
| float | GetPositionY () const |
| |
| float | GetPositionZ () const |
| |
| WVector3 | GetPosition () const |
| |
| float | GetAngleX () const |
| |
| float | GetAngleY () const |
| |
| float | GetAngleZ () const |
| |
| WQuaternion | GetRotation () const |
| |
| WVector3 | GetUVector () const |
| |
| WVector3 | GetLVector () const |
| |
| WVector3 | GetRVector () const |
| |
| virtual void | SetBindingMatrix (WMatrix mtx) |
| |
| void | RemoveBinding () |
| |
| WMatrix | GetBindingMatrix () const |
| |
| bool | IsBound () const |
| |
| WMatrix | ComputeTransformation () const |
| |
| WMatrix | ComputeInverseTransformation () const |
| |
This implements a camera in Wasabi.
◆ _GetTypeName()
| static std::string WCamera::_GetTypeName |
( |
| ) |
|
|
static |
Returns "Camera" string.
- Returns
- Returns "Camera" string
◆ CheckBoxInFrustum() [1/2]
| bool WCamera::CheckBoxInFrustum |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
xSize, |
|
|
float |
ySize, |
|
|
float |
zSize |
|
) |
| const |
Checks if a given box is in the viewing frustum of the camera
- Parameters
-
| x | Box center x |
| y | Box center y |
| z | Box center z |
| xSize | Box dimension x from the center to the edge |
| ySize | Box dimension y from the center to the edge |
| zSize | Box dimension z from the center to the edge |
- Returns
- true if the box is in the viewing frustum, false otherwise
◆ CheckBoxInFrustum() [2/2]
Checks if a given box is in the viewing frustum of the camera
- Parameters
-
| pos | Box center |
| size | Box dimensions from the center to each edge |
- Returns
- true if the box is in the viewing frustum, false otherwise
◆ CheckCubeInFrustum() [1/2]
| bool WCamera::CheckCubeInFrustum |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
radius |
|
) |
| const |
Checks if a given cube is in the viewing frustum of the camera.
- Parameters
-
| x | Cube center x |
| y | Cube center y |
| z | Cube center z |
| radius | Cube diagonal (distance from the center to a corner) |
- Returns
- true if the cube is in the viewing frustum, false otherwise
◆ CheckCubeInFrustum() [2/2]
| bool WCamera::CheckCubeInFrustum |
( |
WVector3 |
pos, |
|
|
float |
radius |
|
) |
| const |
Checks if a given cube is in the viewing frustum of the camera.
- Parameters
-
| pos | Cube center |
| radius | Cube diagonal (distance from the center to a corner) |
- Returns
- true if the cube is in the viewing frustum, false otherwise
◆ CheckPointInFrustum() [1/2]
| bool WCamera::CheckPointInFrustum |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| const |
Checks if a given point is in the viewing frustum of the camera.
- Parameters
-
| x | Point x |
| y | Point y |
| z | Point z |
- Returns
- true if (x, y, z) is in the viewing frustum, false otherwise
◆ CheckPointInFrustum() [2/2]
| bool WCamera::CheckPointInFrustum |
( |
WVector3 |
point | ) |
const |
Checks if a given point is in the viewing frustum of the camera.
- Parameters
-
- Returns
- true if point is in the viewing frustum, false otherwise
◆ CheckSphereInFrustum() [1/2]
| bool WCamera::CheckSphereInFrustum |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z, |
|
|
float |
radius |
|
) |
| const |
Checks if a given sphere is in the viewing frustum of the camera.
- Parameters
-
| x | Sphere center x |
| y | Sphere center y |
| z | Sphere center z |
| radius | Sphere radius |
- Returns
- true if the sphere is in the viewing frustum, false otherwise
◆ CheckSphereInFrustum() [2/2]
| bool WCamera::CheckSphereInFrustum |
( |
WVector3 |
pos, |
|
|
float |
radius |
|
) |
| const |
Checks if a given sphere is in the viewing frustum of the camera.
- Parameters
-
| pos | Sphere center |
| radius | Sphere radius |
- Returns
- true if the sphere is in the viewing frustum, false otherwise
◆ DisableAutoAspect()
| void WCamera::DisableAutoAspect |
( |
| ) |
|
Enables auto aspect ratio calculation when the window/viewport size changes. Auto aspect ratio is calculated as viewport_width / viewport_height.
◆ EnableAutoAspect()
| void WCamera::EnableAutoAspect |
( |
| ) |
|
Enables auto aspect ratio calculation when the window/viewport size changes. Auto aspect ratio is calculated as viewport_width / viewport_height.
◆ GetAspect()
| float WCamera::GetAspect |
( |
| ) |
const |
Retrieves the aspect ratio.
- Returns
- Aspect ratio
◆ GetFOV()
| float WCamera::GetFOV |
( |
| ) |
const |
Retrieves the FOV (field of view).
- Returns
- FOV (field of view) in degrees
◆ GetMaxRange()
| float WCamera::GetMaxRange |
( |
| ) |
const |
Retrieves the maximum draw distance.
- Returns
- Maximum draw distance
◆ GetMinRange()
| float WCamera::GetMinRange |
( |
| ) |
const |
Retrieves the minimum draw distance.
- Returns
- Minimum draw distance
◆ GetProjectionMatrix()
| WMatrix WCamera::GetProjectionMatrix |
( |
bool |
bForceOrtho = false | ) |
const |
Retrieves the current projection matrix
- Returns
- Current projection matrix Retrieves the current projection matrix
- Parameters
-
| bForceOrtho | If set to true, the returned projection matrix will be forcefully set to use PROJECTION_ORTHOGONAL for this call |
- Returns
- Current projection matrix
◆ GetTypeName()
| virtual std::string WCamera::GetTypeName |
( |
| ) |
const |
|
overridevirtual |
This function must be implemented by a child class. This is used for debugging, in which a class should return its name.
- Returns
- The name of the class
Implements WBase.
◆ GetViewMatrix()
| WMatrix WCamera::GetViewMatrix |
( |
| ) |
const |
Retrieves the current view matrix
- Returns
- Current view matrix
◆ OnStateChange()
This is a callback (inherited from WOrientation) to inform this object of a change in orientation.
- Parameters
-
| type | Orientation change type (rotation or motion) |
Reimplemented from WOrientation.
◆ Render()
| void WCamera::Render |
( |
uint32_t |
width, |
|
|
uint32_t |
height |
|
) |
| |
Prepares the camera such that its' matrices can be used to perform transformations such as object rendering.
- Parameters
-
| width | Width of the rendering viewport |
| height | Height of the rendering viewport |
◆ SetAspect()
| void WCamera::SetAspect |
( |
float |
aspect | ) |
|
Sets the aspect ratio. If auto aspect ratio is enabled, this will be overridden on the next UpdateInternals() or Render().
- Parameters
-
◆ SetFOV()
| void WCamera::SetFOV |
( |
float |
fValue | ) |
|
Set the FOV (field of view) for the camera.
- Parameters
-
| fValue | New field of view, in degrees |
◆ SetID()
| virtual void WCamera::SetID |
( |
uint32_t |
newID | ) |
|
|
overridevirtual |
Sets the ID of this object and notifies its manager.
- Parameters
-
Implements WBase.
◆ SetName()
| virtual void WCamera::SetName |
( |
std::string |
newName | ) |
|
|
overridevirtual |
Sets the name of this object.
- Parameters
-
| name | New name for the object |
Implements WBase.
◆ SetProjectionType()
Sets the projection type for this camera.
- Parameters
-
◆ SetRange()
| void WCamera::SetRange |
( |
float |
min, |
|
|
float |
max |
|
) |
| |
Sets the range in which the camera can see. The camera cannot render closer to it than min and farther to it than max.
- Parameters
-
| min | minimum draw distance |
| max | maximum draw distance |
◆ UpdateInternals()
| void WCamera::UpdateInternals |
( |
| ) |
|
Update the matrices to match the latest changes. This is automatically called during rendering of a camera.
◆ Valid()
| virtual bool WCamera::Valid |
( |
| ) |
const |
|
overridevirtual |
Checks if the camera is valid (always true).
- Returns
- true
Implements WBase.
The documentation for this class was generated from the following file: