gKit2 light
Loading...
Searching...
No Matches
World Struct Reference

Public Member Functions

 World (const Vector &_n)
Vector operator() (const Vector &local) const

Public Attributes

Vector t
Vector b
Vector n

Detailed Description

Definition at line 133 of file tuto_is.cpp.

Constructor & Destructor Documentation

◆ World()

World::World ( const Vector & _n)
inline

Definition at line 135 of file tuto_is.cpp.

135 : n(_n)
136 {
137 if(n.z < -0.9999999f)
138 {
139 t= Vector(0, -1, 0);
140 b= Vector(-1, 0, 0);
141 }
142 else
143 {
144 float a= 1.f / (1.f + n.z);
145 float d= -n.x * n.y * a;
146 t= Vector(1.f - n.x * n.x * a, d, -n.x);
147 b= Vector(d, 1.f - n.y * n.y * a, -n.y);
148 }
149 }

Member Function Documentation

◆ operator()()

Vector World::operator() ( const Vector & local) const
inline

Definition at line 151 of file tuto_is.cpp.

152 {
153 return local.x * t + local.y * b + local.z * n;
154 }

Member Data Documentation

◆ t

Vector World::t

Definition at line 156 of file tuto_is.cpp.

◆ b

Vector World::b

Definition at line 157 of file tuto_is.cpp.

◆ n

Vector World::n

Definition at line 158 of file tuto_is.cpp.


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