Hermes
normal.h File Reference

Geometric normal classes. More...

Go to the source code of this file.

Classes

class  hermes::Normal2< T >
 Geometric 2-dimensional normal (nx, ny) More...
 
class  hermes::Normal3< T >
 Geometric 3-dimensional normal (nx, ny, nz) More...
 

Typedefs

using hermes::normal2 = Normal2< real_t >
 
using hermes::normal2f = Normal2< float >
 
using hermes::normal2d = Normal2< double >
 
using hermes::normal3 = Normal3< real_t >
 
using hermes::normal3f = Normal3< float >
 
using hermes::normal3d = Normal3< double >
 

Functions

template<typename T >
HERMES_DEVICE_CALLABLE Vector2< T > hermes::reflect (const Vector2< T > &a, const Normal2< T > &n)
 reflects a on n More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Vector2< T > hermes::project (const Vector2< T > &v, const Normal2< T > &n)
 projects v on the surface with normal n More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Normal3< T > hermes::normalize (const Normal3< T > &normal)
 Computes normalized copy. More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Normal3< T > hermes::abs (const Normal3< T > &normal)
 Computes absolute normal components. More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Vector3< T > hermes::reflect (const Vector3< T > &a, const Normal3< T > &n)
 reflects a on n More...
 
template<typename S >
HERMES_DEVICE_CALLABLE Vector3< S > hermes::project (const Vector3< S > &v, const Normal3< S > &n)
 projects v on the surface with normal n More...
 
template<typename T >
HERMES_DEVICE_CALLABLEhermes::dot (const Normal3< T > &n, const Vector3< T > &v)
 Computes dot product with vector. More...
 
template<typename T >
HERMES_DEVICE_CALLABLEhermes::dot (const Vector3< T > &v, const Normal3< T > &n)
 Computes dot product with vector. More...
 
template<typename T >
HERMES_DEVICE_CALLABLE Vector3< T > hermes::faceForward (const Vector3< T > &v, const Normal3< T > &n)
 
template<typename T >
std::ostream & hermes::operator<< (std::ostream &os, const Normal2< T > &n)
 Normal's support for std::ostream::<< operator. More...
 
template<typename T >
std::ostream & hermes::operator<< (std::ostream &os, const Normal3< T > &n)
 Normal's support for std::ostream::<< operator. More...
 

Detailed Description

Geometric normal classes.

Copyright (c) 2017, FilipeCN.

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
FilipeCN (filip.nosp@m.edec.nosp@m.n@gma.nosp@m.il.c.nosp@m.om)
Date
2017-08-18

Function Documentation

◆ abs()

template<typename T >
HERMES_DEVICE_CALLABLE Normal3<T> hermes::abs ( const Normal3< T > &  normal)

Computes absolute normal components.

Template Parameters
T
Parameters
normal
Returns

◆ dot() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::dot ( const Normal3< T > &  n,
const Vector3< T > &  v 
)

Computes dot product with vector.

Template Parameters
T
Parameters
n
v
Returns

◆ dot() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE T hermes::dot ( const Vector3< T > &  v,
const Normal3< T > &  n 
)

Computes dot product with vector.

Template Parameters
T
Parameters
v
n
Returns

◆ faceForward()

template<typename T >
HERMES_DEVICE_CALLABLE Vector3<T> hermes::faceForward ( const Vector3< T > &  v,
const Normal3< T > &  n 
)
Template Parameters
T
Parameters
v
n
Returns
v if is oriented along with n, -v otherwise

◆ normalize()

template<typename T >
HERMES_DEVICE_CALLABLE Normal3<T> hermes::normalize ( const Normal3< T > &  normal)

Computes normalized copy.

Template Parameters
T
Parameters
normal
Returns

◆ operator<<() [1/2]

template<typename T >
std::ostream& hermes::operator<< ( std::ostream &  os,
const Normal2< T > &  n 
)

Normal's support for std::ostream::<< operator.

Template Parameters
T
Parameters
os
n
Returns

◆ operator<<() [2/2]

template<typename T >
std::ostream& hermes::operator<< ( std::ostream &  os,
const Normal3< T > &  n 
)

Normal's support for std::ostream::<< operator.

Template Parameters
T
Parameters
os
n
Returns

◆ project() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE Vector2<T> hermes::project ( const Vector2< T > &  v,
const Normal2< T > &  n 
)

projects v on the surface with normal n

Parameters
vvector
nsurface's normal
Returns
projected v

◆ project() [2/2]

template<typename S >
HERMES_DEVICE_CALLABLE Vector3<S> hermes::project ( const Vector3< S > &  v,
const Normal3< S > &  n 
)

projects v on the surface with normal n

Parameters
vvector
nsurface's normal
Returns
projected v

◆ reflect() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE Vector2<T> hermes::reflect ( const Vector2< T > &  a,
const Normal2< T > &  n 
)

reflects a on n

Parameters
avector to be reflected
naxis of reflection
Returns
reflected a

◆ reflect() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE Vector3<T> hermes::reflect ( const Vector3< T > &  a,
const Normal3< T > &  n 
)

reflects a on n

Parameters
avector to be reflected
naxis of reflection
Returns
reflected a