1 /************************************************************************* 2 * D bindings for ODE * 3 * * 4 * C header port by Daniel "q66" Kolesa <quaker66@gmail.com> * 5 * * 6 * Open Dynamics Engine, Copyright (C) 2001-2003 Russell L. Smith. * 7 * All rights reserved. Email: russ@q12.org Web: www.q12.org * 8 * * 9 * This library is free software; you can redistribute it and/or * 10 * modify it under the terms of EITHER: * 11 * (1) The GNU Lesser General Public License as published by the Free * 12 * Software Foundation; either version 2.1 of the License, or (at * 13 * your option) any later version. The text of the GNU Lesser * 14 * General Public License is included with this library in the * 15 * file LICENSE.TXT. * 16 * (2) The BSD-style license that is included with this library in * 17 * the file LICENSE-BSD.TXT. * 18 * * 19 * This library is distributed in the hope that it will be useful, * 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the files * 22 * LICENSE.TXT and LICENSE-BSD.TXT for more details. * 23 * * 24 *************************************************************************/ 25 26 module deimos.ode.mass; 27 28 private import deimos.ode.common; 29 30 extern (C): 31 nothrow: 32 33 /** 34 * Check if a mass structure has valid value. 35 * The function check if the mass and innertia matrix are positive definits 36 * 37 * @param m A mass structure to check 38 * 39 * @return 1 if both codition are met 40 */ 41 int dMassCheck(in dMass *m); 42 43 void dMassSetZero(dMass*); 44 45 void dMassSetParameters( 46 dMass*, dReal themass, dReal cgx, dReal cgy, dReal cgz, dReal I11, 47 dReal I22, dReal I33, dReal I12, dReal I13, dReal I23 48 ); 49 50 void dMassSetSphere(dMass*, dReal density, dReal radius); 51 void dMassSetSphereTotal(dMass*, dReal total_mass, dReal radius); 52 53 void dMassSetCapsule( 54 dMass*, dReal density, int direction, dReal radius, dReal length 55 ); 56 void dMassSetCapsuleTotal( 57 dMass*, dReal total_mass, int direction, dReal radius, dReal length 58 ); 59 60 void dMassSetCylinder( 61 dMass*, dReal density, int direction, dReal radius, dReal length 62 ); 63 void dMassSetCylinderTotal( 64 dMass*, dReal total_mass, int direction, dReal radius, dReal length 65 ); 66 67 void dMassSetBox(dMass*, dReal density, dReal lx, dReal ly, dReal lz); 68 void dMassSetBoxTotal(dMass*, dReal total_mass, dReal lx, dReal ly, dReal lz); 69 70 void dMassSetTrimesh(dMass*, dReal density, dGeomID g); 71 72 void dMassSetTrimeshTotal(dMass* m, dReal total_mass, dGeomID g); 73 74 void dMassAdjust(dMass*, dReal newmass); 75 76 void dMassTranslate(dMass*, dReal x, dReal y, dReal z); 77 78 void dMassRotate(dMass*, in dMatrix3 R); 79 80 void dMassAdd(dMass* a, in dMass* b); 81 82 struct dMass 83 { 84 dReal mass; 85 dVector3 c; 86 dMatrix3 I; 87 }