FIFE
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
FIFE::PointType3D< T > Class Template Reference

A 3D Point. More...

#include <point.h>

+ Inheritance diagram for FIFE::PointType3D< T >:
+ Collaboration diagram for FIFE::PointType3D< T >:

Public Member Functions

 PointType3D (T _x=0, T _y=0, T _z=0)
 Constructor. More...
 
 PointType3D (const PointType3D< T > &rhs)
 Copy Constructor. More...
 
PointType3D< T > operator+ (const PointType3D< T > &p) const
 Vector addition. More...
 
PointType3D< T > operator- (const PointType3D< T > &p) const
 Vector substraction. More...
 
PointType3D< T > & operator+= (const PointType3D< T > &p)
 Vector inplace addition. More...
 
PointType3D< T > & operator-= (const PointType3D< T > &p)
 Vector inplace substraction. More...
 
PointType3D< T > operator* (const T &i) const
 Scalar multiplication with an integer value. More...
 
PointType3D< T > operator/ (const T &i) const
 Scalar division with an integer value. More...
 
bool operator== (const PointType3D< T > &p) const
 Equality comparision. More...
 
bool operator!= (const PointType3D< T > &p) const
 Equality comparision. More...
 
length () const
 Return length. More...
 
void normalize ()
 Normalizes the point. More...
 
void set (T _x, T _y, T _z)
 Sets the x, y and z coordinates of the 3D point. More...
 
T & operator[] (int32_t ind)
 

Public Attributes

union {
   T   val [3]
 
   struct {
      T   x
 
      T   y
 
      T   z
 
   } 
 
}; 
 

Detailed Description

template<typename T>
class FIFE::PointType3D< T >

A 3D Point.

This is a small helper class to aid in 3d vector arithmetics.

See Also
Rect

Definition at line 202 of file point.h.

Constructor & Destructor Documentation

template<typename T>
FIFE::PointType3D< T >::PointType3D ( _x = 0,
_y = 0,
_z = 0 
)
inlineexplicit

Constructor.

Creates a with 0 as default values.

Definition at line 215 of file point.h.

template<typename T>
FIFE::PointType3D< T >::PointType3D ( const PointType3D< T > &  rhs)
inline

Copy Constructor.

Definition at line 220 of file point.h.

Member Function Documentation

template<typename T>
T FIFE::PointType3D< T >::length ( ) const
inline

Return length.

Definition at line 280 of file point.h.

Referenced by FIFE::PointType3D< double >::normalize().

+ Here is the caller graph for this function:

template<typename T>
void FIFE::PointType3D< T >::normalize ( )
inline

Normalizes the point.

Definition at line 288 of file point.h.

template<typename T>
bool FIFE::PointType3D< T >::operator!= ( const PointType3D< T > &  p) const
inline

Equality comparision.

Definition at line 274 of file point.h.

template<typename T>
PointType3D<T> FIFE::PointType3D< T >::operator* ( const T &  i) const
inline

Scalar multiplication with an integer value.

Definition at line 255 of file point.h.

template<typename T>
PointType3D<T> FIFE::PointType3D< T >::operator+ ( const PointType3D< T > &  p) const
inline

Vector addition.

Definition at line 225 of file point.h.

template<typename T>
PointType3D<T>& FIFE::PointType3D< T >::operator+= ( const PointType3D< T > &  p)
inline

Vector inplace addition.

Definition at line 237 of file point.h.

template<typename T>
PointType3D<T> FIFE::PointType3D< T >::operator- ( const PointType3D< T > &  p) const
inline

Vector substraction.

Definition at line 231 of file point.h.

template<typename T>
PointType3D<T>& FIFE::PointType3D< T >::operator-= ( const PointType3D< T > &  p)
inline

Vector inplace substraction.

Definition at line 246 of file point.h.

template<typename T>
PointType3D<T> FIFE::PointType3D< T >::operator/ ( const T &  i) const
inline

Scalar division with an integer value.

Definition at line 261 of file point.h.

template<typename T>
bool FIFE::PointType3D< T >::operator== ( const PointType3D< T > &  p) const
inline

Equality comparision.

Definition at line 267 of file point.h.

template<typename T>
T& FIFE::PointType3D< T >::operator[] ( int32_t  ind)
inline

Definition at line 312 of file point.h.

template<typename T>
void FIFE::PointType3D< T >::set ( _x,
_y,
_z 
)
inline

Sets the x, y and z coordinates of the 3D point.

Definition at line 306 of file point.h.

Member Data Documentation

union { ... }
template<typename T>
T FIFE::PointType3D< T >::val[3]

Definition at line 205 of file point.h.

Referenced by FIFE::PointType3D< double >::operator[]().

template<typename T>
T FIFE::PointType3D< T >::x

Definition at line 207 of file point.h.

Referenced by FIFE::CellCache::addCell(), FIFE::InstanceTree::addInstance(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::CellCache::calculateCurrentSize(), FIFE::CellCache::CellCache(), FIFE::CellCache::convertCoordToInt(), FIFE::CellCache::createCell(), FIFE::Layer::createInstance(), FIFE::doublePt2intPt(), FIFE::InstanceTree::findInstances(), FIFE::RoutePather::followRoute(), FIFE::CellGrid::getAccessibleCoordinates(), FIFE::SquareGrid::getAdjacentCost(), FIFE::getAngleBetween(), FIFE::RendererNode::getCalculatedPoint(), FIFE::CellCache::getCell(), FIFE::Location::getCellOffsetDistance(), FIFE::CellCache::getCellsInCircle(), FIFE::CellCache::getCellsInLine(), FIFE::CellCache::getCellsInRect(), FIFE::getFacing(), FIFE::HexGrid::getHeuristicCost(), FIFE::SquareGrid::getHeuristicCost(), FIFE::Location::getLayerDistanceTo(), FIFE::Camera::getLayerViewPort(), FIFE::Location::getMapDistanceTo(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::Map::getMinMaxCoordinates(), FIFE::Layer::getMinMaxCoordinates(), FIFE::Camera::getOriginalZToY(), FIFE::Camera::getRealCellDimensions(), FIFE::HexGrid::getVertices(), FIFE::SquareGrid::getVertices(), FIFE::Camera::getZOffset(), FIFE::Instance::Instance(), FIFE::intPt2doublePt(), FIFE::HexGrid::isAccessible(), FIFE::SquareGrid::isAccessible(), FIFE::CellCache::isInCellCache(), FIFE::PointType3D< double >::length(), FIFE::RoutePather::locationsEqual(), FIFE::PointType3D< double >::normalize(), FIFE::PointType3D< double >::operator!=(), FIFE::InstanceDistanceSortLocation::operator()(), FIFE::Matrix< double >::operator*(), FIFE::PointType3D< double >::operator*(), FIFE::PointType3D< double >::operator+(), FIFE::PointType3D< double >::operator+=(), FIFE::PointType3D< double >::operator-(), FIFE::PointType3D< double >::operator-=(), FIFE::PointType3D< double >::operator/(), FIFE::operator<<(), FIFE::Location::operator=(), FIFE::PointType3D< double >::operator==(), FIFE::CellGrid::orientation(), FIFE::Cell::removeInstance(), FIFE::GridRenderer::render(), FIFE::CoordinateRenderer::render(), FIFE::CellSelectionRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::CellRenderer::render(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::Location::reset(), FIFE::CellCache::resize(), FIFE::MapSaver::save(), FIFE::PointType3D< double >::set(), FIFE::HexGrid::toExactLayerCoordinates(), FIFE::SquareGrid::toLayerCoordinates(), FIFE::HexGrid::toLayerCoordinates(), FIFE::HexGrid::toMapCoordinates(), FIFE::SquareGrid::toMultiCoordinates(), FIFE::HexGrid::toMultiCoordinates(), FIFE::LayerCache::update(), FIFE::Camera::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::Instance::updateMultiInstances(), FIFE::LayerCache::updatePosition(), FIFE::RenderVisitor::visit(), and FIFE::InstanceListCollector::visit().

template<typename T>
T FIFE::PointType3D< T >::y

Definition at line 207 of file point.h.

Referenced by FIFE::CellCache::addCell(), FIFE::InstanceTree::addInstance(), FIFE::Cell::addInstance(), FIFE::Cell::addInstances(), FIFE::CoordinateRenderer::adjustLayerArea(), FIFE::CellCache::calculateCurrentSize(), FIFE::Camera::calculateZValue(), FIFE::CellCache::CellCache(), FIFE::CellCache::convertCoordToInt(), FIFE::CellCache::createCell(), FIFE::Layer::createInstance(), FIFE::doublePt2intPt(), FIFE::InstanceTree::findInstances(), FIFE::RoutePather::followRoute(), FIFE::CellGrid::getAccessibleCoordinates(), FIFE::SquareGrid::getAdjacentCost(), FIFE::getAngleBetween(), FIFE::RendererNode::getCalculatedPoint(), FIFE::CellCache::getCell(), FIFE::Location::getCellOffsetDistance(), FIFE::CellCache::getCellsInCircle(), FIFE::CellCache::getCellsInLine(), FIFE::CellCache::getCellsInRect(), FIFE::getFacing(), FIFE::HexGrid::getHeuristicCost(), FIFE::SquareGrid::getHeuristicCost(), FIFE::Location::getLayerDistanceTo(), FIFE::Camera::getLayerViewPort(), FIFE::Location::getMapDistanceTo(), FIFE::Camera::getMapViewPort(), FIFE::Camera::getMatchingInstances(), FIFE::Map::getMinMaxCoordinates(), FIFE::Layer::getMinMaxCoordinates(), FIFE::Camera::getOriginalZToY(), FIFE::Camera::getRealCellDimensions(), FIFE::HexGrid::getVertices(), FIFE::SquareGrid::getVertices(), FIFE::Camera::getZOffset(), FIFE::Instance::Instance(), FIFE::intPt2doublePt(), FIFE::HexGrid::isAccessible(), FIFE::SquareGrid::isAccessible(), FIFE::CellCache::isInCellCache(), FIFE::PointType3D< double >::length(), FIFE::RoutePather::locationsEqual(), FIFE::PointType3D< double >::normalize(), FIFE::PointType3D< double >::operator!=(), FIFE::InstanceDistanceSortLocation::operator()(), FIFE::Matrix< double >::operator*(), FIFE::PointType3D< double >::operator*(), FIFE::PointType3D< double >::operator+(), FIFE::PointType3D< double >::operator+=(), FIFE::PointType3D< double >::operator-(), FIFE::PointType3D< double >::operator-=(), FIFE::PointType3D< double >::operator/(), FIFE::operator<<(), FIFE::Location::operator=(), FIFE::PointType3D< double >::operator==(), FIFE::CellGrid::orientation(), FIFE::Cell::removeInstance(), FIFE::GridRenderer::render(), FIFE::CoordinateRenderer::render(), FIFE::CellSelectionRenderer::render(), FIFE::BlockingInfoRenderer::render(), FIFE::CellRenderer::render(), FIFE::InstanceRenderer::renderAlreadySorted(), FIFE::Location::reset(), FIFE::CellCache::resize(), FIFE::MapSaver::save(), FIFE::PointType3D< double >::set(), FIFE::HexGrid::toExactLayerCoordinates(), FIFE::SquareGrid::toLayerCoordinates(), FIFE::HexGrid::toLayerCoordinates(), FIFE::HexGrid::toMapCoordinates(), FIFE::SquareGrid::toMultiCoordinates(), FIFE::HexGrid::toMultiCoordinates(), FIFE::LayerCache::update(), FIFE::Camera::update(), FIFE::Cell::updateCellFowInfo(), FIFE::Camera::updateMatrices(), FIFE::Instance::updateMultiInstances(), FIFE::LayerCache::updatePosition(), FIFE::RenderVisitor::visit(), and FIFE::InstanceListCollector::visit().

template<typename T>
T FIFE::PointType3D< T >::z

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