Safe Haskell | None |
---|
- structVec3 :: [a] -> [Vec3 a]
- destructVec3 :: [Vec3 a] -> [a]
- det3 :: Floating a => Vec3 a -> Vec3 a -> Vec3 a -> a
- translate3X :: Num a => a -> Vec3 a -> Vec3 a
- translate3Y :: Num a => a -> Vec3 a -> Vec3 a
- translate3Z :: Num a => a -> Vec3 a -> Vec3 a
- vec3X :: Num a => Vec3 a
- vec3Y :: Num a => Vec3 a
- vec3Z :: Num a => Vec3 a
- rotMatrixZ :: Floating a => a -> Mat3 a
- rotMatrixY :: Floating a => a -> Mat3 a
- rotMatrixX :: Floating a => a -> Mat3 a
- rotate3' :: Floating a => a -> Normal3 a -> Vec3 a -> Vec3 a
- rotate3 :: Floating a => a -> Vec3 a -> Vec3 a -> Vec3 a
- rotMatrix3 :: Floating a => Vec3 a -> a -> Mat3 a
- rotMatrixOrtho3 :: Floating a => Vec3 a -> a -> Ortho3 a
- rotMatrix3' :: Floating a => Normal3 a -> a -> Mat3 a
- rotMatrixOrtho3' :: Floating a => Normal3 a -> a -> Ortho3 a
- reflect :: Floating a => Normal3 a -> Vec3 a -> Vec3 a
- reflect' :: Floating a => Normal3 a -> Normal3 a -> Normal3 a
- refract :: (Floating a, Ord a) => a -> Normal3 a -> Vec3 a -> Vec3 a
- refract' :: (Floating a, Ord a) => a -> Normal3 a -> Normal3 a -> Normal3 a
- refractOnly' :: (Floating a, Ord a) => a -> Normal3 a -> Normal3 a -> Maybe (Normal3 a)
Documentation
structVec3 :: [a] -> [Vec3 a]Source
Example: structVec3 [1,2,3,4,5,6] = [ Vec3 1 2 3 , Vec3 4 5 6]
.
destructVec3 :: [Vec3 a] -> [a]Source
The opposite of structVec3.
translate3X :: Num a => a -> Vec3 a -> Vec3 aSource
translate3Y :: Num a => a -> Vec3 a -> Vec3 aSource
translate3Z :: Num a => a -> Vec3 a -> Vec3 aSource
rotMatrixZ :: Floating a => a -> Mat3 aSource
rotMatrixY :: Floating a => a -> Mat3 aSource
rotMatrixX :: Floating a => a -> Mat3 aSource
rotMatrix3 :: Floating a => Vec3 a -> a -> Mat3 aSource
Rotation around an arbitrary 3D vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3 :: Floating a => Vec3 a -> a -> Ortho3 aSource
rotMatrix3' :: Floating a => Normal3 a -> a -> Mat3 aSource
Rotation around an arbitrary 3D unit vector. The resulting 3x3 matrix is intended for multiplication on the right.
rotMatrixOrtho3' :: Floating a => Normal3 a -> a -> Ortho3 aSource
reflect :: Floating a => Normal3 a -> Vec3 a -> Vec3 aSource
Reflects a vector to an axis: that is, the result of reflect n v
is
2<n,v>n - v
refract' :: (Floating a, Ord a) => a -> Normal3 a -> Normal3 a -> Normal3 aSource
Refraction.
First parameter (eta
) is the relative refraction index
refl_inside eta = -------------- refl_outside
where "inside" is the direction of the second argument
(to vector normal to plane which models the boundary
between the two materials). That is, total internal reflection
can occur when eta>1
.
The convention is that the origin is the point of intersection
of the ray and the surface, and all the vectors "point away"
from here (unlike, say, GLSL's refract
, where the incident
vector "points towards" the material)