Merging r41564 through r41596 from trunk into soc-2011-tomato
authorSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Nov 2011 18:38:20 +0000 (18:38 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Sun, 6 Nov 2011 18:38:20 +0000 (18:38 +0000)
201 files changed:
GNUmakefile
release/scripts/startup/bl_ui/properties_object.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/BKE_effect.h
source/blender/blenkernel/BKE_object.h
source/blender/blenkernel/BKE_particle.h
source/blender/blenkernel/BKE_scene.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/boids.c
source/blender/blenkernel/intern/bvhutils.c
source/blender/blenkernel/intern/cloth.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/displist.c
source/blender/blenkernel/intern/effect.c
source/blender/blenkernel/intern/fluidsim.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/key.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/pointcache.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/sequencer.c
source/blender/blenkernel/intern/shrinkwrap.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/softbody.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenkernel/intern/texture.c
source/blender/blenlib/BLI_kdopbvh.h
source/blender/blenlib/intern/BLI_kdopbvh.c
source/blender/blenlib/intern/graph.c
source/blender/blenloader/intern/readfile.c
source/blender/collada/AnimationExporter.cpp
source/blender/collada/AnimationExporter.h
source/blender/editors/animation/anim_draw.c
source/blender/editors/animation/anim_markers.c
source/blender/editors/animation/keyframing.c
source/blender/editors/armature/meshlaplacian.c
source/blender/editors/curve/editcurve.c
source/blender/editors/include/ED_anim_api.h
source/blender/editors/include/ED_particle.h
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/mesh/editmesh.c
source/blender/editors/object/object_edit.c
source/blender/editors/object/object_relations.c
source/blender/editors/object/object_transform.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/physics/particle_object.c
source/blender/editors/sculpt_paint/paint_image.c
source/blender/editors/sculpt_paint/paint_utils.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/space_view3d/drawvolume.c
source/blender/editors/transform/transform.c
source/blender/editors/transform/transform_conversions.c
source/blender/editors/transform/transform_orientations.c
source/blender/editors/uvedit/uvedit_draw.c
source/blender/editors/uvedit/uvedit_ops.c
source/blender/gpu/intern/gpu_material.c
source/blender/makesdna/DNA_object_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/intern/rna_object.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_explode.c
source/blender/modifiers/intern/MOD_particleinstance.c
source/blender/modifiers/intern/MOD_simpledeform.c
source/blender/nodes/composite/node_composite_util.c
source/blender/nodes/composite/nodes/node_composite_alphaOver.c
source/blender/nodes/composite/nodes/node_composite_blur.c
source/blender/nodes/composite/nodes/node_composite_colorMatte.c
source/blender/nodes/composite/nodes/node_composite_curves.c
source/blender/nodes/composite/nodes/node_composite_diffMatte.c
source/blender/nodes/composite/nodes/node_composite_distanceMatte.c
source/blender/nodes/composite/nodes/node_composite_filter.c
source/blender/nodes/composite/nodes/node_composite_hueSatVal.c
source/blender/nodes/composite/nodes/node_composite_invert.c
source/blender/nodes/composite/nodes/node_composite_mixrgb.c
source/blender/nodes/composite/nodes/node_composite_normal.c
source/blender/nodes/composite/nodes/node_composite_normalize.c
source/blender/nodes/composite/nodes/node_composite_rgb.c
source/blender/nodes/composite/nodes/node_composite_splitViewer.c
source/blender/nodes/composite/nodes/node_composite_texture.c
source/blender/nodes/composite/nodes/node_composite_zcombine.c
source/blender/nodes/shader/node_shader_util.c
source/blender/nodes/shader/nodes/node_shader_camera.c
source/blender/nodes/shader/nodes/node_shader_geom.c
source/blender/nodes/shader/nodes/node_shader_hueSatVal.c
source/blender/nodes/shader/nodes/node_shader_invert.c
source/blender/nodes/shader/nodes/node_shader_material.c
source/blender/nodes/shader/nodes/node_shader_mixRgb.c
source/blender/nodes/shader/nodes/node_shader_normal.c
source/blender/nodes/shader/nodes/node_shader_output.c
source/blender/nodes/shader/nodes/node_shader_rgb.c
source/blender/nodes/shader/nodes/node_shader_texture.c
source/blender/nodes/texture/nodes/node_texture_bricks.c
source/blender/nodes/texture/nodes/node_texture_hueSatVal.c
source/blender/nodes/texture/nodes/node_texture_image.c
source/blender/nodes/texture/nodes/node_texture_invert.c
source/blender/nodes/texture/nodes/node_texture_mixRgb.c
source/blender/nodes/texture/nodes/node_texture_proc.c
source/blender/nodes/texture/nodes/node_texture_texture.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/render/intern/include/zbuf.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/imagetexture.c
source/blender/render/intern/source/occlusion.c
source/blender/render/intern/source/rayshade.c
source/blender/render/intern/source/render_texture.c
source/blender/render/intern/source/rendercore.c
source/blender/render/intern/source/shadeoutput.c
source/blender/render/intern/source/sss.c
source/blender/render/intern/source/strand.c
source/blender/render/intern/source/volume_precache.c
source/blender/render/intern/source/zbuf.c
source/gameengine/Converter/BL_ActionActuator.cpp
source/gameengine/Converter/BL_ActionActuator.h
source/gameengine/Converter/BL_ArmatureActuator.h
source/gameengine/Converter/BL_ArmatureConstraint.h
source/gameengine/Converter/BL_ArmatureObject.cpp
source/gameengine/Converter/BL_ArmatureObject.h
source/gameengine/Converter/BL_ShapeActionActuator.h
source/gameengine/Expressions/Expression.h
source/gameengine/Expressions/ListValue.h
source/gameengine/Expressions/PyObjectPlus.cpp
source/gameengine/Expressions/PyObjectPlus.h
source/gameengine/Expressions/Value.cpp
source/gameengine/Expressions/Value.h
source/gameengine/GameLogic/SCA_2DFilterActuator.h
source/gameengine/GameLogic/SCA_ANDController.h
source/gameengine/GameLogic/SCA_ActuatorSensor.h
source/gameengine/GameLogic/SCA_AlwaysSensor.h
source/gameengine/GameLogic/SCA_DelaySensor.h
source/gameengine/GameLogic/SCA_ExpressionController.h
source/gameengine/GameLogic/SCA_IController.h
source/gameengine/GameLogic/SCA_ILogicBrick.h
source/gameengine/GameLogic/SCA_IObject.h
source/gameengine/GameLogic/SCA_ISensor.h
source/gameengine/GameLogic/SCA_JoystickSensor.h
source/gameengine/GameLogic/SCA_KeyboardSensor.h
source/gameengine/GameLogic/SCA_MouseSensor.h
source/gameengine/GameLogic/SCA_NANDController.h
source/gameengine/GameLogic/SCA_NORController.h
source/gameengine/GameLogic/SCA_ORController.h
source/gameengine/GameLogic/SCA_PropertyActuator.h
source/gameengine/GameLogic/SCA_PropertySensor.h
source/gameengine/GameLogic/SCA_PythonController.cpp
source/gameengine/GameLogic/SCA_PythonController.h
source/gameengine/GameLogic/SCA_PythonKeyboard.h
source/gameengine/GameLogic/SCA_PythonMouse.h
source/gameengine/GameLogic/SCA_RandomActuator.h
source/gameengine/GameLogic/SCA_RandomSensor.h
source/gameengine/GameLogic/SCA_XNORController.h
source/gameengine/GameLogic/SCA_XORController.h
source/gameengine/Ketsji/BL_Shader.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.h
source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageSensor.h
source/gameengine/Ketsji/KX_ArmatureSensor.h
source/gameengine/Ketsji/KX_BlenderMaterial.h
source/gameengine/Ketsji/KX_Camera.h
source/gameengine/Ketsji/KX_CameraActuator.h
source/gameengine/Ketsji/KX_ConstraintActuator.h
source/gameengine/Ketsji/KX_ConstraintWrapper.h
source/gameengine/Ketsji/KX_FontObject.h
source/gameengine/Ketsji/KX_GameActuator.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h
source/gameengine/Ketsji/KX_IpoActuator.h
source/gameengine/Ketsji/KX_Light.h
source/gameengine/Ketsji/KX_MeshProxy.cpp
source/gameengine/Ketsji/KX_MeshProxy.h
source/gameengine/Ketsji/KX_MouseFocusSensor.h
source/gameengine/Ketsji/KX_NavMeshObject.h
source/gameengine/Ketsji/KX_NearSensor.h
source/gameengine/Ketsji/KX_ObjectActuator.h
source/gameengine/Ketsji/KX_ParentActuator.h
source/gameengine/Ketsji/KX_PhysicsObjectWrapper.h
source/gameengine/Ketsji/KX_PolyProxy.cpp
source/gameengine/Ketsji/KX_PolyProxy.h
source/gameengine/Ketsji/KX_PolygonMaterial.cpp
source/gameengine/Ketsji/KX_PolygonMaterial.h
source/gameengine/Ketsji/KX_RadarSensor.h
source/gameengine/Ketsji/KX_RaySensor.h
source/gameengine/Ketsji/KX_SCA_AddObjectActuator.h
source/gameengine/Ketsji/KX_SCA_DynamicActuator.h
source/gameengine/Ketsji/KX_SCA_EndObjectActuator.h
source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
source/gameengine/Ketsji/KX_Scene.cpp
source/gameengine/Ketsji/KX_Scene.h
source/gameengine/Ketsji/KX_SceneActuator.h
source/gameengine/Ketsji/KX_SoundActuator.h
source/gameengine/Ketsji/KX_StateActuator.h
source/gameengine/Ketsji/KX_SteeringActuator.h
source/gameengine/Ketsji/KX_TouchSensor.h
source/gameengine/Ketsji/KX_TrackToActuator.h
source/gameengine/Ketsji/KX_VehicleWrapper.h
source/gameengine/Ketsji/KX_VertexProxy.h
source/gameengine/Ketsji/KX_VisibilityActuator.h

index 30759f9..640e90d 100644 (file)
@@ -135,9 +135,6 @@ help:
        @echo "  * package_pacman  - build an arch linux pacmanpackage"
        @echo "  * package_archive - build an archive package"
        @echo ""
-       @echo "Other Targets (not assosiated with building blender)"
-       @echo "  * translations  - update blenders translation files in po/"
-       @echo ""
        @echo "Testing Targets (not assosiated with building blender)"
        @echo "  * test            - run ctest, currently tests import/export, operator execution and that python modules load"
        @echo "  * test_cmake      - runs our own cmake file checker which detects errors in the cmake file list definitions"
@@ -170,16 +167,6 @@ package_archive:
        @echo archive in "$(BUILD_DIR)/release"
 
 
-# -----------------------------------------------------------------------------
-# Other Targets
-#
-translations:
-       $(BUILD_DIR)/bin/blender --background -noaudio --factory-startup --python po/tools/update_msg.py
-       python3 po/tools/update_pot.py
-       python3 po/tools/update_po.py
-       python3 po/tools/update_mo.py
-
-
 # -----------------------------------------------------------------------------
 # Tests
 #
index 0779deb..a359d58 100644 (file)
@@ -257,10 +257,8 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
             layout.prop(ob, "dupli_group", text="Group")
 
 
-# XXX: the following options are all quite buggy, ancient hacks that should be dropped
-
-class OBJECT_PT_animation(ObjectButtonsPanel, Panel):
-    bl_label = "Animation Hacks"
+class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel):
+    bl_label = "Relations Extras"
     bl_options = {'DEFAULT_CLOSED'}
 
     def draw(self, context):
@@ -269,23 +267,17 @@ class OBJECT_PT_animation(ObjectButtonsPanel, Panel):
         ob = context.object
 
         split = layout.split()
-
-        col = split.column()
-        col.label(text="Time Offset:")
-        col.prop(ob, "use_time_offset_edit", text="Edit")
-        row = col.row()
-        row.prop(ob, "use_time_offset_parent", text="Parent")
-        row.active = (ob.parent is not None)
-        row = col.row()
-        row.prop(ob, "use_slow_parent")
-        row.active = (ob.parent is not None)
-        col.prop(ob, "time_offset", text="Offset")
-
-        # XXX: these are still used for a few curve-related tracking features
+        
         col = split.column()
         col.label(text="Tracking Axes:")
         col.prop(ob, "track_axis", text="Axis")
         col.prop(ob, "up_axis", text="Up Axis")
+        
+        col = split.column()
+        col.prop(ob, "use_slow_parent")
+        row = col.row()
+        row.active = ((ob.parent is not None) and (ob.use_slow_parent))
+        row.prop(ob, "slow_parent_offset", text="Offset")
 
 
 from bl_ui.properties_animviz import (
index d7dc7ef..9edb1ea 100644 (file)
@@ -2063,7 +2063,22 @@ class VIEW3D_PT_view3d_properties(Panel):
         subcol.label(text="Local Camera:")
         subcol.prop(view, "camera", text="")
 
-        layout.column().prop(view, "cursor_location")
+
+class VIEW3D_PT_view3d_cursor(Panel):
+    bl_space_type = 'VIEW_3D'
+    bl_region_type = 'UI'
+    bl_label = "3D Cursor"
+
+    @classmethod
+    def poll(cls, context):
+        view = context.space_data
+        return (view)
+
+    def draw(self, context):
+        layout = self.layout
+
+        view = context.space_data
+        layout.column().prop(view, "cursor_location", text="Location")
 
 
 class VIEW3D_PT_view3d_name(Panel):
index 59a361c..7f4e809 100644 (file)
@@ -129,7 +129,7 @@ void pd_point_from_soft(struct Scene *scene, float *loc, float *vel, int index,
 
 /* needed for boids */
 float effector_falloff(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, struct EffectorWeights *weights);
-int closest_point_on_surface(struct SurfaceModifierData *surmd, float *co, float *surface_co, float *surface_nor, float *surface_vel);
+int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3]);
 int get_effector_data(struct EffectorCache *eff, struct EffectorData *efd, struct EffectedPoint *point, int real_velocity);
 
 /* required for particle_system.c */
index 712341c..2ef942a 100644 (file)
@@ -87,7 +87,6 @@ void set_mblur_offs(float blur);
 void set_field_offs(float field);
 void disable_speed_curve(int val);
 
-float bsystem_time(struct Scene *scene, struct Object *ob, float cfra, float ofs);
 void object_scale_to_mat3(struct Object *ob, float mat[][3]);
 void object_rot_to_mat3(struct Object *ob, float mat[][3]);
 void object_mat3_to_rot(struct Object *ob, float mat[][3], short use_compat);
@@ -109,7 +108,7 @@ struct BoundBox *object_get_boundbox(struct Object *ob);
 void object_get_dimensions(struct Object *ob, float *value);
 void object_set_dimensions(struct Object *ob, const float *value);
 void object_boundbox_flag(struct Object *ob, int flag, int set);
-void minmax_object(struct Object *ob, float *min, float *max);
+void minmax_object(struct Object *ob, float min[3], float max[3]);
 int minmax_object_duplis(struct Scene *scene, struct Object *ob, float *min, float *max);
 void solve_tracking (struct Object *ob, float targetmat[][4]);
 int ray_hit_boundbox(struct BoundBox *bb, float ray_start[3], float ray_normal[3]);
@@ -120,7 +119,6 @@ void object_tfm_restore(struct Object *ob, void *obtfm_pt);
 void object_handle_update(struct Scene *scene, struct Object *ob);
 void object_sculpt_modifiers_changed(struct Object *ob);
 
-float give_timeoffset(struct Object *ob);
 int give_obdata_texspace(struct Object *ob, short **texflag, float **loc, float **size, float **rot);
 
 int object_insert_ptcache(struct Object *ob);
index c4284d2..c66e49f 100644 (file)
@@ -254,8 +254,8 @@ void psys_render_restore(struct Object *ob, struct ParticleSystem *psys);
 int psys_render_simplify_distribution(struct ParticleThreadContext *ctx, int tot);
 int psys_render_simplify_params(struct ParticleSystem *psys, struct ChildParticle *cpa, float *params);
 
-void psys_interpolate_uvs(struct MTFace *tface, int quad, float *uv, float *uvco);
-void psys_interpolate_mcol(struct MCol *mcol, int quad, float *uv, struct MCol *mc);
+void psys_interpolate_uvs(const struct MTFace *tface, int quad, const float w[4], float uvco[2]);
+void psys_interpolate_mcol(const struct MCol *mcol, int quad, const float w[4], struct MCol *mc);
 
 void copy_particle_key(struct ParticleKey *to, struct ParticleKey *from, int time);
 
@@ -335,12 +335,12 @@ void psys_get_from_key(struct ParticleKey *key, float *loc, float *vel, float *r
 
 /* BLI_bvhtree_ray_cast callback */
 void BKE_psys_collision_neartest_cb(void *userdata, int index, const struct BVHTreeRay *ray, struct BVHTreeRayHit *hit);
-void psys_particle_on_dm(struct DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor);
+void psys_particle_on_dm(struct DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3], float ornor[3]);
 
 /* particle_system.c */
 void initialize_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, int p);
 void psys_calc_dmcache(struct Object *ob, struct DerivedMesh *dm, struct ParticleSystem *psys);
-int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, float *fw, struct LinkNode *node);
+int psys_particle_dm_face_lookup(struct Object *ob, struct DerivedMesh *dm, int index, const float fw[4], struct LinkNode *node);
 
 void reset_particle(struct ParticleSimulationData *sim, struct ParticleData *pa, float dtime, float cfra);
 
index 4806a28..ad394f9 100644 (file)
@@ -86,6 +86,7 @@ void scene_select_base(struct Scene *sce, struct Base *selbase);
 int scene_check_setscene(struct Main *bmain, struct Scene *sce);
 
 float BKE_curframe(struct Scene *scene);
+float BKE_frame_to_ctime(struct Scene *scene, const float frame);
 
 void scene_update_tagged(struct Main *bmain, struct Scene *sce);
 void scene_clear_tagged(struct Main *bmain, struct Scene *sce);
index bd1919c..0d97c9e 100644 (file)
@@ -292,7 +292,7 @@ void DM_to_meshkey(DerivedMesh *dm, Mesh *me, KeyBlock *kb)
        mvert=dm->getVertDataArray(dm, CD_MVERT);
        
        for(a=0; a<kb->totelem; a++, fp+=3, mvert++) {
-               VECCOPY(fp, mvert->co);
+               copy_v3_v3(fp, mvert->co);
        }
 }
 
@@ -604,12 +604,12 @@ static void emDM_drawUVEdges(DerivedMesh *dm)
 static void emDM__calcFaceCent(EditFace *efa, float cent[3], float (*vertexCos)[3])
 {
        if (vertexCos) {
-               VECCOPY(cent, vertexCos[(int) efa->v1->tmp.l]);
+               copy_v3_v3(cent, vertexCos[(int) efa->v1->tmp.l]);
                add_v3_v3(cent, vertexCos[(int) efa->v2->tmp.l]);
                add_v3_v3(cent, vertexCos[(int) efa->v3->tmp.l]);
                if (efa->v4) add_v3_v3(cent, vertexCos[(int) efa->v4->tmp.l]);
        } else {
-               VECCOPY(cent, efa->v1->co);
+               copy_v3_v3(cent, efa->v1->co);
                add_v3_v3(cent, efa->v2->co);
                add_v3_v3(cent, efa->v3->co);
                if (efa->v4) add_v3_v3(cent, efa->v4->co);
@@ -1184,7 +1184,7 @@ static void emDM_getVert(DerivedMesh *dm, int index, MVert *vert_r)
 
        for(i = 0; i < index; ++i) ev = ev->next;
 
-       VECCOPY(vert_r->co, ev->co);
+       copy_v3_v3(vert_r->co, ev->co);
 
        normal_float_to_short_v3(vert_r->no, ev->no);
 
@@ -1540,8 +1540,9 @@ static float *get_editmesh_orco_verts(EditMesh *em)
        
        orco = MEM_mallocN(sizeof(float)*3*totvert, "EditMesh Orco");
 
-       for(a=0, eve=em->verts.first; eve; eve=eve->next, a+=3)
-               VECCOPY(orco+a, eve->co);
+       for(a=0, eve=em->verts.first; eve; eve=eve->next, a+=3) {
+               copy_v3_v3(orco+a, eve->co);
+       }
        
        return orco;
 }
@@ -2147,7 +2148,7 @@ float (*editmesh_get_vertex_cos(EditMesh *em, int *numVerts_r))[3]
 
        cos = MEM_mallocN(sizeof(*cos)*numVerts, "vertexcos");
        for (i=0,eve=em->verts.first; i<numVerts; i++,eve=eve->next) {
-               VECCOPY(cos[i], eve->co);
+               copy_v3_v3(cos[i], eve->co);
        }
 
        return cos;
@@ -2655,7 +2656,7 @@ static void GetPosition(const SMikkTSpaceContext * pContext, float fPos[], const
        //assert(vert_index>=0 && vert_index<4);
        SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
        const float *co= pMesh->mvert[(&pMesh->mface[face_num].v1)[vert_index]].co;
-       VECCOPY(fPos, co);
+       copy_v3_v3(fPos, co);
 }
 
 static void GetTextureCoordinate(const SMikkTSpaceContext * pContext, float fUV[], const int face_num, const int vert_index)
@@ -2681,7 +2682,7 @@ static void GetNormal(const SMikkTSpaceContext * pContext, float fNorm[], const
        const int smoothnormal = (pMesh->mface[face_num].flag & ME_SMOOTH);
        if(!smoothnormal) {     // flat
                if(pMesh->precomputedFaceNormals) {
-                       VECCOPY(fNorm, &pMesh->precomputedFaceNormals[3*face_num]);
+                       copy_v3_v3(fNorm, &pMesh->precomputedFaceNormals[3*face_num]);
                }
                else {
                        MFace *mf= &pMesh->mface[face_num];
@@ -2708,7 +2709,7 @@ static void SetTSpace(const SMikkTSpaceContext * pContext, const float fvTangent
        //assert(vert_index>=0 && vert_index<4);
        SGLSLMeshToTangent * pMesh = (SGLSLMeshToTangent *) pContext->m_pUserData;
        float * pRes = pMesh->tangent[4*face_num+iVert];
-       VECCOPY(pRes, fvTangent);
+       copy_v3_v3(pRes, fvTangent);
        pRes[3]=fSign;
 }
 
index f939c16..c1f294f 100644 (file)
@@ -1230,7 +1230,7 @@ static void new_particle_duplilist(ListBase *lb, ID *id, Scene *scene, Object *p
        if(G.rendering == 0)
                no_draw_flag |= PARS_NO_DISP;
        
-       ctime = bsystem_time(scene, par, (float)scene->r.cfra, 0.0);
+       ctime = BKE_curframe(scene); /* NOTE: in old animsys, used parent object's timeoffset... */
 
        totpart = psys->totpart;
        totchild = psys->totchild;
index e9a19b5..f19ed85 100644 (file)
@@ -68,6 +68,7 @@
 #include "BKE_lattice.h"
 #include "BKE_main.h"
 #include "BKE_object.h"
+#include "BKE_scene.h"
 
 #include "BIK_api.h"
 #include "BKE_sketch.h"
@@ -2406,7 +2407,7 @@ void where_is_pose (Scene *scene, Object *ob)
        if((ob->pose==NULL) || (ob->pose->flag & POSE_RECALC)) 
                armature_rebuild_pose(ob, arm);
           
-       ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0);      /* not accurate... */
+       ctime= BKE_curframe(scene);     /* not accurate... */
        
        /* In editmode or restposition we read the data from the bones */
        if(arm->edbo || (arm->flag & ARM_RESTPOS)) {
index 3ae81c7..c9868bd 100644 (file)
@@ -162,7 +162,7 @@ static int rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val,
                        negate_v3_v3(efd.vec_to_point, bpa->gravity);
                }
 
-               VECCOPY(bbd->wanted_co, efd.vec_to_point);
+               copy_v3_v3(bbd->wanted_co, efd.vec_to_point);
                mul_v3_fl(bbd->wanted_co, mul);
 
                bbd->wanted_speed = val->max_speed * priority;
@@ -204,7 +204,7 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
                BVHTreeRayHit hit;
                float radius = val->personal_space * pa->size, ray_dir[3];
 
-               VECCOPY(col.co1, pa->prev_state.co);
+               copy_v3_v3(col.co1, pa->prev_state.co);
                add_v3_v3v3(col.co2, pa->prev_state.co, pa->prev_state.vel);
                sub_v3_v3v3(ray_dir, col.co2, col.co1);
                mul_v3_fl(ray_dir, acbr->look_ahead);
@@ -254,10 +254,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
        {
                neighbors = BLI_kdtree_range_search(bbd->sim->psys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
                if(neighbors > 1) for(n=1; n<neighbors; n++) {
-                       VECCOPY(co1, pa->prev_state.co);
-                       VECCOPY(vel1, pa->prev_state.vel);
-                       VECCOPY(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
-                       VECCOPY(vel2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.vel);
+                       copy_v3_v3(co1, pa->prev_state.co);
+                       copy_v3_v3(vel1, pa->prev_state.vel);
+                       copy_v3_v3(co2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.co);
+                       copy_v3_v3(vel2, (bbd->sim->psys->particles + ptn[n].index)->prev_state.vel);
 
                        sub_v3_v3v3(loc, co1, co2);
 
@@ -270,8 +270,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
                                t = -dot_v3v3(loc, vec)/inp;
                                /* cpa is not too far in the future so investigate further */
                                if(t > 0.0f && t < t_min) {
-                                       VECADDFAC(co1, co1, vel1, t);
-                                       VECADDFAC(co2, co2, vel2, t);
+                                       madd_v3_v3fl(co1, vel1, t);
+                                       madd_v3_v3fl(co2, vel2, t);
                                        
                                        sub_v3_v3v3(vec, co2, co1);
 
@@ -300,10 +300,10 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
                if(epsys) {
                        neighbors = BLI_kdtree_range_search(epsys->tree, acbr->look_ahead * len_v3(pa->prev_state.vel), pa->prev_state.co, pa->prev_state.ave, &ptn);
                        if(neighbors > 0) for(n=0; n<neighbors; n++) {
-                               VECCOPY(co1, pa->prev_state.co);
-                               VECCOPY(vel1, pa->prev_state.vel);
-                               VECCOPY(co2, (epsys->particles + ptn[n].index)->prev_state.co);
-                               VECCOPY(vel2, (epsys->particles + ptn[n].index)->prev_state.vel);
+                               copy_v3_v3(co1, pa->prev_state.co);
+                               copy_v3_v3(vel1, pa->prev_state.vel);
+                               copy_v3_v3(co2, (epsys->particles + ptn[n].index)->prev_state.co);
+                               copy_v3_v3(vel2, (epsys->particles + ptn[n].index)->prev_state.vel);
 
                                sub_v3_v3v3(loc, co1, co2);
 
@@ -316,8 +316,8 @@ static int rule_avoid_collision(BoidRule *rule, BoidBrainData *bbd, BoidValues *
                                        t = -dot_v3v3(loc, vec)/inp;
                                        /* cpa is not too far in the future so investigate further */
                                        if(t > 0.0f && t < t_min) {
-                                               VECADDFAC(co1, co1, vel1, t);
-                                               VECADDFAC(co2, co2, vel2, t);
+                                               madd_v3_v3fl(co1, vel1, t);
+                                               madd_v3_v3fl(co2, vel2, t);
                                                
                                                sub_v3_v3v3(vec, co2, co1);
 
@@ -439,7 +439,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
                        len = len_v3(loc);
                        /* too close to leader */
                        if(len < 2.0f * val->personal_space * pa->size) {
-                               VECCOPY(bbd->wanted_co, loc);
+                               copy_v3_v3(bbd->wanted_co, loc);
                                bbd->wanted_speed = val->max_speed;
                                return 1;
                        }
@@ -449,7 +449,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                        /* possible blocking of leader in near future */
                        if(t > 0.0f && t < 3.0f) {
-                               VECCOPY(vec2, vec);
+                               copy_v3_v3(vec2, vec);
                                mul_v3_fl(vec2, t);
 
                                sub_v3_v3v3(vec2, loc, vec2);
@@ -457,7 +457,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
                                len = len_v3(vec2);
 
                                if(len < 2.0f * val->personal_space * pa->size) {
-                                       VECCOPY(bbd->wanted_co, vec2);
+                                       copy_v3_v3(bbd->wanted_co, vec2);
                                        bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f;
                                        return 1;
                                }
@@ -466,17 +466,17 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                /* not blocking so try to follow leader */
                if(p && flbr->options & BRULE_LEADER_IN_LINE) {
-                       VECCOPY(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
-                       VECCOPY(loc, bbd->sim->psys->particles[p-1].prev_state.co);
+                       copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
+                       copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co);
                }
                else {
-                       VECCOPY(loc, flbr->oloc);
+                       copy_v3_v3(loc, flbr->oloc);
                        sub_v3_v3v3(vec, flbr->loc, flbr->oloc);
                        mul_v3_fl(vec, 1.0f/bbd->timestep);
                }
                
                /* fac is seconds behind leader */
-               VECADDFAC(loc, loc, vec, -flbr->distance);
+               madd_v3_v3fl(loc, vec, -flbr->distance);
 
                sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co);
                bbd->wanted_speed = len_v3(bbd->wanted_co);
@@ -488,7 +488,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                /* first check we're not blocking any leaders */
                for(i = 0; i< bbd->sim->psys->totpart; i+=n){
-                       VECCOPY(vec, bbd->sim->psys->particles[i].prev_state.vel);
+                       copy_v3_v3(vec, bbd->sim->psys->particles[i].prev_state.vel);
 
                        sub_v3_v3v3(loc, pa->prev_state.co, bbd->sim->psys->particles[i].prev_state.co);
 
@@ -499,7 +499,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
                                len = len_v3(loc);
                                /* too close to leader */
                                if(len < 2.0f * val->personal_space * pa->size) {
-                                       VECCOPY(bbd->wanted_co, loc);
+                                       copy_v3_v3(bbd->wanted_co, loc);
                                        bbd->wanted_speed = val->max_speed;
                                        return 1;
                                }
@@ -509,7 +509,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                                /* possible blocking of leader in near future */
                                if(t > 0.0f && t < t_min) {
-                                       VECCOPY(vec2, vec);
+                                       copy_v3_v3(vec2, vec);
                                        mul_v3_fl(vec2, t);
 
                                        sub_v3_v3v3(vec2, loc, vec2);
@@ -518,7 +518,7 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                                        if(len < 2.0f * val->personal_space * pa->size) {
                                                t_min = t;
-                                               VECCOPY(bbd->wanted_co, loc);
+                                               copy_v3_v3(bbd->wanted_co, loc);
                                                bbd->wanted_speed = val->max_speed * (3.0f - t)/3.0f;
                                                ret = 1;
                                        }
@@ -530,16 +530,16 @@ static int rule_follow_leader(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                /* not blocking so try to follow leader */
                if(flbr->options & BRULE_LEADER_IN_LINE) {
-                       VECCOPY(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
-                       VECCOPY(loc, bbd->sim->psys->particles[p-1].prev_state.co);
+                       copy_v3_v3(vec, bbd->sim->psys->particles[p-1].prev_state.vel);
+                       copy_v3_v3(loc, bbd->sim->psys->particles[p-1].prev_state.co);
                }
                else {
-                       VECCOPY(vec, bbd->sim->psys->particles[p - p%n].prev_state.vel);
-                       VECCOPY(loc, bbd->sim->psys->particles[p - p%n].prev_state.co);
+                       copy_v3_v3(vec, bbd->sim->psys->particles[p - p%n].prev_state.vel);
+                       copy_v3_v3(loc, bbd->sim->psys->particles[p - p%n].prev_state.co);
                }
                
                /* fac is seconds behind leader */
-               VECADDFAC(loc, loc, vec, -flbr->distance);
+               madd_v3_v3fl(loc, vec, -flbr->distance);
 
                sub_v3_v3v3(bbd->wanted_co, loc, pa->prev_state.co);
                bbd->wanted_speed = len_v3(bbd->wanted_co);
@@ -563,11 +563,11 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
 
                normalize_v3(bpa->wander);
 
-               VECCOPY(vec, bpa->wander);
+               copy_v3_v3(vec, bpa->wander);
 
                mul_qt_v3(pa->prev_state.rot, vec);
 
-               VECCOPY(bbd->wanted_co, pa->prev_state.ave);
+               copy_v3_v3(bbd->wanted_co, pa->prev_state.ave);
 
                mul_v3_fl(bbd->wanted_co, 1.1f);
 
@@ -581,7 +581,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va
                }
        }
        else {
-               VECCOPY(bbd->wanted_co, pa->prev_state.ave);
+               copy_v3_v3(bbd->wanted_co, pa->prev_state.ave);
 
                /* may happen at birth */
                if(dot_v2v2(bbd->wanted_co,bbd->wanted_co)==0.0f) {
@@ -643,7 +643,7 @@ static int rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti
                                health += bpa->data.health;
 
                                if(n==0 && pt->mode==PTARGET_MODE_ENEMY && ptn[n].dist < closest_dist) {
-                                       VECCOPY(closest_enemy, ptn[n].co);
+                                       copy_v3_v3(closest_enemy, ptn[n].co);
                                        closest_dist = ptn[n].dist;
                                        enemy_pa = epars + ptn[n].index;
                                }
@@ -741,7 +741,7 @@ static void set_boid_values(BoidValues *val, BoidSettings *boids, ParticleData *
        }
 }
 
-static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *ground_co, float *ground_nor)
+static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float ground_co[3], float ground_nor[3])
 {
        BoidParticle *bpa = pa->boid;
 
@@ -820,7 +820,7 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro
                }
 
                /* default to z=0 */
-               VECCOPY(ground_co, pa->state.co);
+               copy_v3_v3(ground_co, pa->state.co);
                ground_co[2] = 0;
                ground_nor[0] = ground_nor[1] = 0.0f;
                ground_nor[2] = 1.0f;
@@ -853,8 +853,8 @@ void boids_precalc_rules(ParticleSettings *part, float cfra)
 
                                if(flbr->ob && flbr->cfra != cfra) {
                                        /* save object locations for velocity calculations */
-                                       VECCOPY(flbr->oloc, flbr->loc);
-                                       VECCOPY(flbr->loc, flbr->ob->obmat[3]);
+                                       copy_v3_v3(flbr->oloc, flbr->loc);
+                                       copy_v3_v3(flbr->loc, flbr->ob->obmat[3]);
                                        flbr->cfra = cfra;
                                }
                        }
@@ -868,7 +868,7 @@ static void boid_climb(BoidSettings *boids, ParticleData *pa, float *surface_co,
        copy_v3_v3(nor, surface_nor);
 
        /* gather apparent gravity */
-       VECADDFAC(bpa->gravity, bpa->gravity, surface_nor, -1.0f);
+       madd_v3_v3fl(bpa->gravity, surface_nor, -1.0f);
        normalize_v3(bpa->gravity);
 
        /* raise boid it's size from surface */
@@ -997,7 +997,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                                wanted_speed /= (float)n;
                        }
 
-                       VECCOPY(bbd->wanted_co, wanted_co);
+                       copy_v3_v3(bbd->wanted_co, wanted_co);
                        bbd->wanted_speed = wanted_speed;
                        break;
                }
@@ -1012,10 +1012,10 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                if(boids->options & BOID_ALLOW_FLIGHT && bbd->wanted_co[2] > 0.0f) {
                        float cvel[3], dir[3];
 
-                       VECCOPY(dir, pa->prev_state.ave);
+                       copy_v3_v3(dir, pa->prev_state.ave);
                        normalize_v2(dir);
 
-                       VECCOPY(cvel, bbd->wanted_co);
+                       copy_v3_v3(cvel, bbd->wanted_co);
                        normalize_v2(cvel);
 
                        if(dot_v2v2(cvel, dir) > 0.95f / mul)
@@ -1031,10 +1031,10 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                                float z_v, ground_v, cur_v;
                                float len;
 
-                               VECCOPY(dir, pa->prev_state.ave);
+                               copy_v3_v3(dir, pa->prev_state.ave);
                                normalize_v2(dir);
 
-                               VECCOPY(cvel, bbd->wanted_co);
+                               copy_v3_v3(cvel, bbd->wanted_co);
                                normalize_v2(cvel);
 
                                len = len_v2(pa->prev_state.vel);
@@ -1054,7 +1054,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
 
                                                len = MIN2(len, val.jump_speed);
 
-                                               VECCOPY(jump_v, dir);
+                                               copy_v3_v3(jump_v, dir);
                                                jump_v[2] = z_v;
                                                mul_v3_fl(jump_v, ground_v);
 
@@ -1071,7 +1071,7 @@ void boid_brain(BoidBrainData *bbd, int p, ParticleData *pa)
                        }
 
                        if(jump) {
-                               VECCOPY(pa->prev_state.vel, jump_v);
+                               copy_v3_v3(pa->prev_state.vel, jump_v);
                                bpa->data.mode = eBoidMode_Falling;
                        }
                }
@@ -1143,12 +1143,12 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                        }
                }
 
-               VECCOPY(old_dir, pa->prev_state.ave);
+               copy_v3_v3(old_dir, pa->prev_state.ave);
                new_speed = normalize_v3_v3(wanted_dir, bbd->wanted_co);
 
                /* first check if we have valid direction we want to go towards */
                if(new_speed == 0.0f) {
-                       VECCOPY(new_dir, old_dir);
+                       copy_v3_v3(new_dir, old_dir);
                }
                else {
                        float old_dir2[2], wanted_dir2[2], nor[3], angle;
@@ -1172,13 +1172,13 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
                        cross_v3_v3v3(nor, old_dir, wanted_dir);
                        axis_angle_to_quat( q,nor, angle);
-                       VECCOPY(new_dir, old_dir);
+                       copy_v3_v3(new_dir, old_dir);
                        mul_qt_v3(q, new_dir);
                        normalize_v3(new_dir);
 
                        /* save direction in case resulting velocity too small */
                        axis_angle_to_quat( q,nor, angle*dtime);
-                       VECCOPY(pa->state.ave, old_dir);
+                       copy_v3_v3(pa->state.ave, old_dir);
                        mul_qt_v3(q, pa->state.ave);
                        normalize_v3(pa->state.ave);
                }
@@ -1192,7 +1192,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                        new_speed = MIN2(bbd->wanted_speed, old_speed + val.max_acc);
 
                /* combine direction and speed */
-               VECCOPY(new_vel, new_dir);
+               copy_v3_v3(new_vel, new_dir);
                mul_v3_fl(new_vel, new_speed);
 
                /* maintain minimum flying velocity if not landing */
@@ -1236,7 +1236,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        add_v3_v3(acc, force);
 
        /* store smoothed acceleration for nice banking etc. */
-       VECADDFAC(bpa->data.acc, bpa->data.acc, acc, dtime);
+       madd_v3_v3fl(bpa->data.acc, acc, dtime);
        mul_v3_fl(bpa->data.acc, 1.0f / (1.0f + dtime));
 
        /* integrate new location & velocity */
@@ -1245,15 +1245,15 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
        /* can get better control allthough it's a bit unphysical       */
        mul_v3_fl(acc, 1.0f/pa_mass);
 
-       VECCOPY(dvec, acc);
+       copy_v3_v3(dvec, acc);
        mul_v3_fl(dvec, dtime*dtime*0.5f);
        
-       VECCOPY(bvec, pa->prev_state.vel);
+       copy_v3_v3(bvec, pa->prev_state.vel);
        mul_v3_fl(bvec, dtime);
        add_v3_v3(dvec, bvec);
        add_v3_v3(pa->state.co, dvec);
 
-       VECADDFAC(pa->state.vel, pa->state.vel, acc, dtime);
+       madd_v3_v3fl(pa->state.vel, acc, dtime);
 
        //if(bpa->data.mode != eBoidMode_InAir)
        bpa->ground = boid_find_ground(bbd, pa, ground_co, ground_nor);
@@ -1274,11 +1274,11 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                sub_v3_v3v3(dvec, bpa->data.acc, dvec);
                        }
                        else {
-                               VECCOPY(dvec, bpa->data.acc);
+                               copy_v3_v3(dvec, bpa->data.acc);
                        }
 
                        /* gather apparent gravity */
-                       VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
+                       madd_v3_v3v3fl(bpa->gravity, grav, dvec, -boids->banking);
                        normalize_v3(bpa->gravity);
 
                        /* stick boid on goal when close enough */
@@ -1313,7 +1313,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
 
                        /* gather apparent gravity */
-                       VECADDFAC(bpa->gravity, bpa->gravity, grav, dtime);
+                       madd_v3_v3fl(bpa->gravity, grav, dtime);
                        normalize_v3(bpa->gravity);
 
                        if(boids->options & BOID_ALLOW_LAND) {
@@ -1345,7 +1345,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                        //copy_v3_v3(nor, ground_nor);
 
                        ///* gather apparent gravity to r_ve */
-                       //VECADDFAC(pa->r_ve, pa->r_ve, ground_nor, -1.0);
+                       //madd_v3_v3fl(pa->r_ve, ground_nor, -1.0);
                        //normalize_v3(pa->r_ve);
 
                        ///* raise boid it's size from surface */
@@ -1385,12 +1385,12 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                                sub_v3_v3v3(dvec, bpa->data.acc, dvec);
 
                                /* gather apparent gravity */
-                               VECADDFAC(bpa->gravity, grav, dvec, -boids->banking);
+                               madd_v3_v3v3fl(bpa->gravity, grav, dvec, -boids->banking);
                                normalize_v3(bpa->gravity);
                        }
                        else {
                                /* gather negative surface normal */
-                               VECADDFAC(bpa->gravity, bpa->gravity, ground_nor, -1.0f);
+                               madd_v3_v3fl(bpa->gravity, ground_nor, -1.0f);
                                normalize_v3(bpa->gravity);
                        }
                        break;
@@ -1411,7 +1411,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
 
        /* calculate rotation matrix based on forward & down vectors */
        if(bpa->data.mode == eBoidMode_InAir) {
-               VECCOPY(mat[0], pa->state.ave);
+               copy_v3_v3(mat[0], pa->state.ave);
 
                project_v3_v3v3(dvec, bpa->gravity, pa->state.ave);
                sub_v3_v3v3(mat[2], bpa->gravity, dvec);
@@ -1422,7 +1422,7 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa)
                sub_v3_v3v3(mat[0], pa->state.ave, dvec);
                normalize_v3(mat[0]);
 
-               VECCOPY(mat[2], bpa->gravity);
+               copy_v3_v3(mat[2], bpa->gravity);
        }
        negate_v3(mat[2]);
        cross_v3_v3v3(mat[1], mat[2], mat[0]);
index ee160a1..1a27a64 100644 (file)
 
 /* Math stuff for ray casting on mesh faces and for nearest surface */
 
-static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float *v0, const float *v1, const float *v2)
+static float ray_tri_intersection(const BVHTreeRay *ray, const float UNUSED(m_dist), const float v0[3], const float v1[3], const float v2[3])
 {
        float dist;
 
-       if(isect_ray_tri_v3((float*)ray->origin, (float*)ray->direction, (float*)v0, (float*)v1, (float*)v2, &dist, NULL))
+       if(isect_ray_tri_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL))
                return dist;
 
        return FLT_MAX;
 }
 
-static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float *v0, const float *v1, const float *v2)
+static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, const float m_dist, const float v0[3], const float v1[3], const float v2[3])
 {
        
        float idist;
        float p1[3];
        float plane_normal[3], hit_point[3];
 
-       normal_tri_v3( plane_normal,(float*)v0, (float*)v1, (float*)v2);
+       normal_tri_v3(plane_normal, v0, v1, v2);
 
-       VECADDFAC( p1, ray->origin, ray->direction, m_dist);
-       if(isect_sweeping_sphere_tri_v3((float*)ray->origin, p1, radius, (float*)v0, (float*)v1, (float*)v2, &idist, hit_point))
+       madd_v3_v3v3fl(p1, ray->origin, ray->direction, m_dist);
+       if(isect_sweeping_sphere_tri_v3(ray->origin, p1, radius, v0, v1, v2, &idist, hit_point))
        {
                return idist * m_dist;
        }
@@ -81,7 +81,7 @@ static float sphereray_tri_intersection(const BVHTreeRay *ray, float radius, con
  * Function adapted from David Eberly's distance tools (LGPL)
  * http://www.geometrictools.com/LibFoundation/Distance/Distance.html
  */
-static float nearest_point_in_tri_surface(const float *v0,const float *v1,const float *v2,const float *p, int *v, int *e, float *nearest )
+static float nearest_point_in_tri_surface(const float v0[3], const float v1[3], const float v2[3], const float p[3], int *v, int *e, float nearest[3])
 {
        float diff[3];
        float e0[3];
@@ -98,16 +98,16 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
        float sqrDist;
        int lv = -1, le = -1;
        
-       VECSUB(diff, v0, p);
-       VECSUB(e0, v1, v0);
-       VECSUB(e1, v2, v0);
+       sub_v3_v3v3(diff, v0, p);
+       sub_v3_v3v3(e0, v1, v0);
+       sub_v3_v3v3(e1, v2, v0);
        
-       A00 = INPR ( e0, e0 );
-       A01 = INPR( e0, e1 );
-       A11 = INPR ( e1, e1 );
-       B0 = INPR( diff, e0 );
-       B1 = INPR( diff, e1 );
-       C = INPR( diff, diff );
+       A00 = dot_v3v3(e0, e0);
+       A01 = dot_v3v3(e0, e1 );
+       A11 = dot_v3v3(e1, e1 );
+       B0 = dot_v3v3(diff, e0 );
+       B1 = dot_v3v3(diff, e1 );
+       C = dot_v3v3(diff, diff );
        Det = fabs( A00 * A11 - A01 * A01 );
        S = A01 * B1 - A11 * B0;
        T = A01 * B0 - A00 * B1;
@@ -123,7 +123,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
                                        T = 0.0f;
                                        if ( -B0 >= A00 )
                                        {
-                                               S = (float)1.0;
+                                               S = 1.0f;
                                                sqrDist = A00 + 2.0f * B0 + C;
                                                lv = 1;
                                        }
@@ -379,15 +379,15 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
        
        {
                float w[3], x[3], y[3], z[3];
-               VECCOPY(w, v0);
-               VECCOPY(x, e0);
+               copy_v3_v3(w, v0);
+               copy_v3_v3(x, e0);
                mul_v3_fl(x, S);
-               VECCOPY(y, e1);
+               copy_v3_v3(y, e1);
                mul_v3_fl(y, T);
-               VECADD(z, w, x);
-               VECADD(z, z, y);
-               //VECSUB(d, p, z);
-               VECCOPY(nearest, z);
+               add_v3_v3v3(z, w, x);
+               add_v3_v3v3(z, z, y);
+               //sub_v3_v3v3(d, p, z);
+               copy_v3_v3(nearest, z);
                // d = p - ( v0 + S * e0 + T * e1 );
        }
        *v = lv;
@@ -403,7 +403,7 @@ static float nearest_point_in_tri_surface(const float *v0,const float *v1,const
 
 // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_faces.
 // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
-static void mesh_faces_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest)
+static void mesh_faces_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
 {
        const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata;
        MVert *vert     = data->vert;
@@ -426,7 +426,7 @@ static void mesh_faces_nearest_point(void *userdata, int index, const float *co,
                {
                        nearest->index = index;
                        nearest->dist = dist;
-                       VECCOPY(nearest->co, nearest_tmp);
+                       copy_v3_v3(nearest->co, nearest_tmp);
                        normal_tri_v3( nearest->no,t0, t1, t2);
                }
 
@@ -464,7 +464,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
                {
                        hit->index = index;
                        hit->dist = dist;
-                       VECADDFAC(hit->co, ray->origin, ray->direction, dist);
+                       madd_v3_v3v3fl(hit->co, ray->origin, ray->direction, dist);
 
                        normal_tri_v3( hit->no,t0, t1, t2);
                }
@@ -478,7 +478,7 @@ static void mesh_faces_spherecast(void *userdata, int index, const BVHTreeRay *r
 
 // Callback to bvh tree nearest point. The tree must bust have been built using bvhtree_from_mesh_edges.
 // userdata must be a BVHMeshCallbackUserdata built from the same mesh as the tree.
-static void mesh_edges_nearest_point(void *userdata, int index, const float *co, BVHTreeNearest *nearest)
+static void mesh_edges_nearest_point(void *userdata, int index, const float co[3], BVHTreeNearest *nearest)
 {
        const BVHTreeFromMesh *data = (BVHTreeFromMesh*) userdata;
        MVert *vert     = data->vert;
@@ -488,16 +488,15 @@ static void mesh_edges_nearest_point(void *userdata, int index, const float *co,
        float *t0, *t1;
        t0 = vert[ edge->v1 ].co;
        t1 = vert[ edge->v2 ].co;
-       
-       // NOTE: casts to "float*" here are due to co being "const float*"
-       closest_to_line_segment_v3(nearest_tmp, (float*)co, t0, t1);
-       dist = len_squared_v3v3(nearest_tmp, (float*)co);
+
+       closest_to_line_segment_v3(nearest_tmp, co, t0, t1);
+       dist = len_squared_v3v3(nearest_tmp, co);
        
        if(dist < nearest->dist)
        {
                nearest->index = index;
                nearest->dist = dist;
-               VECCOPY(nearest->co, nearest_tmp);
+               copy_v3_v3(nearest->co, nearest_tmp);
                sub_v3_v3v3(nearest->no, t0, t1);
                normalize_v3(nearest->no);
        }
@@ -590,11 +589,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                                        for(i = 0; i < numFaces; i++, efa= efa->next) {
                                                if(!(efa->f & 1) && efa->h==0 && !((efa->v1->f&1)+(efa->v2->f&1)+(efa->v3->f&1)+(efa->v4?efa->v4->f&1:0))) {
                                                        float co[4][3];
-                                                       VECCOPY(co[0], vert[ face[i].v1 ].co);
-                                                       VECCOPY(co[1], vert[ face[i].v2 ].co);
-                                                       VECCOPY(co[2], vert[ face[i].v3 ].co);
+                                                       copy_v3_v3(co[0], vert[ face[i].v1 ].co);
+                                                       copy_v3_v3(co[1], vert[ face[i].v2 ].co);
+                                                       copy_v3_v3(co[2], vert[ face[i].v3 ].co);
                                                        if(face[i].v4)
-                                                               VECCOPY(co[3], vert[ face[i].v4 ].co);
+                                                               copy_v3_v3(co[3], vert[ face[i].v4 ].co);
                                        
                                                        BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3);
                                                }
@@ -603,11 +602,11 @@ BVHTree* bvhtree_from_mesh_faces(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                                else {
                                        for(i = 0; i < numFaces; i++) {
                                                float co[4][3];
-                                               VECCOPY(co[0], vert[ face[i].v1 ].co);
-                                               VECCOPY(co[1], vert[ face[i].v2 ].co);
-                                               VECCOPY(co[2], vert[ face[i].v3 ].co);
+                                               copy_v3_v3(co[0], vert[ face[i].v1 ].co);
+                                               copy_v3_v3(co[1], vert[ face[i].v2 ].co);
+                                               copy_v3_v3(co[2], vert[ face[i].v3 ].co);
                                                if(face[i].v4)
-                                                       VECCOPY(co[3], vert[ face[i].v4 ].co);
+                                                       copy_v3_v3(co[3], vert[ face[i].v4 ].co);
                                
                                                BLI_bvhtree_insert(tree, i, co[0], face[i].v4 ? 4 : 3);
                                        }
@@ -669,8 +668,8 @@ BVHTree* bvhtree_from_mesh_edges(BVHTreeFromMesh *data, DerivedMesh *mesh, float
                                for(i = 0; i < numEdges; i++)
                                {
                                        float co[4][3];
-                                       VECCOPY(co[0], vert[ edge[i].v1 ].co);
-                                       VECCOPY(co[1], vert[ edge[i].v2 ].co);
+                                       copy_v3_v3(co[0], vert[ edge[i].v1 ].co);
+                                       copy_v3_v3(co[1], vert[ edge[i].v2 ].co);
                        
                                        BLI_bvhtree_insert(tree, i, co[0], 2);
                                }
index 444d17a..ae6a6ec 100644 (file)
@@ -190,7 +190,7 @@ static BVHTree *bvhselftree_build_from_cloth (ClothModifierData *clmd, float eps
        // fill tree
        for(i = 0; i < cloth->numverts; i++, verts++)
        {
-               VECCOPY(&co[0*3], verts->xold);
+               copy_v3_v3(&co[0*3], verts->xold);
                
                BLI_bvhtree_insert(bvhtree, i, co, 1);
        }
@@ -231,12 +231,12 @@ static BVHTree *bvhtree_build_from_cloth (ClothModifierData *clmd, float epsilon
        // fill tree
        for(i = 0; i < cloth->numfaces; i++, mfaces++)
        {
-               VECCOPY(&co[0*3], verts[mfaces->v1].xold);
-               VECCOPY(&co[1*3], verts[mfaces->v2].xold);
-               VECCOPY(&co[2*3], verts[mfaces->v3].xold);
+               copy_v3_v3(&co[0*3], verts[mfaces->v1].xold);
+               copy_v3_v3(&co[1*3], verts[mfaces->v2].xold);
+               copy_v3_v3(&co[2*3], verts[mfaces->v3].xold);
                
                if(mfaces->v4)
-                       VECCOPY(&co[3*3], verts[mfaces->v4].xold);
+                       copy_v3_v3(&co[3*3], verts[mfaces->v4].xold);
                
                BLI_bvhtree_insert(bvhtree, i, co, (mfaces->v4 ? 4 : 3));
        }
@@ -267,23 +267,23 @@ void bvhtree_update_from_cloth(ClothModifierData *clmd, int moving)
        {
                for(i = 0; i < cloth->numfaces; i++, mfaces++)
                {
-                       VECCOPY(&co[0*3], verts[mfaces->v1].txold);
-                       VECCOPY(&co[1*3], verts[mfaces->v2].txold);
-                       VECCOPY(&co[2*3], verts[mfaces->v3].txold);
+                       copy_v3_v3(&co[0*3], verts[mfaces->v1].txold);
+                       copy_v3_v3(&co[1*3], verts[mfaces->v2].txold);
+                       copy_v3_v3(&co[2*3], verts[mfaces->v3].txold);
                        
                        if(mfaces->v4)
-                               VECCOPY(&co[3*3], verts[mfaces->v4].txold);
+                               copy_v3_v3(&co[3*3], verts[mfaces->v4].txold);
                
                        // copy new locations into array
                        if(moving)
                        {
                                // update moving positions
-                               VECCOPY(&co_moving[0*3], verts[mfaces->v1].tx);
-                               VECCOPY(&co_moving[1*3], verts[mfaces->v2].tx);
-                               VECCOPY(&co_moving[2*3], verts[mfaces->v3].tx);
+                               copy_v3_v3(&co_moving[0*3], verts[mfaces->v1].tx);
+                               copy_v3_v3(&co_moving[1*3], verts[mfaces->v2].tx);
+                               copy_v3_v3(&co_moving[2*3], verts[mfaces->v3].tx);
                                
                                if(mfaces->v4)
-                                       VECCOPY(&co_moving[3*3], verts[mfaces->v4].tx);
+                                       copy_v3_v3(&co_moving[3*3], verts[mfaces->v4].tx);
                                
                                ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, (mfaces->v4 ? 4 : 3));
                        }
@@ -321,13 +321,13 @@ void bvhselftree_update_from_cloth(ClothModifierData *clmd, int moving)
        {
                for(i = 0; i < cloth->numverts; i++, verts++)
                {
-                       VECCOPY(&co[0*3], verts->txold);
+                       copy_v3_v3(&co[0*3], verts->txold);
                        
                        // copy new locations into array
                        if(moving)
                        {
                                // update moving positions
-                               VECCOPY(&co_moving[0*3], verts->tx);
+                               copy_v3_v3(&co_moving[0*3], verts->tx);
                                
                                ret = BLI_bvhtree_update_node(bvhtree, i, co, co_moving, 1);
                        }
@@ -399,11 +399,11 @@ static int do_step_cloth(Object *ob, ClothModifierData *clmd, DerivedMesh *resul
        /* force any pinned verts to their constrained location. */
        for(i = 0; i < clmd->clothObject->numverts; i++, verts++) {
                /* save the previous position. */
-               VECCOPY(verts->xold, verts->xconst);
-               VECCOPY(verts->txold, verts->x);
+               copy_v3_v3(verts->xold, verts->xconst);
+               copy_v3_v3(verts->txold, verts->x);
 
                /* Get the current position. */
-               VECCOPY(verts->xconst, mvert[i].co);
+               copy_v3_v3(verts->xconst, mvert[i].co);
                mul_m4_v3(ob->obmat, verts->xconst);
        }
 
@@ -712,7 +712,7 @@ static void cloth_to_object (Object *ob,  ClothModifierData *clmd, DerivedMesh *
 
                for (i = 0; i < numverts; i++)
                {
-                       VECCOPY (mvert[i].co, cloth->verts[i].x);
+                       copy_v3_v3 (mvert[i].co, cloth->verts[i].x);
                        mul_m4_v3(ob->imat, mvert[i].co);       /* cloth is in global coords */
                }
        }
@@ -880,14 +880,14 @@ static int cloth_from_object(Object *ob, ClothModifierData *clmd, DerivedMesh *d
                        verts->goal= 0.0f;
 
                verts->flags = 0;
-               VECCOPY ( verts->xold, verts->x );
-               VECCOPY ( verts->xconst, verts->x );
-               VECCOPY ( verts->txold, verts->x );
-               VECCOPY ( verts->tx, verts->x );
+               copy_v3_v3 ( verts->xold, verts->x );
+               copy_v3_v3 ( verts->xconst, verts->x );
+               copy_v3_v3 ( verts->txold, verts->x );
+               copy_v3_v3 ( verts->tx, verts->x );
                mul_v3_fl( verts->v, 0.0f );
 
                verts->impulse_count = 0;
-               VECCOPY ( verts->impulse, tnull );
+               copy_v3_v3 ( verts->impulse, tnull );
        }
        
        // apply / set vertex groups
@@ -1053,7 +1053,6 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
        LinkNode **edgelist = NULL;
        EdgeHash *edgehash = NULL;
        LinkNode *search = NULL, *search2 = NULL;
-       float temp[3];
        
        // error handling
        if ( numedges==0 )
@@ -1086,8 +1085,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
                {
                        spring->ij = MIN2(medge[i].v1, medge[i].v2);
                        spring->kl = MAX2(medge[i].v2, medge[i].v1);
-                       VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
-                       spring->restlen =  sqrt ( INPR ( temp, temp ) );
+                       spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                        clmd->sim_parms->avg_spring_len += spring->restlen;
                        cloth->verts[spring->ij].avg_spring_len += spring->restlen;
                        cloth->verts[spring->kl].avg_spring_len += spring->restlen;
@@ -1132,8 +1130,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                spring->ij = MIN2(mface[i].v1, mface[i].v3);
                spring->kl = MAX2(mface[i].v3, mface[i].v1);
-               VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
-               spring->restlen =  sqrt ( INPR ( temp, temp ) );
+               spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                spring->type = CLOTH_SPRING_TYPE_SHEAR;
                spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0;
 
@@ -1155,8 +1152,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                spring->ij = MIN2(mface[i].v2, mface[i].v4);
                spring->kl = MAX2(mface[i].v4, mface[i].v2);
-               VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
-               spring->restlen =  sqrt ( INPR ( temp, temp ) );
+               spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                spring->type = CLOTH_SPRING_TYPE_SHEAR;
                spring->stiffness = (cloth->verts[spring->kl].shear_stiff + cloth->verts[spring->ij].shear_stiff) / 2.0;
 
@@ -1197,8 +1193,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                                        spring->ij = MIN2(tspring2->ij, index2);
                                        spring->kl = MAX2(tspring2->ij, index2);
-                                       VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
-                                       spring->restlen =  sqrt ( INPR ( temp, temp ) );
+                                       spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                                        spring->type = CLOTH_SPRING_TYPE_BENDING;
                                        spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0;
                                        BLI_edgehash_insert ( edgehash, spring->ij, spring->kl, NULL );
@@ -1237,8 +1232,7 @@ static int cloth_build_springs ( ClothModifierData *clmd, DerivedMesh *dm )
 
                                spring->ij = tspring2->ij;
                                spring->kl = tspring->kl;
-                               VECSUB ( temp, cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest );
-                               spring->restlen =  sqrt ( INPR ( temp, temp ) );
+                               spring->restlen = len_v3v3(cloth->verts[spring->kl].xrest, cloth->verts[spring->ij].xrest);
                                spring->type = CLOTH_SPRING_TYPE_BENDING;
                                spring->stiffness = (cloth->verts[spring->kl].bend_stiff + cloth->verts[spring->ij].bend_stiff) / 2.0;
                                bend_springs++;
index 98a434a..2f568aa 100644 (file)
@@ -501,7 +501,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
                        
                        hlen= len_v3v3(bezt[0].vec[1], bezt[0].vec[2]); /* original handle length */
                        /* clip handle point */
-                       VECCOPY(vec, bezt[1].vec[0]);
+                       copy_v3_v3(vec, bezt[1].vec[0]);
                        if(vec[0] < bezt[0].vec[1][0])
                                vec[0]= bezt[0].vec[1][0];
                        
@@ -518,7 +518,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr)
                        
                        hlen= len_v3v3(bezt[a].vec[1], bezt[a].vec[0]); /* original handle length */
                        /* clip handle point */
-                       VECCOPY(vec, bezt[a-1].vec[2]);
+                       copy_v3_v3(vec, bezt[a-1].vec[2]);
                        if(vec[0] > bezt[a].vec[1][0])
                                vec[0]= bezt[a].vec[1][0];
                        
index 6ae5568..a5be056 100644 (file)
@@ -346,7 +346,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                        if(a==0 && dl->type== DL_POLY) bezt= nu->bezt;
                                        
                                        if(prevbezt->h2==HD_VECT && bezt->h1==HD_VECT) {
-                                               VECCOPY(data, prevbezt->vec[1]);
+                                               copy_v3_v3(data, prevbezt->vec[1]);
                                                data+= 3;
                                        }
                                        else {
@@ -363,7 +363,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                        }
                                        
                                        if(a==0 && dl->type==DL_SEGM) {
-                                               VECCOPY(data, bezt->vec[1]);
+                                               copy_v3_v3(data, bezt->vec[1]);
                                        }
                                        
                                        prevbezt= bezt;
@@ -404,7 +404,7 @@ static void curve_to_displist(Curve *cu, ListBase *nubase, ListBase *dispbase, i
                                a= len;
                                bp= nu->bp;
                                while(a--) {
-                                       VECCOPY(data, bp->vec);
+                                       copy_v3_v3(data, bp->vec);
                                        bp++;
                                        data+= 3;
                                }
@@ -486,7 +486,7 @@ void filldisplist(ListBase *dispbase, ListBase *to, int flipnormal)
                                totvert= 0;
                                eve= fillvertbase.first;
                                while(eve) {
-                                       VECCOPY(f1, eve->co);
+                                       copy_v3_v3(f1, eve->co);
                                        f1+= 3;
        
                                        /* index number */
@@ -559,7 +559,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                                        
                                        a= dl->parts;
                                        while(a--) {
-                                               VECCOPY(fp1, fp);
+                                               copy_v3_v3(fp1, fp);
                                                fp1+= 3;
                                                fp+= dpoly;
                                        }
@@ -579,7 +579,7 @@ static void bevels_to_filledpoly(Curve *cu, ListBase *dispbase)
                                        
                                        a= dl->parts;
                                        while(a--) {
-                                               VECCOPY(fp1, fp);
+                                               copy_v3_v3(fp1, fp);
                                                fp1+= 3;
                                                fp+= dpoly;
                                        }
index bb14a1d..7b58c0b 100644 (file)
@@ -555,7 +555,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
                        if(falloff == 0.0f)
                                break;
 
-                       VECADDFAC(temp, efd->vec_to_point, efd->nor, -fac);
+                       madd_v3_v3v3fl(temp, efd->vec_to_point, efd->nor, -fac);
                        r_fac= len_v3(temp);
                        falloff*= falloff_func_rad(eff->pd, r_fac);
                        break;
@@ -573,7 +573,7 @@ float effector_falloff(EffectorCache *eff, EffectorData *efd, EffectedPoint *UNU
        return falloff;
 }
 
-int closest_point_on_surface(SurfaceModifierData *surmd, float *co, float *surface_co, float *surface_nor, float *surface_vel)
+int closest_point_on_surface(SurfaceModifierData *surmd, const float co[3], float surface_co[3], float surface_nor[3], float surface_vel[3])
 {
        BVHTreeNearest nearest;
 
@@ -797,7 +797,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
 
        if(eff->pd->flag & PFIELD_TEX_2D) {
                float fac=-dot_v3v3(tex_co, efd->nor);
-               VECADDFAC(tex_co, tex_co, efd->nor, fac);
+               madd_v3_v3fl(tex_co, efd->nor, fac);
        }
 
        if(eff->pd->flag & PFIELD_TEX_OBJECT) {
@@ -848,7 +848,7 @@ static void do_texture_effector(EffectorCache *eff, EffectorData *efd, EffectedP
 
        if(eff->pd->flag & PFIELD_TEX_2D){
                float fac = -dot_v3v3(force, efd->nor);
-               VECADDFAC(force, force, efd->nor, fac);
+               madd_v3_v3fl(force, efd->nor, fac);
        }
 
        add_v3_v3(total_force, force);
@@ -897,7 +897,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
                                cross_v3_v3v3(force, efd->nor2, temp);
                                mul_v3_fl(force, strength * efd->falloff);
                                
-                               VECADDFAC(temp, temp, point->vel, -point->vel_to_sec);
+                               madd_v3_v3fl(temp, point->vel, -point->vel_to_sec);
                                add_v3_v3(force, temp);
                        }
                        break;
@@ -940,7 +940,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
                                copy_v3_v3(temp, point->loc);
                        }
                        else {
-                               VECADD(temp, efd->vec_to_point2, efd->nor2);
+                               add_v3_v3v3(temp, efd->vec_to_point2, efd->nor2);
                        }
                        force[0] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[0], temp[1], temp[2], 2,0,2);
                        force[1] = -1.0f + 2.0f * BLI_gTurbulence(pd->f_size, temp[1], temp[2], temp[0], 2,0,2);
@@ -959,10 +959,10 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
        }
 
        if(pd->flag & PFIELD_DO_LOCATION) {
-               VECADDFAC(total_force, total_force, force, 1.0f/point->vel_to_sec);
+               madd_v3_v3fl(total_force, force, 1.0f/point->vel_to_sec);
 
                if(ELEM(pd->forcefield, PFIELD_HARMONIC, PFIELD_DRAG)==0 && pd->f_flow != 0.0f) {
-                       VECADDFAC(total_force, total_force, point->vel, -pd->f_flow * efd->falloff);
+                       madd_v3_v3fl(total_force, point->vel, -pd->f_flow * efd->falloff);
                }
        }
 
@@ -972,7 +972,7 @@ static void do_physical_effector(EffectorCache *eff, EffectorData *efd, Effected
                mul_qt_v3(point->rot, xvec);
                cross_v3_v3v3(dave, xvec, force);
                if(pd->f_flow != 0.0f) {
-                       VECADDFAC(dave, dave, point->ave, -pd->f_flow * efd->falloff);
+                       madd_v3_v3fl(dave, point->ave, -pd->f_flow * efd->falloff);
                }
                add_v3_v3(point->ave, dave);
        }
@@ -1038,14 +1038,14 @@ void pdDoEffectors(ListBase *effectors, ListBase *colliders, EffectorWeights *we
                                        
                                        // for softbody backward compatibility
                                        if(point->flag & PE_WIND_AS_SPEED && impulse){
-                                               VECSUB(temp2, force, temp1);
-                                               VECSUB(impulse, impulse, temp2);
+                                               sub_v3_v3v3(temp2, force, temp1);
+                                               sub_v3_v3v3(impulse, impulse, temp2);
                                        }
                                }
                        }
                        else if(eff->flag & PE_VELOCITY_TO_IMPULSE && impulse) {
                                /* special case for harmonic effector */
-                               VECADD(impulse, impulse, efd.vel);
+                               add_v3_v3v3(impulse, impulse, efd.vel);
                        }
                }
        }
index bf43278..cdb2b19 100644 (file)
@@ -92,7 +92,7 @@ void initElbeemMesh(struct Scene *scene, struct Object *ob,
        *numVertices = totvert;
        verts = MEM_callocN( totvert*3*sizeof(float), "elbeemmesh_vertices");
        for(i=0; i<totvert; i++) {
-               VECCOPY( &verts[i*3], mvert[i].co);
+               copy_v3_v3(&verts[i*3], mvert[i].co);
                if(useGlobalCoords) { mul_m4_v3(ob->obmat, &verts[i*3]); }
        }
        *vertices = verts;
index cd025ec..76c3e6e 100644 (file)
@@ -276,8 +276,9 @@ void group_tag_recalc(Group *group)
 int group_is_animated(Object *parent, Group *group)
 {
        GroupObject *go;
-
-       if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first)
+       
+       // XXX: old animsys depreceated...
+       if(parent->nlastrips.first)
                return 1;
 
        for(go= group->gobject.first; go; go= go->next)
@@ -343,12 +344,11 @@ void group_handle_recalc_and_update(Scene *scene, Object *UNUSED(parent), Group
           * but when its enabled at some point it will need to be changed so as not to update so much - campbell */
 
        /* if animated group... */
-       if(give_timeoffset(parent) != 0.0f || parent->nlastrips.first) {
+       if(parent->nlastrips.first) {
                int cfrao;
                
                /* switch to local time */
                cfrao= scene->r.cfra;
-               scene->r.cfra -= (int)floor(give_timeoffset(parent) + 0.5f);
                
                /* we need a DAG per group... */
                for(go= group->gobject.first; go; go= go->next) {
index 6d09511..c389800 100644 (file)
@@ -59,6 +59,7 @@
 #include "BKE_main.h"
 #include "BKE_object.h"
 #include "BKE_deform.h"
+#include "BKE_scene.h"
 
 
 #include "RNA_access.h"
@@ -1072,7 +1073,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
                
                for(a=0; a<tot; a+=step, cfra+= delta) {
                        
-                       ctime= bsystem_time(scene, NULL, cfra, 0.0); // xxx  ugly cruft!
+                       ctime= BKE_curframe(scene);
 #if 0 // XXX old animation system
                        if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
                                ctime /= 100.0;
@@ -1106,7 +1107,7 @@ static void do_mesh_key(Scene *scene, Object *ob, Key *key, char *out, const int
                        }
                }
                else {
-                       ctime= bsystem_time(scene, ob, (float)scene->r.cfra, 0.0f); // xxx old cruft
+                       ctime= BKE_curframe(scene);
                        
 #if 0 // XXX old animation system
                        if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
@@ -1204,7 +1205,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
                        while (a < estep) {
                                if (remain <= 0) {
                                        cfra+= delta;
-                                       ctime= bsystem_time(scene, NULL, cfra, 0.0f); // XXX old cruft
+                                       ctime= BKE_curframe(scene);
 
                                        ctime /= 100.0f;
                                        CLAMP(ctime, 0.0f, 1.0f); // XXX for compat, we use this, but this clamping was confusing
@@ -1231,7 +1232,7 @@ static void do_curve_key(Scene *scene, Object *ob, Key *key, char *out, const in
        }
        else {
                
-               ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0);
+               ctime= BKE_curframe(scene);
                
                if(key->type==KEY_RELATIVE) {
                        do_rel_cu_key(cu, cu->key, actkb, ctime, out, tot);
@@ -1267,7 +1268,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
                
                for(a=0; a<tot; a++, cfra+= delta) {
                        
-                       ctime= bsystem_time(scene, NULL, cfra, 0.0); // XXX old cruft
+                       ctime= BKE_curframe(scene);
 #if 0 // XXX old animation system
                        if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
                                ctime /= 100.0;
@@ -1298,7 +1299,7 @@ static void do_latt_key(Scene *scene, Object *ob, Key *key, char *out, const int
                        }
                }
                else {
-                       ctime= bsystem_time(scene, NULL, (float)scene->r.cfra, 0.0);
+                       ctime= BKE_curframe(scene);
 
 #if 0 // XXX old animation system
                        if(calc_ipo_spec(key->ipo, KEY_SPEED, &ctime)==0) {
@@ -1462,7 +1463,7 @@ KeyBlock *add_keyblock(Key *key, const char *name)
                kb->pos= curpos + 0.1f;
        else {
 #if 0 // XXX old animation system
-               curpos= bsystem_time(scene, 0, (float)CFRA, 0.0);
+               curpos= BKE_curframe(scene);
                if(calc_ipo_spec(key->ipo, KEY_SPEED, &curpos)==0) {
                        curpos /= 100.0;
                }
index 089b42b..07e199c 100644 (file)
@@ -1420,33 +1420,6 @@ void object_make_proxy(Object *ob, Object *target, Object *gob)
 
 /* *************** CALC ****************** */
 
-/* there is also a timing calculation in drawobject() */
-
-
-// XXX THIS CRUFT NEEDS SERIOUS RECODING ASAP!
-/* ob can be NULL */
-float bsystem_time(struct Scene *scene, Object *UNUSED(ob), float cfra, float ofs)
-{
-       /* returns float ( see BKE_curframe in scene.c) */
-       cfra += scene->r.subframe;
-       
-       /* global time */
-       if (scene)
-               cfra*= scene->r.framelen;       
-       
-#if 0 // XXX old animation system
-       if (ob) {
-               /* ofset frames */
-               if ((ob->ipoflag & OB_OFFS_PARENT) && (ob->partype & PARSLOW)==0) 
-                       cfra-= give_timeoffset(ob);
-       }
-#endif // XXX old animation system
-       
-       cfra-= ofs;
-
-       return cfra;
-}
-
 void object_scale_to_mat3(Object *ob, float mat[][3])
 {
        float vec[3];
@@ -1454,7 +1427,6 @@ void object_scale_to_mat3(Object *ob, float mat[][3])
        size_to_mat3( mat,vec);
 }
 
-
 void object_rot_to_mat3(Object *ob, float mat[][3])
 {
        float rmat[3][3], dmat[3][3];
@@ -1593,12 +1565,6 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
                makeDispListCurveTypes(scene, par, 0);
        if(cu->path==NULL) return;
        
-       /* exception, timeoffset is regarded as distance offset */
-       if(cu->flag & CU_OFFS_PATHDIST) {
-               timeoffs = give_timeoffset(ob);
-               SWAP(float, sf_orig, ob->sf);
-       }
-       
        /* catch exceptions: feature for nla stride editing */
        if(ob->ipoflag & OB_DISABLE_PATH) {
                ctime= 0.0f;
@@ -1619,7 +1585,7 @@ static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
                CLAMP(ctime, 0.0f, 1.0f);
        }
        else {
-               ctime= scene->r.cfra - give_timeoffset(ob);
+               ctime= scene->r.cfra;
                if (IS_EQF(cu->pathlen, 0.0f) == 0)
                        ctime /= cu->pathlen;
                
@@ -1852,7 +1818,7 @@ static int where_is_object_parslow(Object *ob, float obmat[4][4], float slowmat[
        int a;
 
        // include framerate
-       fac1= ( 1.0f / (1.0f + (float)fabs(give_timeoffset(ob))) );
+       fac1= ( 1.0f / (1.0f + (float)fabs(ob->sf)) );
        if(fac1 >= 1.0f) return 0;
        fac2= 1.0f-fac1;
 
@@ -1882,9 +1848,6 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
        if(ob->parent) {
                Object *par= ob->parent;
                
-               // XXX depreceated - animsys
-               if(ob->ipoflag & OB_OFFS_PARENT) ctime-= give_timeoffset(ob);
-               
                /* hurms, code below conflicts with depgraph... (ton) */
                /* and even worse, it gives bad effects for NLA stride too (try ctime != par->ctime, with MBlur) */
                if(no_parent_ipo==0 && stime != par->ctime) {
@@ -1893,14 +1856,17 @@ void where_is_object_time(Scene *scene, Object *ob, float ctime)
                        
                        if(par->proxy_from);    // was a copied matrix, no where_is! bad...
                        else where_is_object_time(scene, par, ctime);
-
+                       
                        solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
-
+                       
                        *par= tmp;
                }
                else
                        solve_parenting(scene, ob, par, ob->obmat, slowmat, 0);
                
+               /* "slow parent" is definitely not threadsafe, and may also give bad results jumping around 
+                * An old-fashioned hack which probably doesn't really cut it anymore
+                */
                if(ob->partype & PARSLOW) {
                        if(!where_is_object_parslow(ob, ob->obmat, slowmat))
                                return;
@@ -2039,7 +2005,6 @@ void where_is_object_simul(Scene *scene, Object *ob)
 for a lamp that is the child of another object */
 {
        Object *par;
-       //Ipo *ipo;
        float *fp1, *fp2;
        float slowmat[4][4];
        float fac1, fac2;
@@ -2050,10 +2015,9 @@ for a lamp that is the child of another object */
                par= ob->parent;
                
                solve_parenting(scene, ob, par, ob->obmat, slowmat, 1);
-
+               
                if(ob->partype & PARSLOW) {
-
-                       fac1= (float)(1.0/(1.0+ fabs(give_timeoffset(ob))));
+                       fac1= (float)(1.0/(1.0+ fabs(ob->sf)));
                        fac2= 1.0f-fac1;
                        fp1= ob->obmat[0];
                        fp2= slowmat[0];
@@ -2061,7 +2025,6 @@ for a lamp that is the child of another object */
                                fp1[0]= fac1*fp1[0] + fac2*fp2[0];
                        }
                }
-               
        }
        else {
                object_to_mat4(ob, ob->obmat);
@@ -2190,7 +2153,7 @@ void object_set_dimensions(Object *ob, const float *value)
        }
 }
 
-void minmax_object(Object *ob, float *min, float *max)
+void minmax_object(Object *ob, float min[3], float max[3])
 {
        BoundBox bb;
        float vec[3];
@@ -2587,15 +2550,6 @@ void object_sculpt_modifiers_changed(Object *ob)
        }
 }
 
-float give_timeoffset(Object *ob)
-{
-       if ((ob->ipoflag & OB_OFFS_PARENTADD) && ob->parent) {
-               return ob->sf + give_timeoffset(ob->parent);
-       } else {
-               return ob->sf;
-       }
-}
-
 int give_obdata_texspace(Object *ob, short **texflag, float **loc, float **size, float **rot)
 {
        
index 7678da1..56e4c91 100644 (file)
@@ -77,6 +77,7 @@
 #include "BKE_mesh.h"
 #include "BKE_cdderivedmesh.h"
 #include "BKE_pointcache.h"
+#include "BKE_scene.h"
 
 #include "RE_render_ext.h"
 
@@ -618,13 +619,13 @@ static float psys_render_viewport_falloff(double rate, float dist, float width)
        return pow(rate, dist/width);
 }
 
-static float psys_render_projected_area(ParticleSystem *psys, float *center, float area, double vprate, float *viewport)
+static float psys_render_projected_area(ParticleSystem *psys, const float center[3], float area, double vprate, float *viewport)
 {
        ParticleRenderData *data= psys->renderdata;
        float co[4], view[3], ortho1[3], ortho2[3], w, dx, dy, radius;
        
        /* transform to view space */
-       VECCOPY(co, center);
+       copy_v3_v3(co, center);
        co[3]= 1.0f;
        mul_m4_v4(data->viewmat, co);
        
@@ -828,17 +829,17 @@ int psys_render_simplify_distribution(ParticleThreadContext *ctx, int tot)
                b= (origindex)? origindex[a]: a;
 
                if(b != -1) {
-                       VECCOPY(co1, mvert[mf->v1].co);
-                       VECCOPY(co2, mvert[mf->v2].co);
-                       VECCOPY(co3, mvert[mf->v3].co);
+                       copy_v3_v3(co1, mvert[mf->v1].co);
+                       copy_v3_v3(co2, mvert[mf->v2].co);
+                       copy_v3_v3(co3, mvert[mf->v3].co);
 
-                       VECADD(facecenter[b], facecenter[b], co1);
-                       VECADD(facecenter[b], facecenter[b], co2);
-                       VECADD(facecenter[b], facecenter[b], co3);
+                       add_v3_v3(facecenter[b], co1);
+                       add_v3_v3(facecenter[b], co2);
+                       add_v3_v3(facecenter[b], co3);
 
                        if(mf->v4) {
-                               VECCOPY(co4, mvert[mf->v4].co);
-                               VECADD(facecenter[b], facecenter[b], co4);
+                               copy_v3_v3(co4, mvert[mf->v4].co);
+                               add_v3_v3(facecenter[b], co4);
                                facearea[b] += area_quad_v3(co1, co2, co3, co4);
                                facetotvert[b] += 4;
                        }
@@ -997,7 +998,7 @@ int psys_render_simplify_params(ParticleSystem *psys, ChildParticle *cpa, float
 /************************************************/
 /*                     Interpolation                                           */
 /************************************************/
-static float interpolate_particle_value(float v1, float v2, float v3, float v4, float *w, int four)
+static float interpolate_particle_value(float v1, float v2, float v3, float v4, const float w[4], int four)
 {
        float value;
 
@@ -1028,12 +1029,12 @@ void psys_interpolate_particle(short type, ParticleKey keys[4], float dt, Partic
                        if(dt>0.999f){
                                key_curve_position_weights(dt-0.001f, t, type);
                                interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
-                               VECSUB(result->vel, result->co, temp);
+                               sub_v3_v3v3(result->vel, result->co, temp);
                        }
                        else{
                                key_curve_position_weights(dt+0.001f, t, type);
                                interp_v3_v3v3v3v3(temp, keys[0].co, keys[1].co, keys[2].co, keys[3].co, t);
-                               VECSUB(result->vel, temp, result->co);
+                               sub_v3_v3v3(result->vel, temp, result->co);
                        }
                }
        }
@@ -1179,21 +1180,21 @@ static void init_particle_interpolation(Object *ob, ParticleSystem *psys, Partic
 }
 static void edit_to_particle(ParticleKey *key, PTCacheEditKey *ekey)
 {
-       VECCOPY(key->co, ekey->co);
+       copy_v3_v3(key->co, ekey->co);
        if(ekey->vel) {
-               VECCOPY(key->vel, ekey->vel);
+               copy_v3_v3(key->vel, ekey->vel);
        }
        key->time = *(ekey->time);
 }
 static void hair_to_particle(ParticleKey *key, HairKey *hkey)
 {
-       VECCOPY(key->co, hkey->co);
+       copy_v3_v3(key->co, hkey->co);
        key->time = hkey->time;
 }
 
 static void mvert_to_particle(ParticleKey *key, MVert *mvert, HairKey *hkey)
 {
-       VECCOPY(key->co, mvert->co);
+       copy_v3_v3(key->co, mvert->co);
        key->time = hkey->time;
 }
 
@@ -1472,13 +1473,13 @@ void psys_interpolate_face(MVert *mvert, MFace *mface, MTFace *tface, float (*or
                        }
                }
                else {
-                       VECCOPY(orco, vec);
+                       copy_v3_v3(orco, vec);
                        if(ornor && nor)
-                               VECCOPY(ornor, nor);
+                               copy_v3_v3(ornor, nor);
                }
        }
 }
-void psys_interpolate_uvs(MTFace *tface, int quad, float *w, float *uvco)
+void psys_interpolate_uvs(const MTFace *tface, int quad, const float w[4], float uvco[2])
 {
        float v10= tface->uv[0][0];
        float v11= tface->uv[0][1];
@@ -1501,7 +1502,7 @@ void psys_interpolate_uvs(MTFace *tface, int quad, float *w, float *uvco)
        }
 }
 
-void psys_interpolate_mcol(MCol *mcol, int quad, float *w, MCol *mc)
+void psys_interpolate_mcol(const MCol *mcol, int quad, const float w[4], MCol *mc)
 {
        char *cp, *cp1, *cp2, *cp3, *cp4;
 
@@ -1526,7 +1527,7 @@ void psys_interpolate_mcol(MCol *mcol, int quad, float *w, MCol *mc)
        }
 }
 
-static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int index, float *fw, float *values)
+static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int index, const float fw[4], const float *values)
 {
        if(values==0 || index==-1)
                return 0.0;
@@ -1542,18 +1543,18 @@ static float psys_interpolate_value_from_verts(DerivedMesh *dm, short from, int
                }
                        
        }
-       return 0.0;
+       return 0.0f;
 }
 
 /* conversion of pa->fw to origspace layer coordinates */
-static void psys_w_to_origspace(float *w, float *uv)
+static void psys_w_to_origspace(const float w[4], float uv[2])
 {
        uv[0]= w[1] + w[2];
        uv[1]= w[2] + w[3];
 }
 
 /* conversion of pa->fw to weights in face from origspace */
-static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, float *w, float *neww)
+static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, const float w[4], float neww[4])
 {
        float v[4][3], co[3];
 
@@ -1566,17 +1567,17 @@ static void psys_origspace_to_w(OrigSpaceFace *osface, int quad, float *w, float
        
        if(quad) {
                v[3][0]= osface->uv[3][0]; v[3][1]= osface->uv[3][1]; v[3][2]= 0.0f;
-               interp_weights_poly_v3( neww,v, 4, co);
+               interp_weights_poly_v3(neww, v, 4, co);
        }
        else {
-               interp_weights_poly_v3( neww,v, 3, co);
+               interp_weights_poly_v3(neww, v, 3, co);
                neww[3]= 0.0f;
        }
 }
 
 /* find the derived mesh face for a particle, set the mf passed. this is slow
  * and can be optimized but only for many lookups. returns the face index. */
-int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float *fw, struct LinkNode *node)
+int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, const float fw[4], struct LinkNode *node)
 {
        Mesh *me= (Mesh*)ob->data;
        MFace *mface;
@@ -1643,7 +1644,7 @@ int psys_particle_dm_face_lookup(Object *ob, DerivedMesh *dm, int index, float *
        return DMCACHE_NOTFOUND;
 }
 
-static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float UNUSED(foffset), int *mapindex, float *mapfw)
+static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float UNUSED(foffset), int *mapindex, float mapfw[4])
 {
        if(index < 0)
                return 0;
@@ -1662,7 +1663,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_
                                return 0;
 
                        *mapindex = index;
-                       QUATCOPY(mapfw, fw);
+                       copy_v4_v4(mapfw, fw);
                }
        } else {
                /* for other meshes that have been modified, we try to map the particle
@@ -1703,7 +1704,7 @@ static int psys_map_index_on_dm(DerivedMesh *dm, int from, int index, int index_
 }
 
 /* interprets particle data to get a point on a mesh in object space */
-void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, float *fw, float foffset, float *vec, float *nor, float *utan, float *vtan, float *orco, float *ornor)
+void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache, const float fw[4], float foffset, float vec[3], float nor[3], float utan[3], float vtan[3], float orco[3], float ornor[3])
 {
        float tmpnor[3], mapfw[4];
        float (*orcodata)[3];
@@ -1731,7 +1732,7 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
                }
 
                if(orco)
-                       VECCOPY(orco, orcodata[mapindex])
+                       copy_v3_v3(orco, orcodata[mapindex]);
 
                if(ornor) {
                        dm->getVertNo(dm,mapindex,nor);
@@ -1758,11 +1759,11 @@ void psys_particle_on_dm(DerivedMesh *dm, int from, int index, int index_dmcache
                if(from==PART_FROM_VOLUME) {
                        psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,tmpnor,utan,vtan,orco,ornor);
                        if(nor)
-                               VECCOPY(nor,tmpnor);
+                               copy_v3_v3(nor,tmpnor);
 
                        normalize_v3(tmpnor);
                        mul_v3_fl(tmpnor,-foffset);
-                       VECADD(vec,vec,tmpnor);
+                       add_v3_v3(vec, tmpnor);
                }
                else
                        psys_interpolate_face(mvert,mface,mtface,orcodata,mapfw,vec,nor,utan,vtan,orco,ornor);
@@ -1804,22 +1805,22 @@ static void psys_particle_on_shape(int UNUSED(distr), int UNUSED(index), float *
        /* TODO */
        float zerovec[3]={0.0f,0.0f,0.0f};
        if(vec){
-               VECCOPY(vec,zerovec);
+               copy_v3_v3(vec,zerovec);
        }
        if(nor){
-               VECCOPY(nor,zerovec);
+               copy_v3_v3(nor,zerovec);
        }
        if(utan){
-               VECCOPY(utan,zerovec);
+               copy_v3_v3(utan,zerovec);
        }
        if(vtan){
-               VECCOPY(vtan,zerovec);
+               copy_v3_v3(vtan,zerovec);
        }
        if(orco){
-               VECCOPY(orco,zerovec);
+               copy_v3_v3(orco,zerovec);
        }
        if(ornor){
-               VECCOPY(ornor,zerovec);
+               copy_v3_v3(ornor,zerovec);
        }
 }
 /************************************************/
@@ -1989,7 +1990,7 @@ static void do_kink(ParticleKey *state, ParticleKey *par, float *par_rot, float
                }
                else if(inp_z > 0.0f){
                        mul_v3_v3fl(state_co, z_vec, (float)sin((float)M_PI/3.f));
-                       VECADDFAC(state_co,state_co,y_vec,-0.5f);
+                       madd_v3_v3fl(state_co, y_vec, -0.5f);
 
                        mul_v3_fl(y_vec, -amplitude * (float)cos(t + (float)M_PI/3.f));
                        mul_v3_fl(z_vec, amplitude/2.f * (float)cos(2.f*t + (float)M_PI/6.f));
@@ -2087,7 +2088,7 @@ void precalc_guides(ParticleSimulationData *sim, ListBase *effectors)
 
                        data = eff->guide_data + p;
 
-                       VECSUB(efd.vec_to_point, state.co, eff->guide_loc);
+                       sub_v3_v3v3(efd.vec_to_point, state.co, eff->guide_loc);
                        copy_v3_v3(efd.nor, eff->guide_dir);
                        efd.distance = len_v3(efd.vec_to_point);
 
@@ -2141,7 +2142,7 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
 
                normalize_v3(guidedir);
 
-               VECCOPY(vec_to_point, data->vec_to_point);
+               copy_v3_v3(vec_to_point, data->vec_to_point);
 
                if(guidetime != 0.0f) {
                        /* curve direction */
@@ -2166,16 +2167,16 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
                        }
                }
                par.co[0] = par.co[1] = par.co[2] = 0.0f;
-               VECCOPY(key.co, vec_to_point);
+               copy_v3_v3(key.co, vec_to_point);
                do_kink(&key, &par, 0, guidetime, pd->kink_freq, pd->kink_shape, pd->kink_amp, 0.f, pd->kink, pd->kink_axis, 0, 0);
                do_clump(&key, &par, guidetime, pd->clump_fac, pd->clump_pow, 1.0f);
-               VECCOPY(vec_to_point, key.co);
+               copy_v3_v3(vec_to_point, key.co);
 
-               VECADD(vec_to_point, vec_to_point, guidevec);
+               add_v3_v3(vec_to_point, guidevec);
 
-               //VECSUB(pa_loc,pa_loc,pa_zero);
-               VECADDFAC(effect, effect, vec_to_point, data->strength);
-               VECADDFAC(veffect, veffect, guidedir, data->strength);
+               //sub_v3_v3v3(pa_loc,pa_loc,pa_zero);
+               madd_v3_v3fl(effect, vec_to_point, data->strength);
+               madd_v3_v3fl(veffect, guidedir, data->strength);
                totstrength += data->strength;
 
                if(pd->flag & PFIELD_GUIDE_PATH_WEIGHT)
@@ -2186,12 +2187,12 @@ int do_guides(ListBase *effectors, ParticleKey *state, int index, float time)
                if(totstrength > 1.0f)
                        mul_v3_fl(effect, 1.0f / totstrength);
                CLAMP(totstrength, 0.0f, 1.0f);
-               //VECADD(effect,effect,pa_zero);
+               //add_v3_v3(effect,pa_zero);
                interp_v3_v3v3(state->co, state->co, effect, totstrength);
 
                normalize_v3(veffect);
                mul_v3_fl(veffect, len_v3(state->vel));
-               VECCOPY(state->vel, veffect);
+               copy_v3_v3(state->vel, veffect);
                return 1;
        }
        return 0;
@@ -2204,15 +2205,15 @@ static void do_rough(float *loc, float mat[4][4], float t, float fac, float size
        if(thres != 0.0f)
                if((float)fabs((float)(-1.5f+loc[0]+loc[1]+loc[2]))<1.5f*thres) return;
 
-       VECCOPY(rco,loc);
+       copy_v3_v3(rco,loc);
        mul_v3_fl(rco,t);
        rough[0]=-1.0f+2.0f*BLI_gTurbulence(size, rco[0], rco[1], rco[2], 2,0,2);
        rough[1]=-1.0f+2.0f*BLI_gTurbulence(size, rco[1], rco[2], rco[0], 2,0,2);
        rough[2]=-1.0f+2.0f*BLI_gTurbulence(size, rco[2], rco[0], rco[1], 2,0,2);
 
-       VECADDFAC(state->co,state->co,mat[0],fac*rough[0]);
-       VECADDFAC(state->co,state->co,mat[1],fac*rough[1]);
-       VECADDFAC(state->co,state->co,mat[2],fac*rough[2]);
+       madd_v3_v3fl(state->co, mat[0], fac * rough[0]);
+       madd_v3_v3fl(state->co, mat[1], fac * rough[1]);
+       madd_v3_v3fl(state->co, mat[2], fac * rough[2]);
 }
 static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float shape, ParticleKey *state)
 {
@@ -2225,8 +2226,8 @@ static void do_rough_end(float *loc, float mat[4][4], float t, float fac, float
        rough[1]=-1.0f+2.0f*rough[1];
        mul_v2_fl(rough,roughfac);
 
-       VECADDFAC(state->co,state->co,mat[0],rough[0]);
-       VECADDFAC(state->co,state->co,mat[1],rough[1]);
+       madd_v3_v3fl(state->co, mat[0], rough[0]);
+       madd_v3_v3fl(state->co, mat[1], rough[1]);
 }
 static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheKey *ca, int k, int steps, float *UNUSED(rootco), float effector, float UNUSED(dfra), float UNUSED(cfra), float *length, float *vec)
 {
@@ -2238,9 +2239,9 @@ static void do_path_effectors(ParticleSimulationData *sim, int i, ParticleCacheK
        if(sim->psys->flag & PSYS_HAIR_DYNAMICS)
                return;
 
-       VECCOPY(eff_key.co,(ca-1)->co);
-       VECCOPY(eff_key.vel,(ca-1)->vel);
-       QUATCOPY(eff_key.rot,(ca-1)->rot);
+       copy_v3_v3(eff_key.co,(ca-1)->co);
+       copy_v3_v3(eff_key.vel,(ca-1)->vel);
+       copy_qt_qt(eff_key.rot,(ca-1)->rot);
 
        pd_point_from_particle(sim, sim->psys->particles+i, &eff_key, &epoint);
        pdDoEffectors(sim->psys->effectors, sim->colliders, sim->psys->part->effector_weights, &epoint, force, NULL);
@@ -2263,7 +2264,7 @@ static int check_path_length(int k, ParticleCacheKey *keys, ParticleCacheKey *st
 {
        if(*cur_length + length > max_length){
                mul_v3_fl(dvec, (max_length - *cur_length) / length);
-               VECADD(state->co, (state - 1)->co, dvec);
+               add_v3_v3v3(state->co, (state - 1)->co, dvec);
                keys->steps = k;
                /* something over the maximum step value */
                return k=100000;
@@ -2363,8 +2364,9 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
                interp_v3_v3v3(vnor, nstrand, surfnor, blend);
                normalize_v3(vnor);
        }
-       else
-               VECCOPY(vnor, nor)
+       else {
+               copy_v3_v3(vnor, nor);
+       }
        
        if(ma->strand_surfnor > 0.0f) {
                if(ma->strand_surfnor > surfdist) {
@@ -2374,7 +2376,7 @@ static void get_strand_normal(Material *ma, float *surfnor, float surfdist, floa
                }
        }
 
-       VECCOPY(nor, vnor);
+       copy_v3_v3(nor, vnor);
 }
 
 static int psys_threads_init_path(ParticleThread *threads, Scene *scene, float cfra, int editupdate)
@@ -2715,7 +2717,7 @@ static void psys_thread_create_path(ParticleThread *thread, struct ChildParticle
                }
 
                if(ctx->ma && (part->draw_col == PART_DRAW_COL_MAT)) {
-                       VECCOPY(child->col, &ctx->ma->r)
+                       copy_v3_v3(child->col, &ctx->ma->r);
                        get_strand_normal(ctx->ma, ornor, cur_length, child->vel);
                }
        }
@@ -2833,7 +2835,7 @@ static void cache_key_incremental_rotation(ParticleCacheKey *key0, ParticleCache
                * angle, since floating point accuracy makes it give
                * different results across platforms */
                if(cosangle > 0.999999f) {
-                       QUATCOPY(key1->rot, key2->rot);
+                       copy_v4_v4(key1->rot, key2->rot);
                }
                else {
                        angle= saacos(cosangle);
@@ -2898,7 +2900,7 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
        psys->lattice = psys_get_lattice(sim);
        ma= give_current_material(sim->ob, psys->part->omat);
        if(ma && (psys->part->draw_col == PART_DRAW_COL_MAT))
-               VECCOPY(col, &ma->r)
+               copy_v3_v3(col, &ma->r);
 
        if((psys->flag & PSYS_GLOBAL_HAIR)==0) {
                if((psys->part->flag & PART_CHILD_EFFECT)==0)
@@ -2932,9 +2934,9 @@ void psys_cache_paths(ParticleSimulationData *sim, float cfra)
 
                /* hairmat is needed for for non-hair particle too so we get proper rotations */
                psys_mat_hair_to_global(sim->ob, psmd->dm, psys->part->from, pa, hairmat);
-               VECCOPY(rotmat[0], hairmat[2]);
-               VECCOPY(rotmat[1], hairmat[1]);
-               VECCOPY(rotmat[2], hairmat[0]);
+               copy_v3_v3(rotmat[0], hairmat[2]);
+               copy_v3_v3(rotmat[1], hairmat[1]);
+               copy_v3_v3(rotmat[2], hairmat[0]);
 
                if(part->draw & PART_ABS_PATH_TIME) {
                        birthtime = MAX2(pind.birthtime, part->path_start);
@@ -3188,7 +3190,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
                        else {
                                if((ekey + (pind.ekey[0] - point->keys))->flag & PEK_SELECT){
                                        if((ekey + (pind.ekey[1] - point->keys))->flag & PEK_SELECT){
-                                               VECCOPY(ca->col, sel_col);
+                                               copy_v3_v3(ca->col, sel_col);
                                        }
                                        else{
                                                keytime = (t - (*pind.ekey[0]->time))/((*pind.ekey[1]->time) - (*pind.ekey[0]->time));
@@ -3201,7 +3203,7 @@ void psys_cache_edit_paths(Scene *scene, Object *ob, PTCacheEdit *edit, float cf
                                                interp_v3_v3v3(ca->col, nosel_col, sel_col, keytime);
                                        }
                                        else{
-                                               VECCOPY(ca->col, nosel_col);
+                                               copy_v3_v3(ca->col, nosel_col);
                                        }
                                }
                        }
@@ -3252,9 +3254,9 @@ void copy_particle_key(ParticleKey *to, ParticleKey *from, int time){
        }
 }
 void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, float *time){
-       if(loc) VECCOPY(loc,key->co);
-       if(vel) VECCOPY(vel,key->vel);
-       if(rot) QUATCOPY(rot,key->rot);
+       if(loc) copy_v3_v3(loc,key->co);
+       if(vel) copy_v3_v3(vel,key->vel);
+       if(rot) copy_qt_qt(rot,key->rot);
        if(time) *time=key->time;
 }
 /*-------changing particle keys from space to another-------*/
@@ -3262,13 +3264,13 @@ void psys_get_from_key(ParticleKey *key, float *loc, float *vel, float *rot, flo
 static void key_from_object(Object *ob, ParticleKey *key){
        float q[4];
 
-       VECADD(key->vel,key->vel,key->co);
+       add_v3_v3(key->vel, key->co);
 
        mul_m4_v3(ob->obmat,key->co);
        mul_m4_v3(ob->obmat,key->vel);
        mat4_to_quat(q,ob->obmat);
 
-       VECSUB(key->vel,key->vel,key->co);
+       sub_v3_v3v3(key->vel,key->vel,key->co);
        mul_qt_qtqt(key->rot,q,key->rot);
 }
 #endif
@@ -3329,9 +3331,9 @@ static void psys_face_mat(Object *ob, DerivedMesh *dm, ParticleData *pa, float m
        osface=dm->getFaceData(dm,i,CD_ORIGSPACE);
        
        if(orco && (orcodata=dm->getVertDataArray(dm, CD_ORCO))) {
-               VECCOPY(v[0], orcodata[mface->v1]);
-               VECCOPY(v[1], orcodata[mface->v2]);
-               VECCOPY(v[2], orcodata[mface->v3]);
+               copy_v3_v3(v[0], orcodata[mface->v1]);
+               copy_v3_v3(v[1], orcodata[mface->v2]);
+               copy_v3_v3(v[2], orcodata[mface->v3]);
 
                /* ugly hack to use non-transformed orcos, since only those
                 * give symmetric results for mirroring in particle mode */
@@ -3353,7 +3355,7 @@ void psys_mat_hair_to_object(Object *UNUSED(ob), DerivedMesh *dm, short from, Pa
 
        psys_face_mat(0, dm, pa, hairmat, 0);
        psys_particle_on_dm(dm, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, vec, 0, 0, 0, 0, 0);
-       VECCOPY(hairmat[3],vec);
+       copy_v3_v3(hairmat[3],vec);
 }
 
 void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData *pa, float hairmat[][4])
@@ -3366,7 +3368,7 @@ void psys_mat_hair_to_orco(Object *ob, DerivedMesh *dm, short from, ParticleData
        /* see psys_face_mat for why this function is called */
        if(DM_get_vert_data_layer(dm, CD_ORIGINDEX))
                transform_mesh_orco_verts(ob->data, &orco, 1, 1);
-       VECCOPY(hairmat[3],orco);
+       copy_v3_v3(hairmat[3],orco);
 }
 
 void psys_vec_rot_to_face(DerivedMesh *dm, ParticleData *pa, float *vec)
@@ -3426,7 +3428,7 @@ ModifierData *object_add_particle_system(Scene *scene, Object *ob, const char *n
 
        psys->totpart=0;
        psys->flag = PSYS_ENABLED|PSYS_CURRENT;
-       psys->cfra=bsystem_time(scene,ob,scene->r.cfra+1,0.0);
+       psys->cfra = BKE_frame_to_ctime(scene, CFRA + 1);
 
        DAG_scene_sort(G.main, scene);
        DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -3657,7 +3659,7 @@ void make_local_particlesettings(ParticleSettings *part)
 /*                     Textures                                                        */
 /************************************************/
 
-static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, float *fuv, char *name, float *texco)
+static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, const float fuv[4], char *name, float *texco)
 {
        MFace *mf;
        MTFace *tf;
@@ -3701,7 +3703,7 @@ static int get_particle_uv(DerivedMesh *dm, ParticleData *pa, int face_index, fl
 #define CLAMP_PARTICLE_TEXTURE_POS(type, pvalue) if(event & type) { if(pvalue < 0.f) pvalue = 1.f+pvalue; CLAMP(pvalue, 0.0f, 1.0f); }
 #define CLAMP_PARTICLE_TEXTURE_POSNEG(type, pvalue) if(event & type) { CLAMP(pvalue, -1.0f, 1.0f); }
 
-static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, float *fw, float *orco, ParticleTexture *ptex, int event, float cfra)
+static void get_cpa_texture(DerivedMesh *dm, ParticleSystem *psys, ParticleSettings *part, ParticleData *par, int child_index, int face_index, const float fw[4], float *orco, ParticleTexture *ptex, int event, float cfra)
 {
        MTex *mtex, **mtexp = part->mtex;
        int m;
@@ -4070,7 +4072,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
                        psys_particle_on_emitter(psmd,cpa_from,cpa_num,DMCACHE_ISCHILD,cpa->fuv,foffset,co,0,0,0,orco,0);
 
                        /* we need to save the actual root position of the child for positioning it accurately to the surface of the emitter */
-                       //VECCOPY(cpa_1st,co);
+                       //copy_v3_v3(cpa_1st,co);
 
                        //mul_m4_v3(ob->obmat,cpa_1st);
 
@@ -4141,7 +4143,7 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
                                w++;
                        }
                        /* apply offset for correct positioning */
-                       //VECADD(state->co,state->co,cpa_1st);
+                       //add_v3_v3(state->co, cpa_1st);
                }
                else{
                        /* offset the child from the parent position */
@@ -4164,13 +4166,13 @@ void psys_get_particle_on_path(ParticleSimulationData *sim, int p, ParticleKey *
                        if(t>=0.001f){
                                tstate.time=t-0.001f;
                                psys_get_particle_on_path(sim,p,&tstate,0);
-                               VECSUB(state->vel,state->co,tstate.co);
+                               sub_v3_v3v3(state->vel,state->co,tstate.co);
                                normalize_v3(state->vel);
                        }
                        else{
                                tstate.time=t+0.001f;
                                psys_get_particle_on_path(sim,p,&tstate,0);
-                               VECSUB(state->vel,tstate.co,state->co);
+                               sub_v3_v3v3(state->vel,tstate.co,state->co);
                                normalize_v3(state->vel);
                        }
 
@@ -4189,7 +4191,7 @@ int psys_get_particle_state(ParticleSimulationData *sim, int p, ParticleKey *sta
        float timestep = psys_get_timestep(sim);
 
        /* negative time means "use current time" */
-       cfra = state->time > 0 ? state->time : bsystem_time(sim->scene, 0, (float)sim->scene->r.cfra, 0.0);
+       cfra = state->time > 0 ? state->time : BKE_curframe(sim->scene);
 
        if(p>=totpart){
                if(!psys->totchild)
@@ -4421,9 +4423,9 @@ void psys_get_dupli_path_transform(ParticleSimulationData *sim, ParticleData *pa
                cross_v3_v3v3(nor, vec, side);
 
                unit_m4(mat);
-               VECCOPY(mat[0], vec);
-               VECCOPY(mat[1], side);
-               VECCOPY(mat[2], nor);
+               copy_v3_v3(mat[0], vec);
+               copy_v3_v3(mat[1], side);
+               copy_v3_v3(mat[2], nor);
        }
        else {
                quat_to_mat4(mat, pa->state.rot);
@@ -4469,12 +4471,12 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
 
                normalize_v3_v3(temp, bb->vel);
 
-               VECSUB(zvec, bb->ob->obmat[3], bb->vec);
+               sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec);
 
                if(bb->lock) {
                        float fac = -dot_v3v3(zvec, temp);
 
-                       VECADDFAC(zvec, zvec, temp, fac);
+                       madd_v3_v3fl(zvec, temp, fac);
                }
                normalize_v3(zvec);
 
@@ -4484,7 +4486,7 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
                cross_v3_v3v3(yvec,zvec,xvec);
        }
        else {
-               VECSUB(zvec, bb->ob->obmat[3], bb->vec);
+               sub_v3_v3v3(zvec, bb->ob->obmat[3], bb->vec);
                if(bb->lock)
                        zvec[bb->align] = 0.0f;
                normalize_v3(zvec);
@@ -4498,22 +4500,22 @@ void psys_make_billboard(ParticleBillboardData *bb, float xvec[3], float yvec[3]
                cross_v3_v3v3(yvec,zvec,xvec);
        }
 
-       VECCOPY(tvec, xvec);
-       VECCOPY(tvec2, yvec);
+       copy_v3_v3(tvec, xvec);
+       copy_v3_v3(tvec2, yvec);
 
        mul_v3_fl(xvec, cos(bb->tilt * (float)M_PI));
        mul_v3_fl(tvec2, sin(bb->tilt * (float)M_PI));
-       VECADD(xvec, xvec, tvec2);
+       add_v3_v3(xvec, tvec2);
 
        mul_v3_fl(yvec, cos(bb->tilt * (float)M_PI));
        mul_v3_fl(tvec, -sin(bb->tilt * (float)M_PI));
-       VECADD(yvec, yvec, tvec);
+       add_v3_v3(yvec, tvec);
 
        mul_v3_fl(xvec, bb->size[0]);
        mul_v3_fl(yvec, bb->size[1]);
 
-       VECADDFAC(center, bb->vec, xvec, bb->offset[0]);
-       VECADDFAC(center, center, yvec, bb->offset[1]);
+       madd_v3_v3v3fl(center, bb->vec, xvec, bb->offset[0]);
+       madd_v3_v3fl(center, yvec, bb->offset[1]);
 }
 
 
index ec058b2..3e88fb7 100644 (file)
@@ -454,7 +454,7 @@ static void distribute_grid(DerivedMesh *dm, ParticleSystem *psys)
                max[2]=MAX2(max[2],mv->co[2]);
        }
 
-       VECSUB(delta,max,min);
+       sub_v3_v3v3(delta, max, min);
 
        /* determine major axis */
        axis = (delta[0]>=delta[1]) ? 0 : ((delta[1]>=delta[2]) ? 1 : 2);
@@ -815,7 +815,7 @@ static void distribute_threads_exec(ParticleThread *thread, ParticleData *pa, Ch
                        normalize_v3(nor);
                        mul_v3_fl(nor,-100.0);
 
-                       VECADD(co2,co1,nor);
+                       add_v3_v3v3(co2,co1,nor);
 
                        min_d=2.0;
                        intersect=0;
@@ -1099,11 +1099,11 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
 
                        for(p=0; p<totvert; p++) {
                                if(orcodata) {
-                                       VECCOPY(co,orcodata[p])
+                                       copy_v3_v3(co,orcodata[p]);
                                        transform_mesh_orco_verts((Mesh*)ob->data, &co, 1, 1);
                                }
                                else
-                                       VECCOPY(co,mv[p].co)
+                                       copy_v3_v3(co,mv[p].co);
                                BLI_kdtree_insert(tree,p,co,NULL);
                        }
 
@@ -1141,14 +1141,14 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
                        MFace *mf=dm->getFaceData(dm,i,CD_MFACE);
 
                        if(orcodata) {
-                               VECCOPY(co1, orcodata[mf->v1]);
-                               VECCOPY(co2, orcodata[mf->v2]);
-                               VECCOPY(co3, orcodata[mf->v3]);
+                               copy_v3_v3(co1, orcodata[mf->v1]);
+                               copy_v3_v3(co2, orcodata[mf->v2]);
+                               copy_v3_v3(co3, orcodata[mf->v3]);
                                transform_mesh_orco_verts((Mesh*)ob->data, &co1, 1, 1);
                                transform_mesh_orco_verts((Mesh*)ob->data, &co2, 1, 1);
                                transform_mesh_orco_verts((Mesh*)ob->data, &co3, 1, 1);
                                if(mf->v4) {
-                                       VECCOPY(co4, orcodata[mf->v4]);
+                                       copy_v3_v3(co4, orcodata[mf->v4]);
                                        transform_mesh_orco_verts((Mesh*)ob->data, &co4, 1, 1);
                                }
                        }
@@ -1156,12 +1156,12 @@ static int distribute_threads_init_data(ParticleThread *threads, Scene *scene, D
                                v1= (MVert*)dm->getVertData(dm,mf->v1,CD_MVERT);
                                v2= (MVert*)dm->getVertData(dm,mf->v2,CD_MVERT);
                                v3= (MVert*)dm->getVertData(dm,mf->v3,CD_MVERT);
-                               VECCOPY(co1, v1->co);
-                               VECCOPY(co2, v2->co);
-                               VECCOPY(co3, v3->co);
+                               copy_v3_v3(co1, v1->co);
+                               copy_v3_v3(co2, v2->co);
+                               copy_v3_v3(co3, v3->co);
                                if(mf->v4) {
                                        v4= (MVert*)dm->getVertData(dm,mf->v4,CD_MVERT);
-                                       VECCOPY(co4, v4->co);
+                                       copy_v3_v3(co4, v4->co);
                                }
                        }
 
@@ -1588,15 +1588,15 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
        if(part->tanfac!=0.0f){
                //float phase=vg_rot?2.0f*(psys_particle_value_from_verts(sim->psmd->dm,part->from,pa,vg_rot)-0.5f):0.0f;
                float phase=0.0f;
-               mul_v3_fl(vtan,-(float)cos((float)M_PI*(part->tanphase+phase)));
-               fac=-(float)sin((float)M_PI*(part->tanphase+phase));
-               VECADDFAC(vtan,vtan,utan,fac);
+               mul_v3_fl(vtan,-cosf((float)M_PI*(part->tanphase+phase)));
+               fac= -sinf((float)M_PI*(part->tanphase+phase));
+               madd_v3_v3fl(vtan, utan, fac);
 
                mul_mat3_m4_v3(ob->obmat,vtan);
 
-               VECCOPY(utan,nor);
+               copy_v3_v3(utan, nor);
                mul_v3_fl(utan,dot_v3v3(vtan,nor));
-               VECSUB(vtan,vtan,utan);
+               sub_v3_v3(vtan, utan);
                        
                normalize_v3(vtan);
        }
@@ -1648,7 +1648,7 @@ void psys_get_birth_coordinates(ParticleSimulationData *sim, ParticleData *pa, P
                        normalize_v3(state->ave);
                }
                else {
-                       VECCOPY(state->ave, nor);
+                       copy_v3_v3(state->ave, nor);
                }
 
                /* calculate rotation matrix */
@@ -2423,7 +2423,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
                pfr.element_size = MAXFLOAT;
        }
        sphdata->element_size = pfr.element_size;
-       VECCOPY(sphdata->flow, pfr.flow);
+       copy_v3_v3(sphdata->flow, pfr.flow);
 
        pressure =  stiffness * (pfr.density - rest_density);
        near_pressure = stiffness_near_fac * pfr.near_density;
@@ -2520,7 +2520,7 @@ static void sph_integrate(ParticleSimulationData *sim, ParticleData *pa, float d
 
        integrate_particle(part, pa, dtime, effector_acceleration, sph_force_cb, &sphdata);
        *element_size = sphdata.element_size;
-       VECCOPY(flow, sphdata.flow);
+       copy_v3_v3(flow, sphdata.flow);
 }
 
 /************************************************/
@@ -2592,21 +2592,21 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa
        if(part->dampfac != 0.f)
                mul_v3_fl(pa->state.vel, 1.f - part->dampfac * efdata.ptex.damp * 25.f * dtime);
 
-       //VECCOPY(pa->state.ave, states->ave);
+       //copy_v3_v3(pa->state.ave, states->ave);
 
        /* finally we do guides */
        time=(cfra-pa->time)/pa->lifetime;
        CLAMP(time, 0.0f, 1.0f);
 
-       VECCOPY(tkey.co,pa->state.co);
-       VECCOPY(tkey.vel,pa->state.vel);
+       copy_v3_v3(tkey.co,pa->state.co);
+       copy_v3_v3(tkey.vel,pa->state.vel);
        tkey.time=pa->state.time;
 
        if(part->type != PART_HAIR) {
                if(do_guides(sim->psys->effectors, &tkey, p, time)) {
-                       VECCOPY(pa->state.co,tkey.co);
+                       copy_v3_v3(pa->state.co,tkey.co);
                        /* guides don't produce valid velocity */
-                       VECSUB(pa->state.vel,tkey.co,pa->prev_state.co);
+                       sub_v3_v3v3(pa->state.vel, tkey.co, pa->prev_state.co);
                        mul_v3_fl(pa->state.vel,1.0f/dtime);
                        pa->state.time=tkey.time;
                }
@@ -3471,9 +3471,9 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
                        /* create fake root before actual root to resist bending */
                        if(k==0) {
                                float temp[3];
-                               VECSUB(temp, key->co, (key+1)->co);
-                               VECCOPY(mvert->co, key->co);
-                               VECADD(mvert->co, mvert->co, temp);
+                               sub_v3_v3v3(temp, key->co, (key+1)->co);
+                               copy_v3_v3(mvert->co, key->co);
+                               add_v3_v3v3(mvert->co, mvert->co, temp);
                                mul_m4_v3(hairmat, mvert->co);
                                mvert++;
 
@@ -3492,7 +3492,7 @@ static void do_hair_dynamics(ParticleSimulationData *sim)
                                }
                        }
 
-                       VECCOPY(mvert->co, key->co);
+                       copy_v3_v3(mvert->co, key->co);
                        mul_m4_v3(hairmat, mvert->co);
                        mvert++;
                        
@@ -3589,7 +3589,7 @@ static void save_hair(ParticleSimulationData *sim, float UNUSED(cfra)){
                mul_m4_v3(ob->imat, key->co);
 
                if(pa->totkey) {
-                       VECSUB(key->co, key->co, root->co);
+                       sub_v3_v3(key->co, root->co);
                        psys_vec_rot_to_face(sim->psmd->dm, pa, key->co);
                }
 
index ae12ad8..ba5b98e 100644 (file)
@@ -2147,9 +2147,9 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
        cache= pid->cache;
 
        if(timescale) {
-               time= bsystem_time(scene, ob, cfra, 0.0f);
-               nexttime= bsystem_time(scene, ob, cfra+1.0f, 0.0f);
-
+               time= BKE_curframe(scene);
+               nexttime= BKE_frame_to_ctime(scene, CFRA+1);
+               
                *timescale= MAX2(nexttime - time, 0.0f);
        }
 
@@ -2163,7 +2163,7 @@ void BKE_ptcache_id_time(PTCacheID *pid, Scene *scene, float cfra, int *startfra
                 * system timing. */
 #if 0
                if ((ob->partype & PARSLOW)==0) {
-                       offset= give_timeoffset(ob);
+                       offset= ob->sf;
 
                        *startframe += (int)(offset+0.5f);
                        *endframe += (int)(offset+0.5f);
index a9de75d..66d29b0 100644 (file)
@@ -806,6 +806,8 @@ int scene_camera_switch_update(Scene *scene)
                scene->camera= camera;
                return 1;
        }
+#else
+       (void)scene;
 #endif
        return 0;
 }
@@ -908,15 +910,20 @@ int scene_check_setscene(Main *bmain, Scene *sce)
 }
 
 /* This function is needed to cope with fractional frames - including two Blender rendering features
-* mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. */
-
-/* see also bsystem_time in object.c */
+ * mblur (motion blur that renders 'subframes' and blurs them together), and fields rendering. 
+ */
 float BKE_curframe(Scene *scene)
 {
-       float ctime = scene->r.cfra;
-       ctime+= scene->r.subframe;
-       ctime*= scene->r.framelen;      
+       return BKE_frame_to_ctime(scene, scene->r.cfra);
+}
 
+/* This function is used to obtain arbitrary fractional frames */
+float BKE_frame_to_ctime(Scene *scene, const float frame)
+{
+       float ctime = frame;
+       ctime += scene->r.subframe;
+       ctime *= scene->r.framelen;     
+       
        return ctime;
 }
 
index 9bde937..3e9b570 100644 (file)
@@ -1980,6 +1980,8 @@ static ImBuf * seq_render_scene_strip_impl(
        /* stooping to new low's in hackyness :( */
        oldmarkers= scene->markers;
        scene->markers.first= scene->markers.last= NULL;
+#else
+       (void)oldmarkers;
 #endif
        
        if(sequencer_view3d_cb && BLI_thread_is_main() && doseq_gl && (scene == context.scene || have_seq==0) && camera) {
index e47dcd6..3d788b4 100644 (file)
@@ -469,7 +469,7 @@ static void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *calc)
                        if(calc->smd->shrinkOpts & MOD_SHRINKWRAP_KEEP_ABOVE_SURFACE)
                        {
                                //Make the vertex stay on the front side of the face
-                               VECADDFAC(tmp_co, nearest.co, nearest.no, calc->keepDist);
+                               madd_v3_v3v3fl(tmp_co, nearest.co, nearest.no, calc->keepDist);
                        }
                        else
                        {
index 7174126..60941ef 100644 (file)
@@ -172,7 +172,7 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
                {
                        float tmp[3];
 
-                       VECCOPY(tmp, verts[i].co);
+                       copy_v3_v3(tmp, verts[i].co);
                        mul_m4_v3(ob->obmat, tmp);
 
                        // min BB
@@ -186,11 +186,11 @@ static int smokeModifier_init (SmokeModifierData *smd, Object *ob, Scene *scene,
                        max[2] = MAX2(max[2], tmp[2]);
                }
 
-               VECCOPY(smd->domain->p0, min);
-               VECCOPY(smd->domain->p1, max);
+               copy_v3_v3(smd->domain->p0, min);
+               copy_v3_v3(smd->domain->p1, max);
 
                // calc other res with max_res provided
-               VECSUB(size, max, min);
+               sub_v3_v3v3(size, max, min);
 
                // printf("size: %f, %f, %f\n", size[0], size[1], size[2]);
 
@@ -354,9 +354,9 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
        for(i = 0; i < dm->getNumVerts(dm); i++)
        {
                float tmpvec[3];
-               VECCOPY(tmpvec, mvert[i].co);
+               copy_v3_v3(tmpvec, mvert[i].co);
                mul_m4_v3(ob->obmat, tmpvec);
-               VECCOPY(&scs->points[i * 3], tmpvec);
+               copy_v3_v3(&scs->points[i * 3], tmpvec);
        }
        
        for(i = 0, facecounter = 0; i < dm->getNumFaces(dm); i++)
@@ -372,18 +372,18 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
                        
                        if(again == 1 && mface[i].v4)
                        {
-                               VECSUB(side1,  mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
-                               VECSUB(side2,  mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
+                               sub_v3_v3v3(side1,  mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
+                               sub_v3_v3v3(side2,  mvert[ mface[i].v4 ].co, mvert[ mface[i].v1 ].co);
                        }
                        else
                        {
-                               VECSUB(side1,  mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
-                               VECSUB(side2,  mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
+                               sub_v3_v3v3(side1,  mvert[ mface[i].v2 ].co, mvert[ mface[i].v1 ].co);
+                               sub_v3_v3v3(side2,  mvert[ mface[i].v3 ].co, mvert[ mface[i].v1 ].co);
                        }
 
                        cross_v3_v3v3(trinormorg, side1, side2);
                        normalize_v3(trinormorg);
-                       VECCOPY(trinorm, trinormorg);
+                       copy_v3_v3(trinorm, trinormorg);
                        mul_v3_fl(trinorm, 0.25 * cell_len);
 
                        for(j = 0; j <= divs1; j++)
@@ -401,43 +401,42 @@ static void fill_scs_points(Object *ob, DerivedMesh *dm, SmokeCollSettings *scs)
                                                continue;
                                        }
 
-                                       VECCOPY(p1, mvert[ mface[i].v1 ].co);
+                                       copy_v3_v3(p1, mvert[ mface[i].v1 ].co);
                                        if(again == 1 && mface[i].v4)
                                        {
-                                               VECCOPY(p2, mvert[ mface[i].v3 ].co);
-                                               VECCOPY(p3, mvert[ mface[i].v4 ].co);
+                                               copy_v3_v3(p2, mvert[ mface[i].v3 ].co);
+                                               copy_v3_v3(p3, mvert[ mface[i].v4 ].co);
                                        }
                                        else
                                        {
-                                               VECCOPY(p2, mvert[ mface[i].v2 ].co);
-                                               VECCOPY(p3, mvert[ mface[i].v3 ].co);
+                                               copy_v3_v3(p2, mvert[ mface[i].v2 ].co);
+                                               copy_v3_v3(p3, mvert[ mface[i].v3 ].co);
                                        }
 
                                        mul_v3_fl(p1, (1.0-uf-vf));
                                        mul_v3_fl(p2, uf);
                                        mul_v3_fl(p3, vf);
                                        
-                                       VECADD(p, p1, p2);
-                                       VECADD(p, p, p3);
+                                       add_v3_v3v3(p, p1, p2);
+                                       add_v3_v3(p, p3);
 
                                        if(newdivs > divs)
                                                printf("mem problem\n");
 
                                        // mMovPoints.push_back(p + trinorm);
-                                       VECCOPY(tmpvec, p);
-                                       VECADD(tmpvec, tmpvec, trinorm);
+                                       add_v3_v3v3(tmpvec, p, trinorm);
                                        mul_m4_v3(ob->obmat, tmpvec);
-                                       VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
+                                       copy_v3_v3(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
                                        newdivs++;
 
                                        if(newdivs > divs)
                                                printf("mem problem\n");
 
                                        // mMovPoints.push_back(p - trinorm);
-                                       VECCOPY(tmpvec, p);
-                                       VECSUB(tmpvec, tmpvec, trinorm);
+                                       copy_v3_v3(tmpvec, p);
+                                       sub_v3_v3(tmpvec, trinorm);
                                        mul_m4_v3(ob->obmat, tmpvec);
-                                       VECCOPY(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
+                                       copy_v3_v3(&scs->points[3 * (dm->getNumVerts(dm) + newdivs)], tmpvec);
                                        newdivs++;
                                }
                        }
@@ -488,23 +487,23 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
                float side3[3];
                int divs1=0, divs2=0, divs3=0;
 
-               VECCOPY(p0, verts[faces[i].v1].co);
+               copy_v3_v3(p0, verts[faces[i].v1].co);
                mul_m4_v3(ob->obmat, p0);
-               VECCOPY(p1, verts[faces[i].v2].co);
+               copy_v3_v3(p1, verts[faces[i].v2].co);
                mul_m4_v3(ob->obmat, p1);
-               VECCOPY(p2, verts[faces[i].v3].co);
+               copy_v3_v3(p2, verts[faces[i].v3].co);
                mul_m4_v3(ob->obmat, p2);
 
-               VECSUB(side1, p1, p0);
-               VECSUB(side2, p2, p0);
-               VECSUB(side3, p1, p2);
+               sub_v3_v3v3(side1, p1, p0);
+               sub_v3_v3v3(side2, p2, p0);
+               sub_v3_v3v3(side3, p1, p2);
 
-               if(INPR(side1, side1) > fsTri*fsTri) 
+               if(dot_v3v3(side1, side1) > fsTri*fsTri)
                { 
                        float tmp = normalize_v3(side1);
                        divs1 = (int)ceil(tmp/fsTri); 
                }
-               if(INPR(side2, side2) > fsTri*fsTri) 
+               if(dot_v3v3(side2, side2) > fsTri*fsTri)
                { 
                        float tmp = normalize_v3(side2);
                        divs2 = (int)ceil(tmp/fsTri); 
@@ -527,23 +526,23 @@ static void calcTriangleDivs(Object *ob, MVert *verts, int UNUSED(numverts), MFa
 
                        facecounter++;
                        
-                       VECCOPY(p0, verts[faces[i].v3].co);
+                       copy_v3_v3(p0, verts[faces[i].v3].co);
                        mul_m4_v3(ob->obmat, p0);
-                       VECCOPY(p1, verts[faces[i].v4].co);
+                       copy_v3_v3(p1, verts[faces[i].v4].co);
                        mul_m4_v3(ob->obmat, p1);
-                       VECCOPY(p2, verts[faces[i].v1].co);
+                       copy_v3_v3(p2, verts[faces[i].v1].co);
                        mul_m4_v3(ob->obmat, p2);
 
-                       VECSUB(side1, p1, p0);
-                       VECSUB(side2, p2, p0);
-                       VECSUB(side3, p1, p2);
+                       sub_v3_v3v3(side1, p1, p0);
+                       sub_v3_v3v3(side2, p2, p0);
+                       sub_v3_v3v3(side3, p1, p2);
 
-                       if(INPR(side1, side1) > fsTri*fsTri) 
+                       if(dot_v3v3(side1, side1) > fsTri*fsTri)
                        { 
                                float tmp = normalize_v3(side1);
                                divs1 = (int)ceil(tmp/fsTri); 
                        }
-                       if(INPR(side2, side2) > fsTri*fsTri) 
+                       if(dot_v3v3(side2, side2) > fsTri*fsTri)
                        { 
                                float tmp = normalize_v3(side2);
                                divs2 = (int)ceil(tmp/fsTri); 
@@ -1050,7 +1049,7 @@ static void smoke_calc_domain(Scene *scene, Object *ob, SmokeModifierData *smd)
                                                        if(psys_get_particle_state(&sim, p, &state, 0) == 0)
                                                                continue;
                                                        
-                                                       // VECCOPY(pos, pa->state.co);                                                                  
+                                                       // copy_v3_v3(pos, pa->state.co);
                                                        // mul_m4_v3(ob->imat, pos);                                                                                                                                            
                                                        // 1. get corresponding cell    
                                                        get_cell(smd->domain->p0, smd->domain->res, smd->domain->dx, state.co, cell, 0);                                                                                                                                        
@@ -1589,7 +1588,7 @@ static void get_cell(float *p0, int res[3], float dx, float *pos, int *cell, int
 {
        float tmp[3];
 
-       VECSUB(tmp, pos, p0);
+       sub_v3_v3v3(tmp, pos, p0);
        mul_v3_fl(tmp, 1.0 / dx);
 
        if(correct)
index 28925a7..5b02731 100644 (file)
@@ -321,7 +321,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
        /* determine the ortho BB */
        for(i=0; i < pccd_M->totvert; i++){
                /* evaluate limits */
-               VECCOPY(v,pccd_M->mvert[i].co);
+               copy_v3_v3(v,pccd_M->mvert[i].co);
                pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
                pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
                pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -345,7 +345,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
                mima->minx=mima->miny=mima->minz=1e30f;
                mima->maxx=mima->maxy=mima->maxz=-1e30f;
 
-               VECCOPY(v,pccd_M->mvert[mface->v1].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -353,7 +353,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mvert[mface->v2].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -361,7 +361,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mvert[mface->v3].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -370,7 +370,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
                if(mface->v4){
-                       VECCOPY(v,pccd_M->mvert[mface->v4].co);
+                       copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -419,7 +419,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
        /* determine the ortho BB */
        for(i=0; i < pccd_M->totvert; i++){
                /* evaluate limits */
-               VECCOPY(v,pccd_M->mvert[i].co);
+               copy_v3_v3(v,pccd_M->mvert[i].co);
                pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
                pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
                pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -429,7 +429,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                pccd_M->bbmax[2] = MAX2(pccd_M->bbmax[2],v[2]+hull);
 
                /* evaluate limits */
-               VECCOPY(v,pccd_M->mprevvert[i].co);
+               copy_v3_v3(v,pccd_M->mprevvert[i].co);
                pccd_M->bbmin[0] = MIN2(pccd_M->bbmin[0],v[0]-hull);
                pccd_M->bbmin[1] = MIN2(pccd_M->bbmin[1],v[1]-hull);
                pccd_M->bbmin[2] = MIN2(pccd_M->bbmin[2],v[2]-hull);
@@ -449,7 +449,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->minx=mima->miny=mima->minz=1e30f;
                mima->maxx=mima->maxy=mima->maxz=-1e30f;
 
-               VECCOPY(v,pccd_M->mvert[mface->v1].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v1].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -457,7 +457,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mvert[mface->v2].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v2].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -465,7 +465,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mvert[mface->v3].co);
+               copy_v3_v3(v,pccd_M->mvert[mface->v3].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -474,7 +474,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
                if(mface->v4){
-                       VECCOPY(v,pccd_M->mvert[mface->v4].co);
+                       copy_v3_v3(v,pccd_M->mvert[mface->v4].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -484,7 +484,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                }
 
 
-               VECCOPY(v,pccd_M->mprevvert[mface->v1].co);
+               copy_v3_v3(v,pccd_M->mprevvert[mface->v1].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -492,7 +492,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mprevvert[mface->v2].co);
+               copy_v3_v3(v,pccd_M->mprevvert[mface->v2].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -500,7 +500,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxy = MAX2(mima->maxy,v[1]+hull);
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
-               VECCOPY(v,pccd_M->mprevvert[mface->v3].co);
+               copy_v3_v3(v,pccd_M->mprevvert[mface->v3].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -509,7 +509,7 @@ static void ccd_mesh_update(Object *ob,ccd_Mesh *pccd_M)
                mima->maxz = MAX2(mima->maxz,v[2]+hull);
 
                if(mface->v4){
-                       VECCOPY(v,pccd_M->mprevvert[mface->v4].co);
+                       copy_v3_v3(v,pccd_M->mprevvert[mface->v4].co);
                mima->minx = MIN2(mima->minx,v[0]-hull);
                mima->miny = MIN2(mima->miny,v[1]-hull);
                mima->minz = MIN2(mima->minz,v[2]-hull);
@@ -1024,8 +1024,8 @@ static int sb_detect_aabb_collisionCached(        float UNUSED(force[3]), unsigned int
 #endif
 
        if ((sb == NULL) || (sb->scratch ==NULL)) return 0;
-       VECCOPY(aabbmin,sb->scratch->aabbmin);
-       VECCOPY(aabbmax,sb->scratch->aabbmax);
+       copy_v3_v3(aabbmin,sb->scratch->aabbmin);
+       copy_v3_v3(aabbmax,sb->scratch->aabbmax);
 
        hash  = vertexowner->soft->scratch->colliderhash;
        ihash = BLI_ghashIterator_new(hash);
@@ -1099,8 +1099,8 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
        aabbmax[2] = MAX3(face_v1[2],face_v2[2],face_v3[2]);
 
        /* calculate face normal once again SIGH */
-       VECSUB(edge1, face_v1, face_v2);
-       VECSUB(edge2, face_v3, face_v2);
+       sub_v3_v3v3(edge1, face_v1, face_v2);
+       sub_v3_v3v3(edge2, face_v3, face_v2);
        cross_v3_v3v3(d_nvect, edge2, edge1);
        normalize_v3(d_nvect);
 
@@ -1143,13 +1143,13 @@ static int sb_detect_face_pointCached(float face_v1[3],float face_v2[3],float fa
                                /* use mesh*/
                                if (mvert) {
                                        while(a){
-                                               VECCOPY(nv1,mvert[a-1].co);
+                                               copy_v3_v3(nv1,mvert[a-1].co);
                                                if(mprevvert){
                                                        mul_v3_fl(nv1,time);
                                                        Vec3PlusStVec(nv1,(1.0f-time),mprevvert[a-1].co);
                                                }
                                                /* origin to face_v2*/
-                                               VECSUB(nv1, nv1, face_v2);
+                                               sub_v3_v3(nv1, face_v2);
                                                facedist = dot_v3v3(nv1,d_nvect);
                                                if (ABS(facedist)<outerfacethickness){
                                                        if (isect_point_tri_prism_v3(nv1, face_v1,face_v2,face_v3) ){
@@ -1253,11 +1253,11 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
 
                                        if (mvert){
 
-                                               VECCOPY(nv1,mvert[mface->v1].co);
-                                               VECCOPY(nv2,mvert[mface->v2].co);
-                                               VECCOPY(nv3,mvert[mface->v3].co);
+                                               copy_v3_v3(nv1,mvert[mface->v1].co);
+                                               copy_v3_v3(nv2,mvert[mface->v2].co);
+                                               copy_v3_v3(nv3,mvert[mface->v3].co);
                                                if (mface->v4){
-                                                       VECCOPY(nv4,mvert[mface->v4].co);
+                                                       copy_v3_v3(nv4,mvert[mface->v4].co);
                                                }
                                                if (mprevvert){
                                                        mul_v3_fl(nv1,time);
@@ -1277,8 +1277,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
                                        }
 
                                        /* switch origin to be nv2*/
-                                       VECSUB(edge1, nv1, nv2);
-                                       VECSUB(edge2, nv3, nv2);
+                                       sub_v3_v3v3(edge1, nv1, nv2);
+                                       sub_v3_v3v3(edge2, nv3, nv2);
                                        cross_v3_v3v3(d_nvect, edge2, edge1);
                                        normalize_v3(d_nvect);
                                        if (
@@ -1291,8 +1291,8 @@ static int sb_detect_face_collisionCached(float face_v1[3],float face_v2[3],floa
                                        }
                                        if (mface->v4){ /* quad */
                                                /* switch origin to be nv4 */
-                                               VECSUB(edge1, nv3, nv4);
-                                               VECSUB(edge2, nv1, nv4);
+                                               sub_v3_v3v3(edge1, nv3, nv4);
+                                               sub_v3_v3v3(edge2, nv1, nv4);
                                                cross_v3_v3v3(d_nvect, edge2, edge1);
                                                normalize_v3(d_nvect);
                                                if (
@@ -1481,11 +1481,11 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
 
                                        if (mvert){
 
-                                               VECCOPY(nv1,mvert[mface->v1].co);
-                                               VECCOPY(nv2,mvert[mface->v2].co);
-                                               VECCOPY(nv3,mvert[mface->v3].co);
+                                               copy_v3_v3(nv1,mvert[mface->v1].co);
+                                               copy_v3_v3(nv2,mvert[mface->v2].co);
+                                               copy_v3_v3(nv3,mvert[mface->v3].co);
                                                if (mface->v4){
-                                                       VECCOPY(nv4,mvert[mface->v4].co);
+                                                       copy_v3_v3(nv4,mvert[mface->v4].co);
                                                }
                                                if (mprevvert){
                                                        mul_v3_fl(nv1,time);
@@ -1505,16 +1505,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
                                        }
 
                                        /* switch origin to be nv2*/
-                                       VECSUB(edge1, nv1, nv2);
-                                       VECSUB(edge2, nv3, nv2);
+                                       sub_v3_v3v3(edge1, nv1, nv2);
+                                       sub_v3_v3v3(edge2, nv3, nv2);
 
                                        cross_v3_v3v3(d_nvect, edge2, edge1);
                                        normalize_v3(d_nvect);
                                        if ( isect_line_tri_v3(edge_v1, edge_v2, nv1, nv2, nv3, &t, NULL)){
                                                float v1[3],v2[3];
                                                float intrusiondepth,i1,i2;
-                                               VECSUB(v1, edge_v1, nv2);
-                                               VECSUB(v2, edge_v2, nv2);
+                                               sub_v3_v3v3(v1, edge_v1, nv2);
+                                               sub_v3_v3v3(v2, edge_v2, nv2);
                                                i1 = dot_v3v3(v1,d_nvect);
                                                i2 = dot_v3v3(v2,d_nvect);
                                                intrusiondepth = -MIN2(i1,i2)/el;
@@ -1524,16 +1524,16 @@ static int sb_detect_edge_collisionCached(float edge_v1[3],float edge_v2[3],floa
                                        }
                                        if (mface->v4){ /* quad */
                                                /* switch origin to be nv4 */
-                                               VECSUB(edge1, nv3, nv4);
-                                               VECSUB(edge2, nv1, nv4);
+                                               sub_v3_v3v3(edge1, nv3, nv4);
+                                               sub_v3_v3v3(edge2, nv1, nv4);
 
                                                cross_v3_v3v3(d_nvect, edge2, edge1);
                                                normalize_v3(d_nvect);
                                                if (isect_line_tri_v3( edge_v1, edge_v2,nv1, nv3, nv4, &t, NULL)){
                                                        float v1[3],v2[3];
                                                        float intrusiondepth,i1,i2;
-                                                       VECSUB(v1, edge_v1, nv4);
-                                                       VECSUB(v2, edge_v2, nv4);
+                                                       sub_v3_v3v3(v1, edge_v1, nv4);
+                                                       sub_v3_v3v3(v2, edge_v2, nv4);
                                                i1 = dot_v3v3(v1,d_nvect);
                                                i2 = dot_v3v3(v2,d_nvect);
                                                intrusiondepth = -MIN2(i1,i2)/el;
@@ -1602,16 +1602,16 @@ static void _scan_for_ext_spring_forces(Scene *scene, Object *ob, float timenow,
                                        }
                                        /* media in rest */
                                        else{
-                                               VECADD(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
+                                               add_v3_v3v3(vel, sb->bpoint[bs->v1].vec , sb->bpoint[bs->v2].vec);
                                        }
                                        f = normalize_v3(vel);
                                        f = -0.0001f*f*f*sb->aeroedge;
                                        /* (todo) add a nice angle dependant function done for now BUT */
                                        /* still there could be some nice drag/lift function, but who needs it */
 
-                                       VECSUB(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
+                                       sub_v3_v3v3(sp, sb->bpoint[bs->v1].pos , sb->bpoint[bs->v2].pos);
                                        project_v3_v3v3(pr,vel,sp);
-                                       VECSUB(vel,vel,pr);
+                                       sub_v3_v3(vel, pr);
                                        normalize_v3(vel);
                                        if (ob->softflag & OB_SB_AERO_ANGLE){
                                                normalize_v3(sp);
@@ -1725,9 +1725,9 @@ static int choose_winner(float*w, float* pos,float*a,float*b,float*c,float*ca,fl
                winner =3;
        }
        switch (winner){
-               case 1: VECCOPY(w,ca); break;
-               case 2: VECCOPY(w,cb); break;
-               case 3: VECCOPY(w,cc);
+               case 1: copy_v3_v3(w,ca); break;
+               case 2: copy_v3_v3(w,cb); break;
+               case 3: copy_v3_v3(w,cc);
        }
        return(winner);
 }
@@ -1824,11 +1824,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
 
                                        if (mvert){
 
-                                               VECCOPY(nv1,mvert[mface->v1].co);
-                                               VECCOPY(nv2,mvert[mface->v2].co);
-                                               VECCOPY(nv3,mvert[mface->v3].co);
+                                               copy_v3_v3(nv1,mvert[mface->v1].co);
+                                               copy_v3_v3(nv2,mvert[mface->v2].co);
+                                               copy_v3_v3(nv3,mvert[mface->v3].co);
                                                if (mface->v4){
-                                                       VECCOPY(nv4,mvert[mface->v4].co);
+                                                       copy_v3_v3(nv4,mvert[mface->v4].co);
                                                }
 
                                                if (mprevvert){
@@ -1838,11 +1838,11 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        since the AABB reduced propabitlty to get here drasticallly
                                                        it might be a nice tradeof CPU <--> memory
                                                        */
-                                                       VECSUB(vv1,nv1,mprevvert[mface->v1].co);
-                                                       VECSUB(vv2,nv2,mprevvert[mface->v2].co);
-                                                       VECSUB(vv3,nv3,mprevvert[mface->v3].co);
+                                                       sub_v3_v3v3(vv1,nv1,mprevvert[mface->v1].co);
+                                                       sub_v3_v3v3(vv2,nv2,mprevvert[mface->v2].co);
+                                                       sub_v3_v3v3(vv3,nv3,mprevvert[mface->v3].co);
                                                        if (mface->v4){
-                                                               VECSUB(vv4,nv4,mprevvert[mface->v4].co);
+                                                               sub_v3_v3v3(vv4,nv4,mprevvert[mface->v4].co);
                                                        }
 
                                                        mul_v3_fl(nv1,time);
@@ -1862,9 +1862,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                        }
 
                                        /* switch origin to be nv2*/
-                                       VECSUB(edge1, nv1, nv2);
-                                       VECSUB(edge2, nv3, nv2);
-                                       VECSUB(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
+                                       sub_v3_v3v3(edge1, nv1, nv2);
+                                       sub_v3_v3v3(edge2, nv3, nv2);
+                                       sub_v3_v3v3(dv1,opco,nv2); /* abuse dv1 to have vertex in question at *origin* of triangle */
 
                                        cross_v3_v3v3(d_nvect, edge2, edge1);
                                        /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
@@ -1890,7 +1890,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        }
                                                        if ((mprevvert) && (*damp > 0.0f)){
                                                                choose_winner(ve,opco,nv1,nv2,nv3,vv1,vv2,vv3);
-                                                               VECADD(avel,avel,ve);
+                                                               add_v3_v3(avel, ve);
                                                                cavel ++;
                                                        }
                                                        *intrusion += facedist;
@@ -1899,9 +1899,9 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                        }
                                        if (mface->v4){ /* quad */
                                                /* switch origin to be nv4 */
-                                               VECSUB(edge1, nv3, nv4);
-                                               VECSUB(edge2, nv1, nv4);
-                                               VECSUB(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
+                                               sub_v3_v3v3(edge1, nv3, nv4);
+                                               sub_v3_v3v3(edge2, nv1, nv4);
+                                               sub_v3_v3v3(dv1,opco,nv4); /* abuse dv1 to have vertex in question at *origin* of triangle */
 
                                                cross_v3_v3v3(d_nvect, edge2, edge1);
                                                /* n_mag = */ /* UNUSED */ normalize_v3(d_nvect);
@@ -1926,7 +1926,7 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
 
                                                                if ((mprevvert) && (*damp > 0.0f)){
                                                                        choose_winner(ve,opco,nv1,nv3,nv4,vv1,vv3,vv4);
-                                                                       VECADD(avel,avel,ve);
+                                                                       add_v3_v3(avel, ve);
                                                                        cavel ++;
                                                                }
                                                                *intrusion += facedist;
@@ -1939,46 +1939,46 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
                                                        float dist;
 
                                                        closest_to_line_segment_v3(ve, opco, nv1, nv2);
-                                                        VECSUB(ve,opco,ve);
+                                                        sub_v3_v3v3(ve,opco,ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )){
-                                                               VECCOPY(coledge,ve);
+                                                               copy_v3_v3(coledge,ve);
                                                                mindistedge = dist,
                                                                deflected=1;
                                                        }
 
                                                        closest_to_line_segment_v3(ve, opco, nv2, nv3);
-                                                        VECSUB(ve,opco,ve);
+                                                        sub_v3_v3v3(ve,opco,ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )){
-                                                               VECCOPY(coledge,ve);
+                                                               copy_v3_v3(coledge,ve);
                                                                mindistedge = dist,
                                                                deflected=1;
                                                        }
 
                                                        closest_to_line_segment_v3(ve, opco, nv3, nv1);
-                                                        VECSUB(ve,opco,ve);
+                                                        sub_v3_v3v3(ve,opco,ve);
                                                        dist = normalize_v3(ve);
                                                        if ((dist < outerfacethickness)&&(dist < mindistedge )){
-                                                               VECCOPY(coledge,ve);
+                                                               copy_v3_v3(coledge,ve);
                                                                mindistedge = dist,
                                                                deflected=1;
                                                        }
                                                        if (mface->v4){ /* quad */
                                                                closest_to_line_segment_v3(ve, opco, nv3, nv4);
-                                                               VECSUB(ve,opco,ve);
+                                                               sub_v3_v3v3(ve,opco,ve);
                                                                dist = normalize_v3(ve);
                                                                if ((dist < outerfacethickness)&&(dist < mindistedge )){
-                                                                       VECCOPY(coledge,ve);
+                                                                       copy_v3_v3(coledge,ve);
                                                                        mindistedge = dist,
                                                                                deflected=1;
                                                                }
 
                                                                closest_to_line_segment_v3(ve, opco, nv1, nv4);
-                                                               VECSUB(ve,opco,ve);
+                                                               sub_v3_v3v3(ve,opco,ve);
                                                                dist = normalize_v3(ve);
                                                                if ((dist < outerfacethickness)&&(dist < mindistedge )){
-                                                                       VECCOPY(coledge,ve);
+                                                                       copy_v3_v3(coledge,ve);
                                                                        mindistedge = dist,
                                                                                deflected=1;
                                                                }
@@ -2007,15 +2007,15 @@ static int sb_detect_vertex_collisionCached(float opco[3], float facenormal[3],
 
        }
        if (deflected == 2){ //  face inner detected
-               VECADD(force,force,innerforceaccu);
+               add_v3_v3(force, innerforceaccu);
        }
        if (deflected == 3){ //  face outer detected
-               VECADD(force,force,outerforceaccu);
+               add_v3_v3(force, outerforceaccu);
        }
 
        BLI_ghashIterator_free(ihash);
        if (cavel) mul_v3_fl(avel,1.0f/(float)cavel);
-       VECCOPY(vel,avel);
+       copy_v3_v3(vel,avel);
        if (ci) *intrusion /= ci;
        if (deflected){
                normalize_v3_v3(facenormal, force);
@@ -2029,7 +2029,7 @@ static int sb_deflect_face(Object *ob,float *actpos,float *facenormal,float *for
 {
        float s_actpos[3];
        int deflected;
-       VECCOPY(s_actpos,actpos);
+       copy_v3_v3(s_actpos,actpos);
        deflected= sb_detect_vertex_collisionCached(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
        //deflected= sb_detect_vertex_collisionCachedEx(s_actpos, facenormal, cf, force , ob->lay, ob,time,vel,intrusion);
        return(deflected);
@@ -2286,7 +2286,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                        /* gravitation */
                        if (sb && scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
                                float gravity[3];
-                               VECCOPY(gravity, scene->physics_settings.gravity);
+                               copy_v3_v3(gravity, scene->physics_settings.gravity);
                                mul_v3_fl(gravity, sb_grav_force_scale(ob)*_final_mass(ob,bp)*sb->effector_weights->global_gravity); /* individual mass of node here */
                                add_v3_v3(bp->force, gravity);
                        }
@@ -2303,7 +2303,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
 
                                /* apply forcefield*/
                                mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
-                               VECADD(bp->force, bp->force, force);
+                               add_v3_v3(bp->force, force);
 
                                /* BP friction in moving media */
                                kd= sb->mediafrict* eval_sb_fric_force_scale;
@@ -2337,7 +2337,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, Object *ob, flo
                                                        bp->choke = sb->choke*0.01f;
                                                }
 
-                                                       VECSUB(cfforce,bp->vec,vel);
+                                                       sub_v3_v3v3(cfforce,bp->vec,vel);
                                                        Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
 
                                        Vec3PlusStVec(bp->force,kd,defforce);
@@ -2524,7 +2524,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
 
 
                if (scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY){
-                       VECCOPY(gravity, scene->physics_settings.gravity);
+                       copy_v3_v3(gravity, scene->physics_settings.gravity);
                        mul_v3_fl(gravity, sb_grav_force_scale(ob)*sb->effector_weights->global_gravity);
                }
 
@@ -2697,7 +2697,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
 
 
                                /* gravitation */
-                               VECADDFAC(bp->force, bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */
+                               madd_v3_v3fl(bp->force, gravity, _final_mass(ob,bp)); /* individual mass of node here */
 
 
                                /* particle field & vortex */
@@ -2711,7 +2711,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
 
                                        /* apply forcefield*/
                                        mul_v3_fl(force,fieldfactor* eval_sb_fric_force_scale);
-                                       VECADD(bp->force, bp->force, force);
+                                       add_v3_v3(bp->force, force);
 
                                        /* BP friction in moving media */
                                        kd= sb->mediafrict* eval_sb_fric_force_scale;
@@ -2764,7 +2764,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                                                        }
                                                        else{
 
-                                                               VECSUB(cfforce,bp->vec,vel);
+                                                               sub_v3_v3v3(cfforce,bp->vec,vel);
                                                                Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
                                                        }
 
@@ -2774,7 +2774,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                                                        bp->choke = sb->choke*0.01f;
                                                }
                                                else{
-                                                       VECSUB(cfforce,bp->vec,vel);
+                                                       sub_v3_v3v3(cfforce,bp->vec,vel);
                                                        Vec3PlusStVec(bp->force,-cf*50.0f,cfforce);
                                                }
                                                Vec3PlusStVec(bp->force,kd,defforce);
@@ -2876,7 +2876,7 @@ static void softbody_calc_forces(Scene *scene, Object *ob, float forcetime, floa
                        else{
                                printf("Matrix inversion failed \n");
                                for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-                                       VECCOPY(bp->impdv,bp->force);
+                                       copy_v3_v3(bp->impdv,bp->force);
                                }
 
                        }
@@ -2923,7 +2923,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
 
                if(_final_goal(ob,bp) < SOFTGOALSNAP){
                        /* this makes t~ = t */
-                       if(mid_flags & MID_PRESERVE) VECCOPY(dx,bp->vec);
+                       if(mid_flags & MID_PRESERVE) copy_v3_v3(dx,bp->vec);
 
                        /* so here is (v)' = a(cceleration) = sum(F_springs)/m + gravitation + some friction forces  + more forces*/
                        /* the ( ... )' operator denotes derivate respective time */
@@ -2931,11 +2931,11 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
                        /* v(t + dt) = v(t) + a(t) * dt */
                        mul_v3_fl(bp->force,timeovermass);/* individual mass of node here */
                        /* some nasty if's to have heun in here too */
-                       VECCOPY(dv,bp->force);
+                       copy_v3_v3(dv,bp->force);
 
                        if (mode == 1){
-                               VECCOPY(bp->prevvec, bp->vec);
-                               VECCOPY(bp->prevdv, dv);
+                               copy_v3_v3(bp->prevvec, bp->vec);
+                               copy_v3_v3(bp->prevdv, dv);
                        }
 
                        if (mode ==2){
@@ -2948,10 +2948,10 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
                                maxerrvel = MAX2(maxerrvel,ABS(dv[1] - bp->prevdv[1]));
                                maxerrvel = MAX2(maxerrvel,ABS(dv[2] - bp->prevdv[2]));
                        }
-                       else {VECADD(bp->vec, bp->vec, bp->force);}
+                       else { add_v3_v3(bp->vec, bp->force); }
 
                        /* this makes t~ = t+dt */
-                       if(!(mid_flags & MID_PRESERVE)) VECCOPY(dx,bp->vec);
+                       if(!(mid_flags & MID_PRESERVE)) copy_v3_v3(dx,bp->vec);
 
                        /* so here is (x)'= v(elocity) */
                        /* the euler step for location then becomes */
@@ -2970,8 +2970,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
                        */
                        /* again some nasty if's to have heun in here too */
                        if (mode ==1){
-                               VECCOPY(bp->prevpos,bp->pos);
-                               VECCOPY(bp->prevdx ,dx);
+                               copy_v3_v3(bp->prevpos,bp->pos);
+                               copy_v3_v3(bp->prevdx ,dx);
                        }
 
                        if (mode ==2){
@@ -2994,7 +2994,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
                                }
 
                        }
-                       else { VECADD(bp->pos, bp->pos, dx);}
+                       else { add_v3_v3(bp->pos, dx);}
                }/*snap*/
                /* so while we are looping BPs anyway do statistics on the fly */
                aabbmin[0] = MIN2(aabbmin[0],bp->pos[0]);
@@ -3008,8 +3008,8 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
 
        if (sb->totpoint) mul_v3_fl(cm,1.0f/sb->totpoint);
        if (sb->scratch){
-               VECCOPY(sb->scratch->aabbmin,aabbmin);
-               VECCOPY(sb->scratch->aabbmax,aabbmax);
+               copy_v3_v3(sb->scratch->aabbmin,aabbmin);
+               copy_v3_v3(sb->scratch->aabbmax,aabbmax);
        }
 
        if (err){ /* so step size will be controlled by biggest difference in slope */
@@ -3032,8 +3032,8 @@ static void softbody_restore_prev_step(Object *ob)
        int a;
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-               VECCOPY(bp->vec, bp->prevvec);
-               VECCOPY(bp->pos, bp->prevpos);
+               copy_v3_v3(bp->vec, bp->prevvec);
+               copy_v3_v3(bp->pos, bp->prevpos);
        }
 }
 
@@ -3045,8 +3045,8 @@ static void softbody_store_step(Object *ob)
        int a;
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
-               VECCOPY(bp->prevvec,bp->vec);
-               VECCOPY(bp->prevpos,bp->pos);
+               copy_v3_v3(bp->prevvec,bp->vec);
+               copy_v3_v3(bp->prevpos,bp->pos);
        }
 }
 
@@ -3061,10 +3061,10 @@ static void softbody_store_state(Object *ob,float *ppos,float *pvel)
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
 
-               VECCOPY(pv, bp->vec);
+               copy_v3_v3(pv, bp->vec);
                pv+=3;
 
-               VECCOPY(pp, bp->pos);
+               copy_v3_v3(pp, bp->pos);
                pp+=3;
        }
 }
@@ -3079,10 +3079,10 @@ static void softbody_retrieve_state(Object *ob,float *ppos,float *pvel)
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
 
-               VECCOPY(bp->vec,pv);
+               copy_v3_v3(bp->vec,pv);
                pv+=3;
 
-               VECCOPY(bp->pos,pp);
+               copy_v3_v3(bp->pos,pp);
                pp+=3;
        }
 }
@@ -3098,14 +3098,14 @@ static void softbody_swap_state(Object *ob,float *ppos,float *pvel)
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
 
-               VECCOPY(temp, bp->vec);
-               VECCOPY(bp->vec,pv);
-               VECCOPY(pv,temp);
+               copy_v3_v3(temp, bp->vec);
+               copy_v3_v3(bp->vec,pv);
+               copy_v3_v3(pv,temp);
                pv+=3;
 
-               VECCOPY(temp, bp->pos);
-               VECCOPY(bp->pos,pp);
-               VECCOPY(pp,temp);
+               copy_v3_v3(temp, bp->pos);
+               copy_v3_v3(bp->pos,pp);
+               copy_v3_v3(pp,temp);
                pp+=3;
        }
 }
@@ -3126,8 +3126,8 @@ static void softbody_apply_goalsnap(Object *ob)
 
        for(a=sb->totpoint, bp= sb->bpoint; a>0; a--, bp++) {
                if (_final_goal(ob,bp) >= SOFTGOALSNAP){
-                       VECCOPY(bp->prevpos,bp->pos);
-                       VECCOPY(bp->pos,bp->origT);
+                       copy_v3_v3(bp->prevpos,bp->pos);
+                       copy_v3_v3(bp->pos,bp->origT);
                }
        }
 }
@@ -3238,7 +3238,7 @@ static void springs_from_mesh(Object *ob)
                if(me->totvert) {
                        bp= ob->soft->bpoint;
                        for(a=0; a<me->totvert; a++, bp++) {
-                               VECCOPY(bp->origS, me->mvert[a].co);
+                               copy_v3_v3(bp->origS, me->mvert[a].co);
                                mul_m4_v3(ob->obmat, bp->origS);
                        }
 
@@ -3399,12 +3399,12 @@ static void reference_to_scratch(Object *ob)
        bp= ob->soft->bpoint;
        rp= sb->scratch->Ref.ivert;
        for(a=0; a<sb->totpoint; a++, rp++, bp++) {
-               VECCOPY(rp->pos,bp->pos);
-               VECADD(accu_pos,accu_pos,bp->pos);
+               copy_v3_v3(rp->pos,bp->pos);
+               add_v3_v3(accu_pos, bp->pos);
                accu_mass += _final_mass(ob,bp);
        }
        mul_v3_fl(accu_pos,1.0f/accu_mass);
-       VECCOPY(sb->scratch->Ref.com,accu_pos);
+       copy_v3_v3(sb->scratch->Ref.com,accu_pos);
        /* printf("reference_to_scratch \n"); */
 }
 
@@ -3415,9 +3415,9 @@ when object is rescaled
 static float globallen(float *v1,float *v2,Object *ob)
 {
        float p1[3],p2[3];
-       VECCOPY(p1,v1);
+       copy_v3_v3(p1,v1);
        mul_m4_v3(ob->obmat, p1);
-       VECCOPY(p2,v2);
+       copy_v3_v3(p2,v2);
        mul_m4_v3(ob->obmat, p2);
        return len_v3v3(p1,p2);
 }
@@ -3656,7 +3656,7 @@ static void softbody_to_object(Object *ob, float (*vertexCos)[3], int numVerts,
                invert_m4_m4(ob->imat, ob->obmat);
 
                for(a=0; a<numVerts; a++, bp++) {
-                       VECCOPY(vertexCos[a], bp->pos);
+                       copy_v3_v3(vertexCos[a], bp->pos);
                        if(local==0)
                                mul_m4_v3(ob->imat, vertexCos[a]);      /* softbody is in global coords, baked optionally not */
                }
@@ -3784,14 +3784,14 @@ static void softbody_update_positions(Object *ob, SoftBody *sb, float (*vertexCo
 
        for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
                /* store where goals are now */
-               VECCOPY(bp->origS, bp->origE);
+               copy_v3_v3(bp->origS, bp->origE);
                /* copy the position of the goals at desired end time */
-               VECCOPY(bp->origE, vertexCos[a]);
+               copy_v3_v3(bp->origE, vertexCos[a]);
                /* vertexCos came from local world, go global */
                mul_m4_v3(ob->obmat, bp->origE);
                /* just to be save give bp->origT a defined value
                will be calulated in interpolate_exciter()*/
-               VECCOPY(bp->origT, bp->origE);
+               copy_v3_v3(bp->origT, bp->origE);
        }
 }
 
@@ -3828,14 +3828,14 @@ void SB_estimate_transform(Object *ob,float lloc[3],float lrot[3][3],float lscal
        rpos= MEM_callocN( (sb->totpoint)*3*sizeof(float), "SB_RPOS");
        /* might filter vertex selection with a vertex group */
        for(a=0, bp=sb->bpoint, rp=sb->scratch->Ref.ivert; a<sb->totpoint; a++, bp++, rp++) {
-               VECCOPY(rpos[a],rp->pos);
-               VECCOPY(opos[a],bp->pos);
+               copy_v3_v3(rpos[a],rp->pos);
+               copy_v3_v3(opos[a],bp->pos);
        }
 
        vcloud_estimate_transform(sb->totpoint, opos, NULL, rpos, NULL, com, rcom,lrot,lscale);
-       //VECSUB(com,com,rcom);
-       if (lloc) VECCOPY(lloc,com);
-       VECCOPY(sb->lcom,com);
+       //sub_v3_v3(com,rcom);
+       if (lloc) copy_v3_v3(lloc,com);
+       copy_v3_v3(sb->lcom,com);
        if (lscale) copy_m3_m3(sb->lscale,lscale);
        if (lrot)   copy_m3_m3(sb->lrot,lrot);
 
@@ -3850,11 +3850,11 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
        int a;
 
        for(a=0,bp=sb->bpoint; a<numVerts; a++, bp++) {
-               VECCOPY(bp->pos, vertexCos[a]);
+               copy_v3_v3(bp->pos, vertexCos[a]);
                mul_m4_v3(ob->obmat, bp->pos);  /* yep, sofbody is global coords*/
-               VECCOPY(bp->origS, bp->pos);
-               VECCOPY(bp->origE, bp->pos);
-               VECCOPY(bp->origT, bp->pos);
+               copy_v3_v3(bp->origS, bp->pos);
+               copy_v3_v3(bp->origE, bp->pos);
+               copy_v3_v3(bp->origT, bp->pos);
                bp->vec[0]= bp->vec[1]= bp->vec[2]= 0.0f;
 
                /* the bp->prev*'s are for rolling back from a canceled try to propagate in time
@@ -3869,10 +3869,10 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
                4.b yup we're done
                */
 
-               VECCOPY(bp->prevpos, bp->pos);
-               VECCOPY(bp->prevvec, bp->vec);
-               VECCOPY(bp->prevdx, bp->vec);
-               VECCOPY(bp->prevdv, bp->vec);
+               copy_v3_v3(bp->prevpos, bp->pos);
+               copy_v3_v3(bp->prevvec, bp->vec);
+               copy_v3_v3(bp->prevdx, bp->vec);
+               copy_v3_v3(bp->prevdv, bp->vec);
        }
 
        /* make a nice clean scratch struc */
index 986e0e2..9848b27 100644 (file)
@@ -668,7 +668,7 @@ static void ccgDM_getFinalVertCo(DerivedMesh *dm, int vertNum, float co_r[3])
        MVert mvert;
 
        ccgDM_getFinalVert(dm, vertNum, &mvert);
-       VECCOPY(co_r, mvert.co);
+       copy_v3_v3(co_r, mvert.co);
 }
 
 static void ccgDM_getFinalVertNo(DerivedMesh *dm, int vertNum, float no_r[3])
index d3bd7d7..3aa289d 100644 (file)
@@ -227,7 +227,7 @@ void init_mapping(TexMapping *texmap)
        mul_m3_m3m3(mat, rmat, smat);
        
        copy_m4_m3(texmap->mat, mat);
-       VECCOPY(texmap->mat[3], texmap->loc);
+       copy_v3_v3(texmap->mat[3], texmap->loc);
 
 }
 
index 4daa27a..8ead7bf 100644 (file)
@@ -85,11 +85,11 @@ BVHTree *BLI_bvhtree_new(int maxsize, float epsilon, char tree_type, char axis);
 void BLI_bvhtree_free(BVHTree *tree);
 
 /* construct: first insert points, then call balance */
-int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints);
+int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints);
 void BLI_bvhtree_balance(BVHTree *tree);
 
 /* update: first update points/nodes, then call update_tree to refit the bounding volumes */
-int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints);
+int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints);
 void BLI_bvhtree_update_tree(BVHTree *tree);
 
 /* collision/overlap: check two trees if they overlap, alloc's *overlap with length of the int return value */
@@ -98,14 +98,14 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
 float BLI_bvhtree_getepsilon(BVHTree *tree);
 
 /* find nearest node to the given coordinates (if nearest is given it will only search nodes where square distance is smaller than nearest->dist) */
-int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata);
+int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata);
 
-int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
 
-float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos);
+float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3]);
 
 /* range query */
-int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata);
+int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata);
 
 #ifdef __cplusplus
 }
index d173415..f01777b 100644 (file)
@@ -387,7 +387,7 @@ static void build_skip_links(BVHTree *tree, BVHNode *node, BVHNode *left, BVHNod
 /*
  * BVHTree bounding volumes functions
  */
-static void create_kdop_hull(BVHTree *tree, BVHNode *node, float *co, int numpoints, int moving)
+static void create_kdop_hull(BVHTree *tree, BVHNode *node, const float *co, int numpoints, int moving)
 {
        float newminmax;
        float *bv = node->bv;
@@ -973,7 +973,7 @@ void BLI_bvhtree_balance(BVHTree *tree)
        //bvhtree_info(tree);
 }
 
-int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints)
+int BLI_bvhtree_insert(BVHTree *tree, int index, const float *co, int numpoints)
 {
        int i;
        BVHNode *node = NULL;
@@ -1005,7 +1005,7 @@ int BLI_bvhtree_insert(BVHTree *tree, int index, float *co, int numpoints)
 
 
 // call before BLI_bvhtree_update_tree()
-int BLI_bvhtree_update_node(BVHTree *tree, int index, float *co, float *co_moving, int numpoints)
+int BLI_bvhtree_update_node(BVHTree *tree, int index, const float *co, const float *co_moving, int numpoints)
 {
        int i;
        BVHNode *node= NULL;
@@ -1194,7 +1194,7 @@ BVHTreeOverlap *BLI_bvhtree_overlap(BVHTree *tree1, BVHTree *tree2, unsigned int
 }
 
 //Determines the nearest point of the given node BV. Returns the squared distance to that point.
-static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest)
+static float calc_nearest_point(const float proj[3], BVHNode *node, float *nearest)
 {
        int i;
        const float *bv = node->bv;
@@ -1212,7 +1212,7 @@ static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest
 
 /*
        //nearest on a general hull
-       VECCOPY(nearest, data->co);
+       copy_v3_v3(nearest, data->co);
        for(i = data->tree->start_axis; i != data->tree->stop_axis; i++, bv+=2)
        {
                float proj = dot_v3v3( nearest, KDOP_AXES[i]);
@@ -1221,11 +1221,11 @@ static float calc_nearest_point(const float *proj, BVHNode *node, float *nearest
 
                if(dl > 0)
                {
-                       VECADDFAC(nearest, nearest, KDOP_AXES[i], dl);
+                       madd_v3_v3fl(nearest, KDOP_AXES[i], dl);
                }
                else if(du < 0)
                {
-                       VECADDFAC(nearest, nearest, KDOP_AXES[i], du);
+                       madd_v3_v3fl(nearest, KDOP_AXES[i], du);
                }
        }
 */
@@ -1377,7 +1377,7 @@ static void bfs_find_nearest(BVHNearestData *data, BVHNode *node)
 #endif
 
 
-int BLI_bvhtree_find_nearest(BVHTree *tree, const float *co, BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
+int BLI_bvhtree_find_nearest(BVHTree *tree, const float co[3], BVHTreeNearest *nearest, BVHTree_NearestPointCallback callback, void *userdata)
 {
        int i;
 
@@ -1510,7 +1510,7 @@ static void dfs_raycast(BVHRayCastData *data, BVHNode *node)
                {
                        data->hit.index = node->index;
                        data->hit.dist  = dist;
-                       VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist);
+                       madd_v3_v3v3fl(data->hit.co, data->ray.origin, data->ray.direction, dist);
                }
        }
        else
@@ -1553,7 +1553,7 @@ static void iterative_raycast(BVHRayCastData *data, BVHNode *node)
                        {
                                data->hit.index = node->index;
                                data->hit.dist  = dist;
-                               VECADDFAC(data->hit.co, data->ray.origin, data->ray.direction, dist);
+                               madd_v3_v3v3fl(data->hit.co, data->ray.origin, data->ray.direction, dist);
                        }
                        
                        node = node->skip[1];
@@ -1566,7 +1566,7 @@ static void iterative_raycast(BVHRayCastData *data, BVHNode *node)
 }
 #endif
 
-int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
+int BLI_bvhtree_ray_cast(BVHTree *tree, const float co[3], const float dir[3], float radius, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata)
 {
        int i;
        BVHRayCastData data;
@@ -1577,8 +1577,8 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
        data.callback = callback;
        data.userdata = userdata;
 
-       VECCOPY(data.ray.origin,    co);
-       VECCOPY(data.ray.direction, dir);
+       copy_v3_v3(data.ray.origin,    co);
+       copy_v3_v3(data.ray.direction, dir);
        data.ray.radius = radius;
 
        normalize_v3(data.ray.direction);
@@ -1620,7 +1620,7 @@ int BLI_bvhtree_ray_cast(BVHTree *tree, const float *co, const float *dir, float
        return data.hit.index;
 }
 
-float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, float *pos)
+float BLI_bvhtree_bb_raycast(float *bv, const float light_start[3], const float light_end[3], float pos[3])
 {
        BVHRayCastData data;
        float dist = 0.0;
@@ -1639,13 +1639,13 @@ float BLI_bvhtree_bb_raycast(float *bv, float *light_start, float *light_end, fl
        data.ray.origin[2] = light_start[2];
        
        normalize_v3(data.ray.direction);
-       VECCOPY(data.ray_dot_axis, data.ray.direction);
+       copy_v3_v3(data.ray_dot_axis, data.ray.direction);
        
        dist = ray_nearest_hit(&data, bv);
        
        if(dist > 0.0f)
        {
-               VECADDFAC(pos, light_start, data.ray.direction, dist);
+               madd_v3_v3v3fl(pos, light_start, data.ray.direction, dist);
        }
        return dist;
        
@@ -1706,7 +1706,7 @@ static void dfs_range_query(RangeQueryData *data, BVHNode *node)
        }
 }
 
-int BLI_bvhtree_range_query(BVHTree *tree, const float *co, float radius, BVHTree_RangeQuery callback, void *userdata)
+int BLI_bvhtree_range_query(BVHTree *tree, const float co[3], float radius, BVHTree_RangeQuery callback, void *userdata)
 {
        BVHNode * root = tree->nodes[tree->totleaf];
 
index 6dd278e..d0d3d0e 100644 (file)
@@ -823,14 +823,14 @@ static void testAxialSymmetry(BGraph *graph, BNode* root_node, BNode* node1, BNo
        }
        
        /* mirror node2 along axis */
-       VECCOPY(p, node2->p);
+       copy_v3_v3(p, node2->p);
        BLI_mirrorAlongAxis(p, root_node->p, nor);
        
        /* check if it's within limit before continuing */
        if (len_v3v3(node1->p, p) <= limit)
        {
                /* mark node as symmetric physically */
-               VECCOPY(root_node->symmetry_axis, nor);
+               copy_v3_v3(root_node->symmetry_axis, nor);
                root_node->symmetry_flag |= SYM_PHYSICAL;
                root_node->symmetry_flag |= SYM_AXIAL;
 
index 1dd8f01..3f6cf34 100644 (file)
@@ -4483,7 +4483,7 @@ static void direct_link_object(FileData *fd, Object *ob)
                         * a hook we need to make sure it gets converted
                         * and free'd, regardless of version.
                         */
-               VECCOPY(hmd->cent, hook->cent);
+               copy_v3_v3(hmd->cent, hook->cent);
                hmd->falloff = hook->falloff;
                hmd->force = hook->force;
                hmd->indexar = hook->indexar;
@@ -4610,6 +4610,8 @@ static void lib_link_scene(FileData *fd, Main *main)
                                        marker->camera= newlibadr(fd, sce->id.lib, marker->camera);
                                }
                        }
+#else
+                       (void)marker;
 #endif
 
                        if(sce->ed)
@@ -7295,7 +7297,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                while(ob) {
                        if(ob->transflag & 1) {
                                ob->transflag -= 1;
-                               ob->ipoflag |= OB_OFFS_OB;
+                               //ob->ipoflag |= OB_OFFS_OB;
                        }
                        ob= ob->id.next;
                }
@@ -7326,7 +7328,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                }
                ob= main->object.first;
                while(ob) {
-                       ob->ipoflag |= OB_OFFS_PARENT;
+                       //ob->ipoflag |= OB_OFFS_PARENT;
                        if(ob->dt==0) ob->dt= OB_SOLID;
                        ob= ob->id.next;
                }
@@ -9747,7 +9749,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                part->obfac = paf->obfac;
                                part->randfac = paf->randfac * 25.0f;
                                part->dampfac = paf->damp;
-                               VECCOPY(part->acc, paf->force);
+                               copy_v3_v3(part->acc, paf->force);
 
                                /* flags */
                                if(paf->stype & PAF_VECT) {
@@ -10798,7 +10800,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                tot= MIN2(me->totvert, key->refkey->totelem);
 
                                for(a=0; a<tot; a++, data+=3)
-                                       VECCOPY(me->mvert[a].co, data)
+                                       copy_v3_v3(me->mvert[a].co, data);
                        }
                }
 
@@ -10808,7 +10810,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                tot= MIN2(lt->pntsu*lt->pntsv*lt->pntsw, key->refkey->totelem);
 
                                for(a=0; a<tot; a++, data+=3)
-                                       VECCOPY(lt->def[a].vec, data)
+                                       copy_v3_v3(lt->def[a].vec, data);
                        }
                }
 
@@ -10821,9 +10823,9 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                BezTriple *bezt = nu->bezt;
 
                                                for(a=0; a<nu->pntsu; a++, bezt++) {
-                                                       VECCOPY(bezt->vec[0], data); data+=3;
-                                                       VECCOPY(bezt->vec[1], data); data+=3;
-                                                       VECCOPY(bezt->vec[2], data); data+=3;
+                                                       copy_v3_v3(bezt->vec[0], data); data+=3;
+                                                       copy_v3_v3(bezt->vec[1], data); data+=3;
+                                                       copy_v3_v3(bezt->vec[2], data); data+=3;
                                                        bezt->alfa= *data; data++;
                                                }
                                        }
@@ -10831,7 +10833,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                                BPoint *bp = nu->bp;
 
                                                for(a=0; a<nu->pntsu*nu->pntsv; a++, bp++) {
-                                                       VECCOPY(bp->vec, data); data+=3;
+                                                       copy_v3_v3(bp->vec, data); data+=3;
                                                        bp->alfa= *data; data++;
                                                }
                                        }
@@ -13582,7 +13584,7 @@ static void give_base_to_groups(Main *mainvar, Scene *scene)
                        ob->dup_group= group;
                        ob->transflag |= OB_DUPLIGROUP;
                        rename_id(&ob->id, group->id.name+2);
-                       VECCOPY(ob->loc, scene->cursor);
+                       copy_v3_v3(ob->loc, scene->cursor);
                }
        }
 }
index b115a96..7bd70e9 100644 (file)
@@ -759,7 +759,7 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames , Ob
        for (it = frames.begin(); it != frames.end(); it++) {
                float mat[4][4], ipar[4][4];
 
-               float ctime = bsystem_time(scene, ob_arm, *it, 0.0f);
+               float ctime = BKE_frame_to_ctime(scene, *it);
 
                BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
                where_is_pose_bone(scene, ob_arm, pchan, ctime, 1);
@@ -1265,7 +1265,7 @@ void AnimationExporter::sample_animation(float *v, std::vector<float> &frames, i
        for (it = frames.begin(); it != frames.end(); it++) {
                float mat[4][4], ipar[4][4];
 
-               float ctime = bsystem_time(scene, ob_arm, *it, 0.0f);
+               float ctime = BKE_frame_to_ctime(scene, *it);
 
 
                BKE_animsys_evaluate_animdata(scene , &ob_arm->id, ob_arm->adt, ctime, ADT_RECALC_ANIM);
index 7f6c99b..c3a5c7a 100644 (file)
@@ -38,6 +38,7 @@ extern "C"
 #include "BKE_DerivedMesh.h"
 #include "BKE_fcurve.h"
 #include "BKE_animsys.h"
+#include "BKE_scene.h"
 #ifdef NAN_BUILDINFO
 extern char build_rev[];
 #endif
index 2774bd2..569125e 100644 (file)
@@ -237,28 +237,6 @@ void ANIM_draw_cfra (const bContext *C, View2D *v2d, short flag)
                glVertex2fv(vec);
        glEnd();
        
-       /* Draw dark green line if slow-parenting/time-offset is enabled */
-       if (flag & DRAWCFRA_SHOW_TIMEOFS) {
-               Object *ob= OBACT;
-               if(ob) {
-                       float timeoffset= give_timeoffset(ob);
-                       // XXX ob->ipoflag is depreceated!
-                       if ((ob->ipoflag & OB_OFFS_OB) && (timeoffset != 0.0f)) {
-                               vec[0]-= timeoffset; /* could avoid calling twice */
-                               
-                               UI_ThemeColorShade(TH_CFRAME, -30);
-                               
-                               glBegin(GL_LINE_STRIP);
-                                       /*vec[1]= v2d->cur.ymax;*/ // this is set already. this line is only included
-                                       glVertex2fv(vec);
-                                       
-                                       vec[1]= v2d->cur.ymin;
-                                       glVertex2fv(vec);
-                               glEnd();
-                       }
-               }
-       }
-       
        glLineWidth(1.0);
        
        /* Draw current frame number in a little box */
index 4a359ac..aa1af23 100644 (file)
@@ -1069,6 +1069,8 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend, int camera)
                
                WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, scene);
        }
+#else
+       (void)camera;
 #endif
 
        WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL);
@@ -1493,6 +1495,8 @@ void ED_marker_keymap(wmKeyConfig *keyconf)
        kmi= WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT|KM_CTRL, 0);
        RNA_boolean_set(kmi->ptr, "extend", 1);
        RNA_boolean_set(kmi->ptr, "camera", 1);
+#else
+       (void)kmi;
 #endif
        
        WM_keymap_verify_item(keymap, "MARKER_OT_select_border", BKEY, KM_PRESS, 0, 0);
index fb34245..9f466ef 100644 (file)
@@ -911,20 +911,6 @@ short insert_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
                /* apply NLA-mapping to frame to use (if applicable) */
                cfra= BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
        }
-
-#if 0
-       /* apply special time tweaking */
-               // XXX check on this stuff...
-       if (GS(id->name) == ID_OB) {
-               //Object *ob= (Object *)id;
-               
-               /* ancient time-offset cruft */
-               //if ( (ob->ipoflag & OB_OFFS_OB) && (give_timeoffset(ob)) ) {
-               //      /* actually frametofloat calc again! */
-               //      cfra-= give_timeoffset(ob)*scene->r.framelen;
-               //}
-       }
-#endif
        
        /* key entire array convenience method */
        if (array_index == -1) { 
@@ -1018,20 +1004,6 @@ short delete_keyframe (ReportList *reports, ID *id, bAction *act, const char gro
                }
        }
        
-#if 0
-       /* apply special time tweaking */
-               // XXX check on this stuff...
-       if (GS(id->name)