#include "gcl/VecUtil.h"
Include dependency graph for VecUtil.cc:
Go to the source code of this file.
Find triangle normal.
Sets n to the (unnormalised) normal of the triangle defined by points a, b and c. Effectively returns the sum of the three possible edge cross-products, for stability. The length of this vector is 2 x the area of the triangle.
Definition at line 35 of file VecUtil.cc.
Test if the point is inside the given triangle.
Given a point lying in the plane of the triangle, we return false if it lies outside the triangle, and its barycentric coordinates if it lies inside.
Definition at line 84 of file VecUtil.cc.
Project p in direction r on to bounding box min/max.
Returns t such that this projected point = p + t * r.
Definition at line 291 of file VecUtil.cc.
Calculates the refraction vector for the given parameters.
Returns true if total internal reflection occurs.
Definition at line 13 of file VecUtil.cc.
Unit disk to unit square transform from Shirley & Chiu.
Definition at line 248 of file VecUtil.cc.
Unit square to unit disk transform from Shirley & Chiu.
phi = pi/2 -----*----- |\ /| | \ 2 / | | \ / | phi=pi* 3 * 1 *phi = 0 | / \ | | / 4 \ | |/ \| -----*----- phi = 3pi/2
Definition at line 179 of file VecUtil.cc.
returns a view matrix for a view in the direction of dir, assuming v_up = z axis.
Definition at line 161 of file VecUtil.cc.
Definition at line 72 of file VecUtil.cc.
Definition at line 75 of file VecUtil.cc.
Definition at line 78 of file VecUtil.cc.
Definition at line 82 of file VecUtil.cc.