Commit Graph

158 Commits

Author SHA1 Message Date
8655be437d code cleanup: use bool where values are true/false, for view3d and related functions. 2013-03-20 23:14:18 +00:00
113f2367a0 move polygon intersection out of BLI_lasso into BLI_math_geom since its a generally useful function.
adds:
- isect_point_poly_v2()
- isect_point_poly_v2_int()
2013-03-14 21:44:16 +00:00
6a51379bf7 tweaks to clang so blender can build with -Werror 2013-03-14 07:25:54 +00:00
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
8db7a34167 math: Use len_v3() instead of normalize_v3() for area calculation
We only need the length, avoids unnecessary calculations.
2013-03-07 19:16:02 +00:00
79e80d8322 code cleanup: ~400 duplicate lines for AO form factor math. 2013-03-03 05:07:58 +00:00
f784856906 make asserts that check for unit length vectors into a macro.
this was really not nice logic to try to fit into an assert.
2013-02-19 13:15:34 +00:00
10305de3ac Fix "Origin to Center of Mass" not working well with ngons
Now we do simple triangulation and calculate signed area of triangles to
account for concave polygons.

This only works correct for planar polygons but gives better results
overall.
2013-02-14 17:35:46 +00:00
e3944f5bfa Divide by 3 instead of multiplying by variations of 0.333
Fixes small precision problems.
2013-02-14 17:35:43 +00:00
3cf0c93be1 modify own changes to is_quad_convex_v3() to allow quads with a co-linear side to be considered convex (as it did in last release).
this is needed so zero area faces be dealt with by beauty fill.
2013-02-14 09:17:50 +00:00
0e740f58ba make is_quad_convex_v3() more strict, check if normal is OK before using as a rotation axis.
make is_quad_convex_v2,3() check for ISECT_LINE_LINE_CROSS intersection (that the lines actually cross each other).
2013-02-13 03:13:12 +00:00
d03befd0db fix for is_quad_convex_v3(), getting the dominant axis wasn't accurate enough in some cases and would make beauty fill fail.
now rotate the coords before calculation.
2013-02-09 07:59:56 +00:00
bb22b7c580 add dist_to_line_v3() for completeness, (had dist_to_line_v2 already) 2013-02-03 07:24:31 +00:00
518bfbb1c9 style cleanup 2013-02-02 04:58:03 +00:00
7c64109bce bmesh todo: uv stretch area draw mode wasn't calculating ngon area - added area_poly_v2(). 2013-01-10 08:16:19 +00:00
682df047a0 style cleanup 2013-01-08 02:06:16 +00:00
08358a60b0 style cleanup 2013-01-08 01:48:14 +00:00
44ab30caf6 comment fix.
Looks like no scaling is done elsewhere on blender for this code. I hope
this bug is squashed for good.
2013-01-07 21:56:13 +00:00
c3b5c726c7 * Fix for #31581. The issue was that we scaled the face prior to
projecting it. The original paper suggests to simply interpolate between
the two points of an edge if the distance of the point to that edge is
smaller than a threshold.

* Fixed both 3D and 2D code to utilize this. Possibly other places in
blender where this scaling is done will have to be adjusted.

* Changed vertex interpolation to use 2D interpolation, since it already
did projection on plane and 2d calculations are faster.

* Also added notifier on hard recalc when uvcalc_transfor_correction is
used. Results in instant feedback on UV editor when edge sliding.
2013-01-07 21:42:40 +00:00
0e26a67c85 add area_poly_v3_max() for use with area_poly_v3 2013-01-07 12:16:11 +00:00
6747dec926 style cleanup 2013-01-07 03:24:22 +00:00
ec1681fae7 style cleanup 2013-01-02 01:49:07 +00:00
66e70e6caa Add function to find closest point in triangle to another point
New function is closest_to_tri_v3() in BLI_math_geom.
2012-12-30 18:23:03 +00:00
4a427d8e0d style cleanup 2012-12-29 01:54:58 +00:00
b2c66e268f replace MIN/MAX 3,4 with inline functions 2012-12-21 05:07:26 +00:00
7c699a217a define the size of matrix args for both rows/cols. 2012-12-11 14:29:01 +00:00
634b22fc46 code cleanup: spelling labda -> lambda 2012-12-11 14:18:37 +00:00
bc94b8300e de-duplicate labda_PdistVL2Dfl() & line_point_factor_v2() 2012-12-10 06:14:43 +00:00
987f6a7d4f code cleanup: move local math functions into math_geom.c, math_vector.c, no functional changes. 2012-11-15 13:24:14 +00:00
fae6c35ca7 code cleanup: quiet -Wdouble-promotion, disabled this warnings for a few files since its done throughout the code in some places. 2012-11-04 07:18:29 +00:00
aeba4950c3 style cleanup 2012-10-27 10:42:28 +00:00
879d92062a code cleanup: move doxy comments into the C files. 2012-10-24 06:08:28 +00:00
b131359834 Fix #32867: normal map baking issue with flat shaded faces since bmesh. Also
removed the old unused normal map tangent computation code.
2012-10-23 14:57:49 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
c56a911cd9 style cleanup: comments 2012-10-20 20:20:02 +00:00
aa49ca25d5 incorrect spelling in comments 2012-09-26 20:05:38 +00:00
585cfff87a Fix #32031: particle distribution on degenerate faces could give NaN values,
which in this case caused NaN values in render lighting.
2012-09-12 13:06:28 +00:00
8d496b3bf2 fix [#32315] Circle select unreliable when in vertex+edge select mode
dist_squared_to_line_segment_v2() was returning the sqrt'd value in some cases.
also use int's for edge_inside_circle() rather then shorts since it was doing int/float/short conversions and we're now using int's for screen vars in more places.
2012-08-14 08:24:49 +00:00
b96c622015 style cleanup 2012-08-11 22:12:32 +00:00
0a35e050f3 code cleanup: remove redundant calls to CTX_data_main() 2012-08-05 14:11:51 +00:00
7cfe6e0fda fix a glitch where overlapping feathering could give random bad pixels, this was caused by feather edge going in a different direction to the mask edge - creating bowtie quads. 2012-08-04 21:04:26 +00:00
fefddc320d code cleanup: use cosf and sinf when both args and results are float values.
also remove local math functions in KX_Camera
2012-07-22 17:35:43 +00:00
62a73381a7 use fabsf when using floats. 2012-07-21 15:27:40 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
92205486e7 Masks: feather self-intersection collapse function
This implements simple function which collapses internal loops
caused by self-intersections into a singularity.

This loops can't be removed because rasterizer expects points
of feather be aligned with points from spline itself.
2012-07-16 17:54:28 +00:00
273bb8fa90 barycentric_weights_v2_quad wasn't working quite right, rewrite as an expanded version of interp_weights_poly_v2() that cuts down duplicate calculations. 2012-07-16 12:01:18 +00:00
9a385d12e3 add 2d version of interp_weights_poly_v3 2012-07-16 10:36:40 +00:00
6f01b0b11f small speedup for mask rasterizer, only do single sided check for triangle intersection. 2012-07-16 06:39:40 +00:00
380c5d66a8 math function to get the intersection point between 2 lines (not 2 segments which we already have). 2012-07-15 11:35:13 +00:00
a52153a618 mask rasterization: use a simpler method to check if a bucket intersects with a triangle. 2012-07-14 18:42:59 +00:00