Constructor
new DefRefraction(params)
Default values
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Methods
compute(createInfo) → {Object}
Computes the refraction
Parameters:
Name | Type | Description |
---|---|---|
createInfo |
CreateInfo | The creation info |
- Source:
Returns:
The refraction vector with type TYPE_VECTOR
- Type
- Object
(static) fromVectorNormal(params) → {CreateInfo}
Computes the refraction of a vector along a normal.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
params |
Object |
Properties
|
- Source:
Returns:
The creation info
- Type
- CreateInfo
(static) refractVector(i, n, eta) → {Object|null}
Computes the refraction of an incident diretion I along a vector N
Parameters:
Name | Type | Description |
---|---|---|
i |
Object | The incident direction |
n |
Object | The normal |
eta |
Number | The ratio of refractive indices. Will be inverted, if the incoming direction points into the same half space as the normal |
- Source:
Returns:
The refracted vector. In case of total internal reflection, null will be returned
- Type
- Object | null