[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18327] branches/soc-2008-nicholasbishop/ source/blender: Added/corrected more files from the merge.

Nicholas Bishop nicholasbishop at gmail.com
Mon Jan 5 00:03:14 CET 2009


Revision: 18327
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18327
Author:   nicholasbishop
Date:     2009-01-05 00:03:13 +0100 (Mon, 05 Jan 2009)

Log Message:
-----------
Added/corrected more files from the merge.

Added Paths:
-----------
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_bullet.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_fluidsim.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_shrinkwrap.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_simple_deform.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_suggestions.h
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/bullet.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/fluidsim.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/shrinkwrap.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/simple_deform.c
    branches/soc-2008-nicholasbishop/source/blender/blenkernel/intern/suggestions.c
    branches/soc-2008-nicholasbishop/source/blender/gpu/intern/gpu_codegen.c
    branches/soc-2008-nicholasbishop/source/blender/gpu/intern/gpu_material.c
    branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c

Removed Paths:
-------------
    branches/soc-2008-nicholasbishop/source/blender/gpu/intern/gpu_codegen.c
    branches/soc-2008-nicholasbishop/source/blender/gpu/intern/gpu_material.c
    branches/soc-2008-nicholasbishop/source/blender/python/api2_2x/Mesh.c

Copied: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_bullet.h (from rev 18326, trunk/blender/source/blender/blenkernel/BKE_bullet.h)
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_bullet.h	                        (rev 0)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_bullet.h	2009-01-04 23:03:13 UTC (rev 18327)
@@ -0,0 +1,43 @@
+/**
+ *	
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_BULLET_H
+#define BKE_BULLET_H
+
+struct BulletSoftBody;
+
+
+/* allocates and initializes general main data */
+extern struct BulletSoftBody *bsbNew(void);
+
+/* frees internal data and softbody itself */
+extern void	bsbFree(struct BulletSoftBody *sb);
+
+#endif
+

Copied: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_fluidsim.h (from rev 18326, trunk/blender/source/blender/blenkernel/BKE_fluidsim.h)
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_fluidsim.h	                        (rev 0)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_fluidsim.h	2009-01-04 23:03:13 UTC (rev 18327)
@@ -0,0 +1,56 @@
+/**
+ * BKE_fluidsim.h
+ * 
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include "DNA_modifier_types.h"
+#include "DNA_object_fluidsim.h" // N_T
+#include "DNA_object_types.h"
+
+#include "BKE_DerivedMesh.h"
+
+/* old interface */
+FluidsimSettings *fluidsimSettingsNew(Object *srcob);
+
+void initElbeemMesh(Object *ob, int *numVertices, float **vertices, int *numTriangles, int **triangles, int useGlobalCoords, int modifierIndex);
+
+
+/* new fluid-modifier interface */
+void fluidsim_init(FluidsimModifierData *fluidmd);
+void fluidsim_free(FluidsimModifierData *fluidmd);
+
+DerivedMesh *fluidsim_read_cache(Object *ob, DerivedMesh *orgdm, FluidsimModifierData *fluidmd, int framenr, int useRenderParams);
+void fluidsim_read_vel_cache(FluidsimModifierData *fluidmd, DerivedMesh *dm, char *filename);
+DerivedMesh *fluidsimModifier_do(FluidsimModifierData *fluidmd, Object *ob, DerivedMesh *dm, int useRenderParams, int isFinalCalc);
+
+// get bounding box of mesh
+void fluid_get_bb(MVert *mvert, int totvert, float obmat[][4],
+		 /*RET*/ float start[3], /*RET*/ float size[3] );
+
+
+

Copied: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_shrinkwrap.h (from rev 18326, trunk/blender/source/blender/blenkernel/BKE_shrinkwrap.h)
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_shrinkwrap.h	                        (rev 0)
+++ branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_shrinkwrap.h	2009-01-04 23:03:13 UTC (rev 18327)
@@ -0,0 +1,150 @@
+/**
+ * BKE_shrinkwrap.h
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+#ifndef BKE_SHRINKWRAP_H
+#define BKE_SHRINKWRAP_H
+
+/* mesh util */
+//TODO: move this somewhere else
+#include "BKE_customdata.h"
+struct DerivedMesh;
+struct Object;
+struct DerivedMesh *object_get_derived_final(struct Object *ob, CustomDataMask dataMask);
+
+
+/* SpaceTransform stuff */
+/*
+ * TODO: move this somewhere else
+ *
+ * this structs encapsulates all needed data to convert between 2 coordinate spaces
+ * (where conversion can be represented by a matrix multiplication)
+ *
+ * This is used to reduce the number of arguments to pass to functions that need to perform
+ * this kind of operation and make it easier for the coder, as he/she doenst needs to recode
+ * the matrix calculation.
+ *
+ * A SpaceTransform is initialized using:
+ *   space_transform_setup( &data,  ob1, ob2 )
+ *
+ * After that the following calls can be used:
+ *   space_transform_apply (&data, co); //converts a coordinate in ob1 coords space to the corresponding ob2 coords
+ *   space_transform_invert(&data, co); //converts a coordinate in ob2 coords space to the corresponding ob1 coords
+ *
+ *	//Same Concept as space_transform_apply and space_transform_invert, but no is normalized after conversion
+ *   space_transform_apply_normal (&data, &no);
+ *   space_transform_invert_normal(&data, &no);
+ *
+ */
+struct Object;
+
+typedef struct SpaceTransform
+{
+	float local2target[4][4];
+	float target2local[4][4];
+
+} SpaceTransform;
+
+void space_transform_from_matrixs(SpaceTransform *data, float local[][4], float target[][4]);
+#define space_transform_setup(data, local, target) space_transform_from_matrixs(data, (local)->obmat, (target)->obmat)
+
+void space_transform_apply (const SpaceTransform *data, float *co);
+void space_transform_invert(const SpaceTransform *data, float *co);
+
+void space_transform_apply_normal (const SpaceTransform *data, float *no);
+void space_transform_invert_normal(const SpaceTransform *data, float *no);
+
+/* Shrinkwrap stuff */
+#include "BKE_bvhutils.h"
+
+/*
+ * Shrinkwrap is composed by a set of functions and options that define the type of shrink.
+ *
+ * 3 modes are available:
+ *    - Nearest vertex
+ *	  - Nearest surface
+ *    - Normal projection
+ *
+ * ShrinkwrapCalcData encapsulates all needed data for shrinkwrap functions.
+ * (So that you dont have to pass an enormous ammount of arguments to functions)
+ */
+
+struct Object;
+struct DerivedMesh;
+struct ShrinkwrapModifierData;
+struct MDeformVert;
+struct BVHTree;
+
+
+typedef struct ShrinkwrapCalcData
+{
+	ShrinkwrapModifierData *smd;	//shrinkwrap modifier data
+
+	struct Object *ob;				//object we are applying shrinkwrap to
+	struct DerivedMesh *original;	//mesh before shrinkwrap
+
+	float (*vertexCos)[3];			//vertexs being shrinkwraped
+	int numVerts;
+
+	struct MDeformVert* dvert;			//Pointer to mdeform array
+	int vgroup;						//Vertex group num
+
+	struct DerivedMesh *target;		//mesh we are shrinking to	
+	SpaceTransform local2target;	//transform to move bettwem local and target space
+
+	float keepDist;					//Distance to kept from target (units are in local space)
+
+} ShrinkwrapCalcData;
+
+void shrinkwrap_calc_nearest_vertex(ShrinkwrapCalcData *data);
+void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *data);
+void shrinkwrap_calc_nearest_surface_point(ShrinkwrapCalcData *data);
+
+void shrinkwrapModifier_deform(struct ShrinkwrapModifierData *smd, struct Object *ob, struct DerivedMesh *dm, float (*vertexCos)[3], int numVerts);
+
+/*
+ * This function casts a ray in the given BVHTree.. but it takes into consideration the space_transform, that is:
+ *
+ * if transf was configured with "space_transform_setup( &transf,  ob1, ob2 )"
+ * then the input (vert, dir, BVHTreeRayHit) must be defined in ob1 coordinates space
+ * and the BVHTree must be built in ob2 coordinate space.
+ *
+ * Thus it provides an easy way to cast the same ray across several trees (where each tree was built on its own coords space)
+ */
+int normal_projection_project_vertex(char options, const float *vert, const float *dir, const SpaceTransform *transf, BVHTree *tree, BVHTreeRayHit *hit, BVHTree_RayCastCallback callback, void *userdata);
+
+/*
+ * NULL initializers to local data
+ */
+#define NULL_ShrinkwrapCalcData	{NULL, }
+#define NULL_BVHTreeFromMesh	{NULL, }
+#define NULL_BVHTreeRayHit		{NULL, }
+#define NULL_BVHTreeNearest		{0, }
+
+
+#endif
+

Copied: branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_simple_deform.h (from rev 18326, trunk/blender/source/blender/blenkernel/BKE_simple_deform.h)
===================================================================
--- branches/soc-2008-nicholasbishop/source/blender/blenkernel/BKE_simple_deform.h	                        (rev 0)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list