Class: DefReflection

algeobra~DefReflection(normalize)

Definition of a vector reflected along a normal

Constructor

new DefReflection(normalize)

Default values
Parameters:
Name Type Default Description
normalize Boolean false Whether the vector should be normalized
Source:

Methods

compute(createInfo) → {Object}

Computes the reflection
Parameters:
Name Type Description
createInfo CreateInfo The creation info
Source:
Returns:
The reflection with type TYPE_VECTOR
Type
Object

(static) fromVectorNormal(params) → {CreateInfo}

Computes the reflection of a vector along a normal.
Parameters:
Name Type Description
params Object
Properties
Name Type Attributes Description
v Number | Object Either the index or value of a TYPE_VECTOR. The vector to be reflected
n Number | Object Either the index or value of a TYPE_VECTOR. The normal
ref Number | Object <optional>
Either the index or value of a TYPE_POINT. The reference point
normalize Number | Object <optional>
Either the index or value of a TYPE_BOOLEAN. Whether the vector should be normalized
Source:
Returns:
The creation info
Type
CreateInfo

(static) reflectVector(i, n) → {Object}

Computes the reflection of an incident diretion I along a vector N: I - 2.0 * dot(N, I) * N
Parameters:
Name Type Description
i Object The incident direction
n Object The normal
Source:
Returns:
The reflected vector
Type
Object