[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [29728] branches/soc-2010-aligorith-2/ source/blender/rigidbody: Bullet Soc - Renaming RigidBody Module Include File

Joshua Leung aligorith at gmail.com
Sun Jun 27 07:20:45 CEST 2010


Revision: 29728
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29728
Author:   aligorith
Date:     2010-06-27 07:20:45 +0200 (Sun, 27 Jun 2010)

Log Message:
-----------
Bullet Soc - Renaming RigidBody Module Include File

Added Paths:
-----------
    branches/soc-2010-aligorith-2/source/blender/rigidbody/RBI_api.h

Removed Paths:
-------------
    branches/soc-2010-aligorith-2/source/blender/rigidbody/rb_api.h

Copied: branches/soc-2010-aligorith-2/source/blender/rigidbody/RBI_api.h (from rev 29727, branches/soc-2010-aligorith-2/source/blender/rigidbody/rb_api.h)
===================================================================
--- branches/soc-2010-aligorith-2/source/blender/rigidbody/RBI_api.h	                        (rev 0)
+++ branches/soc-2010-aligorith-2/source/blender/rigidbody/RBI_api.h	2010-06-27 05:20:45 UTC (rev 29728)
@@ -0,0 +1,195 @@
+/**
+ * $Id: rb_api.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation, Joshua Leung
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Joshua Leung 
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef RB_API_H
+#define RB_API_H
+
+#ifdef __cplusplus
+extern "C" { 
+#endif
+
+/* API Notes:
+ * Currently, this API is optimised for Bullet RigidBodies, and doesn't
+ * take into account other Physics Engines. Some tweaking may be necessary
+ * to allow other systems to be used, in particular there may be references
+ * to datatypes that aren't used here...
+ *
+ * -- Joshua Leung (22 June 2010)
+ */
+
+/* ********************************** */
+/* Partial Type Defines - Aliases for the type of data we store */
+
+// TODO: is there a need to define the single vs double precision float stuff defines?
+
+// ----------
+
+/* Dynamics World */
+typedef struct _rbDynamicsWorld rbDynamicsWorld;
+
+/* Rigid Body */
+typedef struct _rbRigidBody rbRigidBody;
+
+/* Collision Shape */
+typedef struct _rbCollisionShape rbCollisionShape;
+
+/* Motion States */
+// XXX: Bullet only?
+
+/* ********************************** */
+/* Dynamics World Methods */
+
+/* Setup ---------------------------- */
+
+/* Create a new dynamics world instance */
+// TODO: add args to set the type of constraint solvers, etc.
+extern rbDynamicsWorld *rbDWorldCreate(const float gravity[3]);
+
+/* Delete the given dynamics world, and free any extra data it may require */
+extern void rbDWorldDelete(rbDynamicsWorld *world);
+
+/* Settings ------------------------- */
+
+/* Gravity */
+extern void rbGetGravity(rbDynamicsWorld *world, float g_out[3]);
+extern void rbSetGravity(rbDynamicsWorld *world, const float g_in[3]);
+
+/* Simulation ----------------------- */
+
+/* Step the simulation by the desired amount (in seconds) */
+extern void rbStepSimulation(rbDynamicsWorld *world, float timeStep);
+
+/* ********************************** */
+/* Rigid Body Methods */
+
+/* Setup ---------------------------- */
+
+/* Add RigidBody to dynamics world */
+extern void rbDWorldAddBody(rbDynamicsWorld *world, rbRigidBody *body);
+
+/* Remove RigidBody from dynamics world */
+extern void rbDWorldRemoveBody(rbDynamicsWorld *world, rbRigidBody *body);
+
+/* ............ */
+
+/* Create new RigidBody instance */
+// TODO: what other standard/useful settings to add here?
+extern rbRigidBody *rbBodyNew(rbCollisionShape *cshape, float mass, float mat[4][4]);
+
+/* Delete the given RigidBody instance */
+extern void rbBodyDelete(rbRigidBody *body);
+
+/* Settings ------------------------- */
+
+/* Collision Shape */
+extern rbCollisionShape *rbBodyGetCollisionShape(rbRigidBody *body);
+extern void rbBodySetCollisionShape(rbRigidBody *body, rbCollisionShape *cshape);
+
+/* ............ */
+
+/* Mass */
+extern float rbBodyGetMass(rbRigidBody *body);
+extern void rbBodySetMass(rbRigidBody *body, float value);
+
+/* Friction */
+extern float rbBodyGetFriction(rbRigidBody *body);
+extern void rbBodySetFriction(rbRigidBody *body, float value);
+
+/* Restitution */
+// XXX: what the hell is this?!
+extern float rbBodyGetRestitution(rbRigidBody *body);
+extern void rbBodySetRestitution(rbRigidBody *body, float value);
+
+/* Linear Damping */
+extern float rbBodyGetLinearDamping(rbRigidBody *body);
+extern void rbBodySetLinearDamping(rbRigidBody *body, float value);
+
+/* Angular Damping */
+extern float rbBodyGetAngularDamping(rbRigidBody *body);
+extern void rbBodySetAngularDamping(rbRigidBody *body, float value);
+
+/* Linear Sleep Threshold */
+extern float rbBodyGetLinearSleepThresh(rbRigidBody *body);
+extern void rbBodySetLinearSleepThresh(rbRigidBody *body, float value);
+
+/* Angular Sleep Threshold */
+extern float rbBodyGetAngularSleepThresh(rbRigidBody *body);
+extern void rbBodySetAngularSleepThresh(rbRigidBody *body, float value);
+
+/* ............ */
+
+/* Linear Velocity */
+extern void rbBodyGetLinearVelocity(rbRigidBody *body, float v_out[3]);
+extern void rbBodySetLinearVelocity(rbRigidBody *body, const float v_in[3]);
+
+/* Angular Velocity */
+extern void rbBodyGetAngularVelocity(rbRigidBody *body, float v_out[3]);
+extern void rbBodySetAngularVelocity(rbRigidBody *body, const float v_in[3]);
+
+/* ............ */
+
+/* RigidBody Interface - Rigid Body Activation States */
+extern int rbBodyGetActivationState(rbRigidBody *body);
+extern void rbBodySetActivationState(rbRigidBody *body, int state);
+
+/* Simulation ----------------------- */
+
+/* Get current transform matrix of RigidBody to use in Blender (OpenGL format) */
+extern void rbGetTransformMatrix(rbRigidBody *body, float m_out[4][4]);
+
+/* Set RigidBody's transform matrix from Blender's Object matrices (OpenGL format) */
+extern void rbSetTransformMatrix(rbRigidBody *body, const float m_in[4][4]);
+
+/* ********************************** */
+/* Collision Shape Methods */
+
+/* Setup (Standard Shapes) ----------- */
+
+extern rbCollisionShape *rbShapeNewBox(float x, float y, float z);
+extern rbCollisionShape *rbShapeNewSphere(float radius);
+extern rbCollisionShape *rbShapeNewCapsule(float radius, float height);	
+extern rbCollisionShape *rbShapeNewCone(float radius, float height);
+extern rbCollisionShape *rbShapeNewCylinder(float radius, float height);
+
+/* Setup (Special Shapes) ------------ */
+
+// TODO: how to setup the mesh collision shapes?
+
+/* Cleanup --------------------------- */
+
+extern void rbShapeDelete(rbCollisionShape *cshape);
+
+/* ********************************** */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // RB_API_H
+ 
\ No newline at end of file

Deleted: branches/soc-2010-aligorith-2/source/blender/rigidbody/rb_api.h
===================================================================
--- branches/soc-2010-aligorith-2/source/blender/rigidbody/rb_api.h	2010-06-27 05:16:39 UTC (rev 29727)
+++ branches/soc-2010-aligorith-2/source/blender/rigidbody/rb_api.h	2010-06-27 05:20:45 UTC (rev 29728)
@@ -1,195 +0,0 @@
-/**
- * $Id: rb_api.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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2010 Blender Foundation, Joshua Leung
- * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): Joshua Leung 
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-#ifndef RB_API_H
-#define RB_API_H
-
-#ifdef __cplusplus
-extern "C" { 
-#endif
-
-/* API Notes:
- * Currently, this API is optimised for Bullet RigidBodies, and doesn't
- * take into account other Physics Engines. Some tweaking may be necessary
- * to allow other systems to be used, in particular there may be references
- * to datatypes that aren't used here...
- *
- * -- Joshua Leung (22 June 2010)
- */
-
-/* ********************************** */
-/* Partial Type Defines - Aliases for the type of data we store */
-
-// TODO: is there a need to define the single vs double precision float stuff defines?
-
-// ----------
-
-/* Dynamics World */
-typedef struct _rbDynamicsWorld rbDynamicsWorld;
-
-/* Rigid Body */
-typedef struct _rbRigidBody rbRigidBody;
-
-/* Collision Shape */
-typedef struct _rbCollisionShape rbCollisionShape;
-
-/* Motion States */
-// XXX: Bullet only?
-
-/* ********************************** */
-/* Dynamics World Methods */
-
-/* Setup ---------------------------- */
-
-/* Create a new dynamics world instance */
-// TODO: add args to set the type of constraint solvers, etc.
-extern rbDynamicsWorld *rbDWorldCreate(const float gravity[3]);
-
-/* Delete the given dynamics world, and free any extra data it may require */
-extern void rbDWorldDelete(rbDynamicsWorld *world);
-
-/* Settings ------------------------- */
-
-/* Gravity */
-extern void rbGetGravity(rbDynamicsWorld *world, float g_out[3]);
-extern void rbSetGravity(rbDynamicsWorld *world, const float g_in[3]);
-
-/* Simulation ----------------------- */
-
-/* Step the simulation by the desired amount (in seconds) */
-extern void rbStepSimulation(rbDynamicsWorld *world, float timeStep);
-
-/* ********************************** */
-/* Rigid Body Methods */
-
-/* Setup ---------------------------- */
-
-/* Add RigidBody to dynamics world */
-extern void rbDWorldAddBody(rbDynamicsWorld *world, rbRigidBody *body);
-
-/* Remove RigidBody from dynamics world */
-extern void rbDWorldRemoveBody(rbDynamicsWorld *world, rbRigidBody *body);
-
-/* ............ */
-
-/* Create new RigidBody instance */
-// TODO: what other standard/useful settings to add here?

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list