1// Copyright 2009-2021 Intel Corporation
2// SPDX-License-Identifier: Apache-2.0
3
4#pragma once
5
6#include "../common/default.h"
7#include "bezier_curve.h"
8
9namespace embree
10{
11 template<typename Vertex>
12 struct HermiteCurveT : BezierCurveT<Vertex>
13 {
14 __forceinline HermiteCurveT() {}
15
16 __forceinline HermiteCurveT(const BezierCurveT<Vertex>& curve)
17 : BezierCurveT<Vertex>(curve) {}
18
19 __forceinline HermiteCurveT(const Vertex& v0, const Vertex& t0, const Vertex& v1, const Vertex& t1)
20 : BezierCurveT<Vertex>(v0,madd(1.0f/3.0f,t0,v0),nmadd(1.0f/3.0f,t1,v1),v1) {}
21
22 __forceinline HermiteCurveT<Vec3ff> xfm_pr(const LinearSpace3fa& space, const Vec3fa& p) const
23 {
24 const Vec3ff q0(xfmVector(space,this->v0-p), this->v0.w);
25 const Vec3ff q1(xfmVector(space,this->v1-p), this->v1.w);
26 const Vec3ff q2(xfmVector(space,this->v2-p), this->v2.w);
27 const Vec3ff q3(xfmVector(space,this->v3-p), this->v3.w);
28 return BezierCurveT<Vec3ff>(q0,q1,q2,q3);
29 }
30 };
31
32 template<typename CurveGeometry>
33 __forceinline HermiteCurveT<Vec3ff> enlargeRadiusToMinWidth(const IntersectContext* context, const CurveGeometry* geom, const Vec3fa& ray_org, const HermiteCurveT<Vec3ff>& curve) {
34 return HermiteCurveT<Vec3ff>(enlargeRadiusToMinWidth(context,geom,ray_org,BezierCurveT<Vec3ff>(curve)));
35 }
36
37 typedef HermiteCurveT<Vec3fa> HermiteCurve3fa;
38}
39
40

source code of qtquick3d/src/3rdparty/embree/kernels/subdiv/hermite_curve.h