32 if (step == numsteps) {
40 if (step > numsteps) {
44 offset += step * numverts;
60 if (step == numsteps) {
68 if (step > numsteps) {
72 offset += step * numverts;
93 int maxstep = *numsteps * 2;
94 *step =
min((
int)(time * maxstep), maxstep - 1);
95 *t = time * maxstep - *step;
120 verts[0] = (1.0f - t) *
verts[0] + t * next_verts[0];
121 verts[1] = (1.0f - t) *
verts[1] + t * next_verts[1];
122 verts[2] = (1.0f - t) *
verts[2] + t * next_verts[2];
154 kg, tri_vindex, offset, numverts, numsteps, step + 1, next_normals);
157 normals[0] =
normalize((1.0f - t) * normals[0] + t * next_normals[0]);
158 normals[1] =
normalize((1.0f - t) * normals[1] + t * next_normals[1]);
159 normals[2] =
normalize((1.0f - t) * normals[2] + t * next_normals[2]);
190 float w = 1.0f - u -
v;
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
SIMD_FORCE_INLINE btVector3 & normalize()
Normalize this vector x^2 + y^2 + z^2 = 1.
ccl_device_inline int intersection_find_attribute(KernelGlobals kg, const int object, const uint id)
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
#define ccl_device_inline
#define CCL_NAMESPACE_END
@ ATTR_STD_MOTION_VERTEX_NORMAL
@ ATTR_STD_MOTION_VERTEX_POSITION
ccl_device_inline bool is_zero(const float2 a)
ccl_device_inline float2 safe_normalize(const float2 a)
ccl_device_inline void motion_triangle_vertices_and_normals(KernelGlobals kg, int object, int prim, float time, float3 verts[3], float3 normals[3])
ccl_device_inline float3 motion_triangle_smooth_normal(KernelGlobals kg, float3 Ng, int object, uint3 tri_vindex, int numsteps, int step, float t, float u, float v)
ccl_device_inline void motion_triangle_normals(KernelGlobals kg, int object, uint3 tri_vindex, int numsteps, int numverts, int step, float t, float3 normals[3])
ccl_device_inline void motion_triangle_vertices(KernelGlobals kg, int object, uint3 tri_vindex, int numsteps, int numverts, int step, float t, float3 verts[3])
CCL_NAMESPACE_BEGIN ccl_device_inline void motion_triangle_verts_for_step(KernelGlobals kg, uint3 tri_vindex, int offset, int numverts, int numsteps, int step, float3 verts[3])
ccl_device_inline void motion_triangle_normals_for_step(KernelGlobals kg, uint3 tri_vindex, int offset, int numverts, int numsteps, int step, float3 normals[3])
ccl_device_inline void motion_triangle_compute_info(KernelGlobals kg, int object, float time, int prim, ccl_private uint3 *tri_vindex, ccl_private int *numsteps, ccl_private int *step, ccl_private float *t)