Create material abstraction
This commit is contained in:
@@ -40,6 +40,15 @@ vec3_t vec3_cross(vec3_t v, vec3_t u)
|
||||
};
|
||||
}
|
||||
|
||||
vec3_t vec3_hadamard(vec3_t v, vec3_t u)
|
||||
{
|
||||
return (vec3_t) {
|
||||
.x = v.x * u.x,
|
||||
.y = v.y * u.y,
|
||||
.z = v.z * u.z,
|
||||
};
|
||||
}
|
||||
|
||||
double vec3_len(vec3_t v)
|
||||
{
|
||||
return sqrt(v.x * v.x + v.y * v.y + v.z * v.z);
|
||||
|
||||
Reference in New Issue
Block a user