Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r--source/blender/blenlib/intern/bpath.c10
-rw-r--r--source/blender/blenlib/intern/math_geom.c23
-rw-r--r--source/blender/blenlib/intern/math_vector_inline.c6
-rw-r--r--source/blender/blenlib/intern/path_util.c2
4 files changed, 33 insertions, 8 deletions
diff --git a/source/blender/blenlib/intern/bpath.c b/source/blender/blenlib/intern/bpath.c
index 8ad79dd819a..8ad6cfc7cdf 100644
--- a/source/blender/blenlib/intern/bpath.c
+++ b/source/blender/blenlib/intern/bpath.c
@@ -131,7 +131,7 @@ static int makeFilesRelative_visit_cb(void *userdata, char *path_dst, const char
void makeFilesRelative(Main *bmain, const char *basedir, ReportList *reports)
{
- BPathRemap_Data data= {0};
+ BPathRemap_Data data= {NULL};
if(basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
@@ -174,7 +174,7 @@ static int makeFilesAbsolute_visit_cb(void *userdata, char *path_dst, const char
/* similar to makeFilesRelative - keep in sync! */
void makeFilesAbsolute(Main *bmain, const char *basedir, ReportList *reports)
{
- BPathRemap_Data data= {0};
+ BPathRemap_Data data= {NULL};
if(basedir[0] == '\0') {
printf("%s: basedir='', this is a bug\n", __func__);
@@ -280,7 +280,7 @@ static int findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
void findMissingFiles(Main *bmain, const char *searchpath, ReportList *reports)
{
- struct BPathFind_Data data= {0};
+ struct BPathFind_Data data= {NULL};
data.reports= reports;
BLI_split_dir_part(searchpath, data.searchdir, sizeof(data.searchdir));
@@ -431,6 +431,10 @@ void bpath_traverse_id(Main *bmain, ID *id, BPathVisitor visit_cb, const int fla
ClothModifierData *clmd= (ClothModifierData*) md;
BPATH_TRAVERSE_POINTCACHE(clmd->ptcaches);
}
+ else if (md->type==eModifierType_Ocean) {
+ OceanModifierData *omd= (OceanModifierData*) md;
+ rewrite_path_fixed(omd->cachepath, visit_cb, absbase, bpath_user_data);
+ }
}
if (ob->soft) {
diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c
index 23a37dadebe..fa041158c90 100644
--- a/source/blender/blenlib/intern/math_geom.c
+++ b/source/blender/blenlib/intern/math_geom.c
@@ -238,7 +238,7 @@ void closest_to_line_segment_v3(float closest[3], const float v1[3], const float
}
/* signed distance from the point to the plane in 3D */
-float dist_to_plane_v3(const float p[2], const float plane_co[3], const float plane_no[2])
+float dist_to_plane_v3(const float p[3], const float plane_co[3], const float plane_no[3])
{
float plane_no_unit[3];
float plane_co_other[3];
@@ -833,6 +833,27 @@ int isect_line_plane_v3(float out[3], const float l1[3], const float l2[3], cons
}
}
+int isect_plane_plane_v3(float r_isect_co[3], float r_isect_no[3],
+ const float plane_a_co[3], const float plane_a_no[3],
+ const float plane_b_co[3], const float plane_b_no[3])
+{
+ float p1_co_other[3], p2_co_other[3];
+ float isect_co_dummy[3];
+
+ cross_v3_v3v3(r_isect_no, plane_a_no, plane_b_no);
+ cross_v3_v3v3(p1_co_other, plane_a_no, r_isect_no);
+ cross_v3_v3v3(p2_co_other, plane_b_no, r_isect_no);
+
+ add_v3_v3(p1_co_other, plane_a_co);
+ add_v3_v3(p2_co_other, plane_b_co);
+
+ /* we could use either ix_1, ix_2 - doesnt matter in this case */
+ return isect_line_line_v3(plane_a_co, p1_co_other,
+ plane_b_co, p2_co_other,
+ r_isect_co, isect_co_dummy);
+}
+
+
/* Adapted from the paper by Kasper Fauerby */
/* "Improved Collision detection and Response" */
static int getLowestRoot(const float a, const float b, const float c, const float maxR, float *root)
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c
index f6ba4ec43ad..f6dd28c3151 100644
--- a/source/blender/blenlib/intern/math_vector_inline.c
+++ b/source/blender/blenlib/intern/math_vector_inline.c
@@ -181,19 +181,19 @@ MINLINE void add_v4_fl(float r[4], float f)
r[3] += f;
}
-MINLINE void add_v2_v2(float *r, const float *a)
+MINLINE void add_v2_v2(float r[2], const float a[2])
{
r[0] += a[0];
r[1] += a[1];
}
-MINLINE void add_v2_v2v2(float *r, const float *a, const float *b)
+MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
{
r[0]= a[0] + b[0];
r[1]= a[1] + b[1];
}
-MINLINE void add_v3_v3(float *r, const float *a)
+MINLINE void add_v3_v3(float r[3], const float a[3])
{
r[0] += a[0];
r[1] += a[1];
diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c
index e7031c943c1..2bf7c7c4039 100644
--- a/source/blender/blenlib/intern/path_util.c
+++ b/source/blender/blenlib/intern/path_util.c
@@ -1842,7 +1842,7 @@ const char *BLI_program_dir(void)
* @param fullname The full path to the temp directory
* @param userdir Directory specified in user preferences
*/
-void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
+static void BLI_where_is_temp(char *fullname, const size_t maxlen, char *userdir)
{
fullname[0] = '\0';