Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::Frame Struct Reference

Stores a three-dimensional orthonormal coordinate frame. More...

#include <mitsuba/core/frame.h>

Public Member Functions

 Frame ()
 Default constructor – performs no initialization! More...
 
 Frame (const Vector &s, const Vector &t, const Normal &n)
 Given a normal and tangent vectors, construct a new coordinate frame. More...
 
 Frame (const Vector &x, const Vector &y, const Vector &z)
 Construct a frame from the given orthonormal vectors. More...
 
 Frame (const Vector &n)
 Construct a new coordinate frame from a single vector. More...
 
 Frame (Stream *stream)
 Unserialize from a binary data stream. More...
 
void serialize (Stream *stream) const
 Serialize to a binary data stream. More...
 
Vector toLocal (const Vector &v) const
 Convert from world coordinates to local coordinates. More...
 
Vector toWorld (const Vector &v) const
 Convert from local coordinates to world coordinates. More...
 
bool operator== (const Frame &frame) const
 Equality test. More...
 
bool operator!= (const Frame &frame) const
 Inequality test. More...
 
std::string toString () const
 Return a string representation of this frame. More...
 

Static Public Member Functions

static Float cosTheta2 (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the squared cosine of the angle between the normal and v. More...
 
static Float cosTheta (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the cosine of the angle between the normal and v. More...
 
static Vector2 uv (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the u and v coordinates of the vector 'v'. More...
 
static Float sinTheta2 (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the squared sine of the angle between the normal and v. More...
 
static Float sinTheta (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the sine of the angle between the normal and v. More...
 
static Float tanTheta (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the tangent of the angle between the normal and v. More...
 
static Float tanTheta2 (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the squared tangent of the angle between the normal and v. More...
 
static Float sinPhi (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the sine of the phi parameter in spherical coordinates. More...
 
static Float cosPhi (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the cosine of the phi parameter in spherical coordinates. More...
 
static Float sinPhi2 (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the squared sine of the phi parameter in spherical coordinates. More...
 
static Float cosPhi2 (const Vector &v)
 Assuming that the given direction is in the local coordinate system, return the squared cosine of the phi parameter in spherical coordinates. More...
 

Public Attributes

Vector s
 
Vector t
 
Normal n
 

Detailed Description

Stores a three-dimensional orthonormal coordinate frame.

This class is mostly used to quickly convert between different cartesian coordinate systems and to efficiently compute certain quantities (e.g. cosTheta(), tanTheta, ..).

Constructor & Destructor Documentation

mitsuba::Frame::Frame ( )
inline

Default constructor – performs no initialization!

mitsuba::Frame::Frame ( const Vector s,
const Vector t,
const Normal n 
)
inline

Given a normal and tangent vectors, construct a new coordinate frame.

mitsuba::Frame::Frame ( const Vector x,
const Vector y,
const Vector z 
)
inline

Construct a frame from the given orthonormal vectors.

mitsuba::Frame::Frame ( const Vector n)
inline

Construct a new coordinate frame from a single vector.

mitsuba::Frame::Frame ( Stream stream)
inline

Unserialize from a binary data stream.

Member Function Documentation

static Float mitsuba::Frame::cosPhi ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the cosine of the phi parameter in spherical coordinates.

static Float mitsuba::Frame::cosPhi2 ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the squared cosine of the phi parameter in spherical coordinates.

static Float mitsuba::Frame::cosTheta ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the cosine of the angle between the normal and v.

static Float mitsuba::Frame::cosTheta2 ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the squared cosine of the angle between the normal and v.

bool mitsuba::Frame::operator!= ( const Frame frame) const
inline

Inequality test.

bool mitsuba::Frame::operator== ( const Frame frame) const
inline

Equality test.

void mitsuba::Frame::serialize ( Stream stream) const
inline

Serialize to a binary data stream.

static Float mitsuba::Frame::sinPhi ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the sine of the phi parameter in spherical coordinates.

static Float mitsuba::Frame::sinPhi2 ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the squared sine of the phi parameter in spherical coordinates.

static Float mitsuba::Frame::sinTheta ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the sine of the angle between the normal and v.

static Float mitsuba::Frame::sinTheta2 ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the squared sine of the angle between the normal and v.

static Float mitsuba::Frame::tanTheta ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the tangent of the angle between the normal and v.

static Float mitsuba::Frame::tanTheta2 ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the squared tangent of the angle between the normal and v.

Vector mitsuba::Frame::toLocal ( const Vector v) const
inline

Convert from world coordinates to local coordinates.

std::string mitsuba::Frame::toString ( ) const
inline

Return a string representation of this frame.

Vector mitsuba::Frame::toWorld ( const Vector v) const
inline

Convert from local coordinates to world coordinates.

static Vector2 mitsuba::Frame::uv ( const Vector v)
inlinestatic

Assuming that the given direction is in the local coordinate system, return the u and v coordinates of the vector 'v'.

Member Data Documentation

Normal mitsuba::Frame::n
Vector mitsuba::Frame::s
Vector mitsuba::Frame::t

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