示例#1
0
 public override void serialize(btSerializer serializer)
 {
     BulletPINVOKE.btDiscreteDynamicsWorld_serialize(swigCPtr, btSerializer.getCPtr(serializer));
 }
示例#2
0
        public virtual string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btStridingMeshInterface_serialize(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
示例#3
0
        public virtual string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btTypedConstraint_serialize(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
示例#4
0
        public override string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btCapsuleShape_serialize(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
	virtual	void	serialize(btSerializer* serializer);
示例#6
0
internal void serializeDynamicsWorldInfo( btSerializer* serializer )
{
#if BT_USE_DOUBLE_PRECISION
	int len = sizeof( btDynamicsWorldDoubleData );
	btChunk* chunk = serializer.allocate( len, 1 );
	btDynamicsWorldDoubleData* worldInfo = (btDynamicsWorldDoubleData*)chunk.m_oldPtr;
#else//BT_USE_DOUBLE_PRECISION
		int len = sizeof( btDynamicsWorldFloatData );
		btChunk* chunk = serializer.allocate( len, 1 );
		btDynamicsWorldFloatData* worldInfo = (btDynamicsWorldFloatData*)chunk.m_oldPtr;
#endif//BT_USE_DOUBLE_PRECISION

	memset( worldInfo, 0x00, len );

		m_gravity.serialize( worldInfo.m_gravity );
	worldInfo.m_solverInfo.m_tau = getSolverInfo().m_tau;
	worldInfo.m_solverInfo.m_damping = getSolverInfo().m_damping;
	worldInfo.m_solverInfo.m_friction = getSolverInfo().m_friction;
	worldInfo.m_solverInfo.m_timeStep = getSolverInfo().m_timeStep;

	worldInfo.m_solverInfo.m_restitution = getSolverInfo().m_restitution;
	worldInfo.m_solverInfo.m_maxErrorReduction = getSolverInfo().m_maxErrorReduction;
	worldInfo.m_solverInfo.m_sor = getSolverInfo().m_sor;
	worldInfo.m_solverInfo.m_erp = getSolverInfo().m_erp;

	worldInfo.m_solverInfo.m_erp2 = getSolverInfo().m_erp2;
	worldInfo.m_solverInfo.m_globalCfm = getSolverInfo().m_globalCfm;
	worldInfo.m_solverInfo.m_splitImpulsePenetrationThreshold = getSolverInfo().m_splitImpulsePenetrationThreshold;
	worldInfo.m_solverInfo.m_splitImpulseTurnErp = getSolverInfo().m_splitImpulseTurnErp;

	worldInfo.m_solverInfo.m_linearSlop = getSolverInfo().m_linearSlop;
	worldInfo.m_solverInfo.m_warmstartingFactor = getSolverInfo().m_warmstartingFactor;
	worldInfo.m_solverInfo.m_maxGyroscopicForce = getSolverInfo().m_maxGyroscopicForce;
	worldInfo.m_solverInfo.m_singleAxisRollingFrictionThreshold = getSolverInfo().m_singleAxisRollingFrictionThreshold;

	worldInfo.m_solverInfo.m_numIterations = getSolverInfo().m_numIterations;
	worldInfo.m_solverInfo.m_solverMode = getSolverInfo().m_solverMode;
	worldInfo.m_solverInfo.m_restingContactRestitutionThreshold = getSolverInfo().m_restingContactRestitutionThreshold;
	worldInfo.m_solverInfo.m_minimumSolverBatchSize = getSolverInfo().m_minimumSolverBatchSize;

	worldInfo.m_solverInfo.m_splitImpulse = getSolverInfo().m_splitImpulse;

#if BT_USE_DOUBLE_PRECISION
	string structType = "btDynamicsWorldDoubleData";
#else//BT_USE_DOUBLE_PRECISION
		string structType = "btDynamicsWorldFloatData";
#endif//BT_USE_DOUBLE_PRECISION
		serializer.finalizeChunk( chunk, structType, BT_DYNAMICSWORLD_CODE, worldInfo );
}
示例#7
0
void serializeCollisionObjects( btSerializer serializer )
{
	int i;

	///keep track of shapes already serialized
	btHashMap<btHashPtr, btCollisionShape> serializedShapes;

	for( i = 0; i < m_collisionObjects.Count; i++ )
	{
		btCollisionObject colObj = m_collisionObjects[i];
		btCollisionShape shape = colObj.getCollisionShape();

		if( !serializedShapes.find( shape ) )
		{
			serializedShapes.insert( shape, shape );
			shape.serializeSingleShape( serializer );
		}
	}

	//serialize all collision objects
	for( i = 0; i < m_collisionObjects.Count; i++ )
	{
		btCollisionObject colObj = m_collisionObjects[i];
		if( ( colObj.getInternalType() == btCollisionObject::CO_COLLISION_OBJECT ) || ( colObj.getInternalType() == btCollisionObject::CO_FEATHERSTONE_LINK ) )
		{
			colObj.serializeSingleObject( serializer );
		}
	}
}
示例#8
0
 public virtual void serializeSingleShape(btSerializer serializer)
 {
     BulletPINVOKE.btCollisionShape_serializeSingleShape(swigCPtr, btSerializer.getCPtr(serializer));
 }
示例#9
0
///fills the dataBuffer and returns the struct name (and 0 on failure)
const char* btCollisionShape::serialize( void* dataBuffer, btSerializer* serializer ) const
示例#10
0
 public virtual void serialize(btSerializer serializer)
 {
     BulletPINVOKE.btCollisionWorld_serialize(swigCPtr, btSerializer.getCPtr(serializer));
 }
示例#11
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(btSerializer obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }
示例#12
0
        public virtual string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btQuantizedBvh_serialize__SWIG_1(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
示例#13
0
///fills the dataBuffer and returns the struct name (and 0 on failure)
string btConvexHullShape::serialize( object dataBuffer, btSerializer* serializer )
{
	//int szc = sizeof(btConvexHullShapeData);
	btConvexHullShapeData* shapeData = (btConvexHullShapeData*)dataBuffer;
	btConvexInternalShape::serialize( shapeData.m_convexInternalShapeData, serializer );

	int numElem = m_unscaledPoints.Count;
	shapeData.m_numUnscaledPoints = numElem;
#if BT_USE_DOUBLE_PRECISION
	shapeData.m_unscaledPointsFloatPtr = 0;
	shapeData.m_unscaledPointsDoublePtr = numElem ? (btVector3Data*)serializer.getUniquePointer((object)&m_unscaledPoints):  0;
#else
	shapeData.m_unscaledPointsFloatPtr = numElem ? (btVector3Data*)serializer.getUniquePointer( (object)m_unscaledPoints ) : 0;
	shapeData.m_unscaledPointsDoublePtr = 0;
#endif

	if( numElem )
	{
		int sz = sizeof( btVector3Data );
		//	int sz2 = sizeof(btVector3DoubleData);
		//	int sz3 = sizeof(btVector3FloatData);
		btChunk* chunk = serializer.allocate( sz, numElem );
		btVector3Data* memPtr = (btVector3Data*)chunk.m_oldPtr;
		for( int i = 0; i < numElem; i++, memPtr++ )
		{
			m_unscaledPoints[i].serialize( *memPtr );
		}
		serializer.finalizeChunk( chunk, btVector3DataName, BT_ARRAY_CODE, (object)m_unscaledPoints );
	}

	return "btConvexHullShapeData";
}
示例#14
0
		///fills the dataBuffer and returns the struct name (and 0 on failure)
		string btMultiSphereShape::serialize( object dataBuffer, btSerializer* serializer )
		{
			btMultiSphereShapeData* shapeData = (btMultiSphereShapeData*)dataBuffer;
			btConvexInternalShape::serialize( shapeData.m_convexInternalShapeData, serializer );

			int numElem = m_localPositionArray.Count;
			shapeData.m_localPositionArrayPtr = numElem ? (btPositionAndRadius*)serializer.getUniquePointer( (object)&m_localPositionArray ) : 0;

			shapeData.m_localPositionArraySize = numElem;
			if( numElem )
			{
				btChunk* chunk = serializer.allocate( sizeof( btPositionAndRadius ), numElem );
				btPositionAndRadius* memPtr = (btPositionAndRadius*)chunk.m_oldPtr;
				for( int i = 0; i < numElem; i++, memPtr++ )
				{
					m_localPositionArray[i].serializeFloat( memPtr.m_pos );
					memPtr.m_radius = float( m_radiArray[i] );
				}
				serializer.finalizeChunk( chunk, "btPositionAndRadius", BT_ARRAY_CODE, (object)m_localPositionArray );
			}

			return "btMultiSphereShapeData";
		}
示例#15
0
void serialize( btSerializer serializer )
{

	serializer.startSerialization();

	serializeCollisionObjects( serializer );

	serializer.finishSerialization();
}
示例#16
0
        public virtual string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btCollisionShape_serialize(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
示例#17
0
		///fills the dataBuffer and returns the struct name (and 0 on failure)
		string serialize( object dataBuffer, btSerializer* serializer )
		{
			btTypedConstraintData2* tcd = (btTypedConstraintData2*)dataBuffer;

			tcd.m_rbA = (btRigidBodyData*)serializer.getUniquePointer( &m_rbA );
			tcd.m_rbB = (btRigidBodyData*)serializer.getUniquePointer( &m_rbB );
			char* name = (char*)serializer.findNameForPointer( this );
			tcd.m_name = (char*)serializer.getUniquePointer( name );
			if( tcd.m_name )
			{
				serializer.serializeName( name );
			}

			tcd.m_objectType = m_objectType;
			tcd.m_needsFeedback = m_needsFeedback;
			tcd.m_overrideNumSolverIterations = m_overrideNumSolverIterations;
			tcd.m_breakingImpulseThreshold = m_breakingImpulseThreshold;
			tcd.m_isEnabled = m_isEnabled ? 1 : 0;

			tcd.m_userConstraintId = m_userConstraintId;
			tcd.m_userConstraintType = m_userConstraintType;

			tcd.m_appliedImpulse = m_appliedImpulse;
			tcd.m_dbgDrawSize = m_dbgDrawSize;

			tcd.m_disableCollisionsBetweenLinkedBodies = false;

			int i;
			for( i = 0; i < m_rbA.getNumConstraintRefs(); i++ )
				if( m_rbA.getConstraintRef( i ) == this )
					tcd.m_disableCollisionsBetweenLinkedBodies = true;
			for( i = 0; i < m_rbB.getNumConstraintRefs(); i++ )
				if( m_rbB.getConstraintRef( i ) == this )
					tcd.m_disableCollisionsBetweenLinkedBodies = true;

			return btTypedConstraintDataName;
		}
	virtual void	serializeMultiBodies(btSerializer* serializer);
示例#19
0
///fills the dataBuffer and returns the struct name (and 0 on failure)
string btCompoundShape::serialize( object dataBuffer, btSerializer* serializer )
{

	btCompoundShapeData* shapeData = (btCompoundShapeData*)dataBuffer;
	btCollisionShape::serialize( &shapeData.m_collisionShapeData, serializer );

	shapeData.m_collisionMargin = float( m_collisionMargin );
	shapeData.m_numChildShapes = m_children.Count;
	shapeData.m_childShapePtr = 0;
	if( shapeData.m_numChildShapes )
	{
		btChunk* chunk = serializer.allocate( sizeof( btCompoundShapeChildData ), shapeData.m_numChildShapes );
		btCompoundShapeChildData* memPtr = (btCompoundShapeChildData*)chunk.m_oldPtr;
		shapeData.m_childShapePtr = (btCompoundShapeChildData*)serializer.getUniquePointer( memPtr );

		for( int i = 0; i < shapeData.m_numChildShapes; i++, memPtr++ )
		{
			memPtr.m_childMargin = float( m_children[i].m_childMargin );
			memPtr.m_childShape = (btCollisionShapeData*)serializer.getUniquePointer( m_children[i].m_childShape );
			//don't serialize shapes that already have been serialized
			if( !serializer.findPointer( m_children[i].m_childShape ) )
			{
				btChunk* chunk = serializer.allocate( m_children[i].m_childShape.calculateSerializeBufferSize(), 1 );
				string structType = m_children[i].m_childShape.serialize( chunk.m_oldPtr, serializer );
				serializer.finalizeChunk( chunk, structType, BT_SHAPE_CODE, m_children[i].m_childShape );
			}

			memPtr.m_childShapeType = m_children[i].m_childShapeType;
			m_children[i].m_transform.serializeFloat( memPtr.m_transform );
		}
		serializer.finalizeChunk( chunk, "btCompoundShapeChildData", BT_ARRAY_CODE, chunk.m_oldPtr );
	}
	return "btCompoundShapeData";
}
示例#20
0
internal void serializeRigidBodies( btSerializer* serializer )
{
	int i;
	//serialize all collision objects
	for( i = 0; i < m_collisionObjects.Count; i++ )
	{
		btCollisionObject colObj = m_collisionObjects[i];
		if( colObj.getInternalType() & btCollisionObject::CO_RIGID_BODY )
		{
			int len = colObj.calculateSerializeBufferSize();
			btChunk* chunk = serializer.allocate( len, 1 );
			string structType = colObj.serialize( chunk.m_oldPtr, serializer );
			serializer.finalizeChunk( chunk, structType, BT_RIGIDBODY_CODE, colObj );
		}
	}

	for( i = 0; i < m_constraints.Count; i++ )
	{
		btTypedConstraint constraint = m_constraints[i];
		int size = constraint.calculateSerializeBufferSize();
		btChunk* chunk = serializer.allocate( size, 1 );
		string structType = constraint.serialize( chunk.m_oldPtr, serializer );
		serializer.finalizeChunk( chunk, structType, BT_CONSTRAINT_CODE, constraint );
	}
}
示例#21
0
 protected void	serializeCollisionObjects(btSerializer* serializer);
示例#22
0
	internal void serialize( btSerializer* serializer )
	{

		serializer.startSerialization();

		serializeDynamicsWorldInfo( serializer );

		serializeCollisionObjects( serializer );

		serializeRigidBodies( serializer );

		serializer.finishSerialization();
	}
示例#23
0
	    virtual void	serializeSingleShape(btSerializer* serializer) const;
示例#24
0
///fills the dataBuffer and returns the struct name (and 0 on failure)
public string serialize( object dataBuffer, btSerializer* serializer )
{
	btConeShapeData* shapeData = (btConeShapeData*)dataBuffer;

	btConvexInternalShape::serialize( &shapeData.m_convexInternalShapeData, serializer );

	shapeData.m_upIndex = m_coneIndices[1];

	return "btConeShapeData";
}
示例#25
0
 public override void serializeSingleObject(btSerializer serializer)
 {
     BulletPINVOKE.btRigidBody_serializeSingleObject(swigCPtr, btSerializer.getCPtr(serializer));
 }
示例#26
0
		///fills the dataBuffer and returns the struct name (and 0 on failure)
		virtual string serialize( object dataBuffer, btSerializer* serializer );
示例#27
0
 public virtual void serializeSingleObject(btSerializer serializer)
 {
     BulletPINVOKE.btCollisionObject_serializeSingleObject(swigCPtr, btSerializer.getCPtr(serializer));
 }
示例#28
0
        public override string serialize(SWIGTYPE_p_void dataBuffer, btSerializer serializer)
        {
            string ret = BulletPINVOKE.btGeneric6DofSpringConstraint_serialize(swigCPtr, SWIGTYPE_p_void.getCPtr(dataBuffer), btSerializer.getCPtr(serializer));

            return(ret);
        }
示例#29
0
 public virtual void serializeSingleTriangleInfoMap(btSerializer serializer)
 {
     BulletPINVOKE.btBvhTriangleMeshShape_serializeSingleTriangleInfoMap(swigCPtr, btSerializer.getCPtr(serializer));
 }