Age | Commit message (Collapse) | Author |
|
Logic was ok, but would run into precision issues.
|
|
|
|
|
|
Project both triangles onto the same plane to simplify calculations.
|
|
epsilon check here didn't account for scale, causing T45919
|
|
- closest_to_plane3 (for float3 planes)
- closest_to_plane*_normalized_v3 (for unit length planes)
Use when the plane is known to be unit length
|
|
|
|
dist_squared_to_line_v2, dist_to_line_v2
|
|
|
|
|
|
Also remove 2x vector normalize since other parts of the code already check this.
Fixes T45849
|
|
From Cycles with some very minor differences.
|
|
Also define epsilon var for ray-cast functions.
|
|
|
|
|
|
|
|
This stores loop indices into the loop array giving easier acess
to data such as vertex-colors and UV's,
removing the need to store an MFace duplicate of custom-data.
This doesn't yet move all internal code from MFace to LoopTri just yet.
Only applies to:
- opengl drawing
- sculpting (pbvh)
- vertex/weight paint
Thanks to @psy-fi for review, fixes and improvements to drawing!
|
|
add a negated version of axis_dominant_v3_to_m3
|
|
|
|
Remove offset before calculating distance.
Define 'plane3' to BLI_math, since we often don't need the 4th component.
|
|
Co-linear lines could detect as intersecting even if they weren't overlapping.
|
|
|
|
|
|
|
|
Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.
|
|
Also add a faster, non-normalized version of the function.
(Neither are used currently used).
|
|
|
|
Can be used to check if a point is inside the 2-planes defined by a face-corner.
|
|
- area_quad_v3 now works correctly with concave quads.
- add area_squared_*** functions, to use when comparing to avoid a sqrt().
|
|
This changes BKE's fitting code to use `BKE_camera_params_compute_viewplane` instead of
`BKE_camera_view_frame`. This allows that code to work with orthographic projection too.
Also, two funcs were added to rna's Object, to resp. get the projection matrix of that
object (mostly useful for cameras and lamps objects), and return position this object
should be to see all (to fit) a given set of points.
Reviewers: campbellbarton
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D961
|
|
|
|
use line_point_factor instead of length between vertices.
|
|
halve sqrtf calls per per polygon corner.
|
|
|
|
Resulting triangles could be pointing in opposing directions.
|
|
|
|
|
|
The ones in extern/glew-es have been changed to NOTE instead of XXX
GHOST_ContextEGL.cpp: It really does seem that it is not possible to query the swap interval using EGL
GHOST_WidnowCocoa.h: The comment referring to Carbon is clearly out of date, so I removed it.
math_geom.c: The node about not using tmax again is correct, but the code is kept for a future maintainer who will need to know how to compute it if they modify that code.
paint_image_proj.c (2698): The question about integer truncation does not appear to have been resolved. It still seems to be an incorrectly implementation of rounding (I'd suggest using the round function instead of this hack).
|
|
|
|
|
|
|
|
|
|
line-tri intersection depended on scale, The check made small triangles & lines fail.
So just check for divide by zero as ray-cast currently does.
|
|
|
|
also add transform_point_by_seg_v3
|
|
also add unsigned versions
|
|
possible, true/false for booleans, format for float litterals).
|
|
Add to Python via mathutils.geometry
|
|
This was a ToDo item, for mesh-based rigid body shapes (trimesh, convex)
the operator was simply using the bounding box volume, which can grossly
overestimate the volume and mass.
Calculating the actual volume of a mesh is not so difficult after all,
see e.g.
http://research.microsoft.com/en-us/um/people/chazhang/publications/icip01_ChaZhang.pdf
This patch also allows calculating the center-of-mass in the same way.
This is currently unused, because the rigid body system assumes the CoM
to be the same as the geometric object center. This is fine most of the
time, adding such user settings for "center-of-mass offset" would also
add quite a bit of complexity in user space, but it could be necessary
at some point. A number of other physical properties could be calculated
using the same principle, e.g. the moment of inertia.
|
|
Opted to keep includes if they are used indirectly (even if removing is possible).
|