| 1164 | } |
| 1165 | |
| 1166 | void fix_bspline_end_points(const std::vector<unsigned>& indices, avector<Vec3ff>& positions) |
| 1167 | { |
| 1168 | for (size_t i=0; i<indices.size(); i++) |
| 1169 | { |
| 1170 | const size_t idx = indices[i]; |
| 1171 | vfloat4 v0 = vfloat4::loadu(&positions[idx+0]); |
| 1172 | vfloat4 v1 = vfloat4::loadu(&positions[idx+1]); |
| 1173 | vfloat4 v2 = vfloat4::loadu(&positions[idx+2]); |
| 1174 | vfloat4 v3 = vfloat4::loadu(&positions[idx+3]); |
| 1175 | v0 = select(isnan(v0),2.0f*v1-v2,v0); // nan triggers edge rule |
| 1176 | v3 = select(isnan(v3),2.0f*v2-v1,v3); // nan triggers edge rule |
| 1177 | vfloat4::storeu(&positions[idx+0],v0); |
| 1178 | vfloat4::storeu(&positions[idx+3],v3); |
| 1179 | } |
| 1180 | } |
| 1181 | |
| 1182 | Ref<SceneGraph::Node> XMLLoader::loadBezierCurves(const Ref<XML>& xml, SceneGraph::CurveSubtype subtype) |
| 1183 | { |