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:
authorMartin Poirier <theeth@yahoo.com>2003-10-21 17:22:07 +0400
committerMartin Poirier <theeth@yahoo.com>2003-10-21 17:22:07 +0400
commit4efdabfbbc3f4f79328241e8b59002d869ae247a (patch)
tree5d3dae23f261a779e552520c4224a147090dabe4 /source/blender/blenlib/intern/arithb.c
parent2da9cb5db284e16d95ff7e65dda9174c6b668950 (diff)
Constraint stuff from tuhopuu including (but probably not limited too):
Axis options for TrackTo LockTrack FollowPath Auto creation of TrackTo constraint from Ctrl-T (old track still an option) Auto creation of FollowPath when parenting to path (Normal parent still an option) Backward compatibility stuff to convert the per object axis settings to per constraint when a Track constraint is present. Function to convert old track to constraint (commented out) Revamped the constraints interface with Matt's work from tuhopuu and the stuff we were discussing earlier. -------------------- For coders: unique_constraint_name and *new_constraint_data moved to the kernel (constraint.c) new Projf function in arithb gives the projection of a vector on another vector add_new_constraint now takes a constraint type (int) parameter add_constraint_to_object(bConstraint *con, Object *ob) to link a constraint to an object add_constraint_to_client(bConstraint *con) to link constraint to current client (object or bone) add_influence_key_to_constraint (bConstraint *con) to (eventually) add a keyframe to the influence IPO of a constraint
Diffstat (limited to 'source/blender/blenlib/intern/arithb.c')
-rw-r--r--source/blender/blenlib/intern/arithb.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/blenlib/intern/arithb.c b/source/blender/blenlib/intern/arithb.c
index fa13f8223a8..715917d047f 100644
--- a/source/blender/blenlib/intern/arithb.c
+++ b/source/blender/blenlib/intern/arithb.c
@@ -119,6 +119,17 @@ float Inpf( float *v1, float *v2)
return v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2];
}
+/* Project v1 on v2 */
+void Projf(float *c, const float *v1, const float *v2)
+{
+ float mul;
+ mul = Inpf(v1, v2) / Inpf(v2, v2);
+
+ c[0] = mul * v2[0];
+ c[1] = mul * v2[1];
+ c[2] = mul * v2[2];
+}
+
void Mat3Transp(float mat[][3])
{
float t;