Age | Commit message (Collapse) | Author |
|
|
|
Gives a bit better precision than creating a line in some cases,
use for ED_view3d_win_to_3d.
|
|
|
|
|
|
Calculate the clipped min/max factor along the segment,
only applying to the coordinates at the end (will give better precision too).
Also make split input/output args.
|
|
Follow isect_ray_tri_watertight_v3 naming.
|
|
Instead of running the callback per-pixel,
pass the x-span to the callback.
|
|
Distinguish between line / line_segment
|
|
Rename not-very-descriptive (p1, d) -> (ray_origin, ray_direction)
|
|
|
|
|
|
|
|
Differentiate between lines and segments.
|
|
Was taking a triangle and doing ray-tri intersect.
|
|
|
|
Project both triangles onto the same plane to simplify calculations.
|
|
- 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
|
|
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.
|
|
|
|
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
|
|
|
|
Resulting triangles could be pointing in opposing directions.
|
|
|
|
|
|
also add transform_point_by_seg_v3
|
|
also add unsigned versions
|
|
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.
|
|
|
|
|
|
bypass angle calculation to avoids (asin, sqrt, cos).
|
|
build the matrix directly rather then calculating with axis/angle
also remove unused function calc_poly_plane
|
|
add normal_poly_v3
|
|
|
|
|
|
|
|
|
|
Compute barycentric coordinates (u, v) for a point with respect to a
triangle.
This is needed for Cycles baking but we decided to push this
independently of the upcoming main baking changes.
Code adapted from Christer Ericson's Real-Time Collision Detection.
Cleanup, refactoring and review from Campbell Barton.
|
|
|