2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
* $Id$
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
2002-10-12 11:37:38 +00:00
|
|
|
*
|
|
|
|
* 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) 2001-2002 by NaN Holding BV.
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
*
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
#ifndef KX_CONSTRAINT_WRAPPER
|
|
|
|
#define KX_CONSTRAINT_WRAPPER
|
|
|
|
|
|
|
|
#include "Value.h"
|
|
|
|
#include "PHY_DynamicTypes.h"
|
|
|
|
|
|
|
|
class KX_ConstraintWrapper : public PyObjectPlus
|
|
|
|
{
|
|
|
|
Py_Header;
|
2009-04-03 14:51:06 +00:00
|
|
|
virtual PyObject* py_getattro(PyObject *attr);
|
2009-04-20 23:17:52 +00:00
|
|
|
virtual PyObject* py_getattro_dict();
|
2009-04-03 14:51:06 +00:00
|
|
|
virtual int py_setattro(PyObject *attr, PyObject *value);
|
2002-10-12 11:37:38 +00:00
|
|
|
public:
|
|
|
|
KX_ConstraintWrapper(PHY_ConstraintType ctype,int constraintId,class PHY_IPhysicsEnvironment* physenv,PyTypeObject *T = &Type);
|
|
|
|
virtual ~KX_ConstraintWrapper ();
|
|
|
|
int getConstraintId() { return m_constraintId;};
|
|
|
|
|
2009-05-26 10:44:14 +00:00
|
|
|
KX_PYMETHOD_NOARGS(KX_ConstraintWrapper,GetConstraintId);
|
PhysicsConstraints.createConstraint:
allow to dynamically create rigid body constraints while disable collision detection between connected bodies, pass as 10th argument the flag 128
PhysiPython KX_ConstraintWrapper, setParam
export setParam(paramIndex,paramValue0,paramValue1) for Physics constraints
paramIndex 0,1,2 are linear limits, 3,4,5 are angular limits, 6,7,8 are linear motors, 9,10,11 are angular motors
For example:
disableConnectedBodies=128
cons = PhysicsConstraints.createConstraint(oid,rid,generic6dof,pivotInAx,pivotInAy,pivotInAz,angleX,angleY,angleZ,disableConnectedBodies)
#params 0,1,2 are linear limits, low,high value. if low > high then disable limit
cons.setParam(0,0,0)
I will provide an example .blend for Blender 2.49
2009-05-24 01:55:24 +00:00
|
|
|
KX_PYMETHOD(KX_ConstraintWrapper,SetParam);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int m_constraintId;
|
|
|
|
PHY_ConstraintType m_constraintType;
|
|
|
|
PHY_IPhysicsEnvironment* m_physenv;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif //KX_CONSTRAINT_WRAPPER
|
2002-10-30 02:07:20 +00:00
|
|
|
|