Пример #1
0
		public JacobianContact (
			int objectA,
			int objectB,
			int? contactReference,
			Vector3 linearComponentA,
			Vector3 linearComponentB,
			Vector3 angularComponentA,
			Vector3 angularComponentB,
			ConstraintType type,
			double b,
			double correctionValue,
			double cfm,
			double constraintLimit,
			StartImpulseProperties startImpulse)
		{
			ObjectA = objectA;
			ObjectB = objectB;
			ContactReference = contactReference;
			LinearComponentA = linearComponentA;
			LinearComponentB = linearComponentB;
			AngularComponentA = angularComponentA;
			AngularComponentB = angularComponentB;
			Type = type;
			B = b;
			CorrectionValue = correctionValue;
			CFM = cfm;
			ConstraintLimit = constraintLimit;
			StartImpulse = startImpulse;
		}
Пример #2
0
		public static JacobianContact GetDOF(
			int indexA,
			int indexB,
			Vector3 linearComponentA,
			Vector3 linearComponentB,
			Vector3 angularComponentA,
			Vector3 angularComponentB,
			SimulationObject simulationObjectA,
			SimulationObject simulationObjectB,
			double constraintValue,
			double correctionValue,
			double cfm,
			double constraintLimit,
			ConstraintType type,
            	int? contactReference = null,
			StartImpulseProperties startImpulseProperties = null)
		{
			double jacobianVelocityValue = linearComponentA.Dot (simulationObjectA.LinearVelocity) +
			                               linearComponentB.Dot (simulationObjectB.LinearVelocity) +
			                               angularComponentA.Dot (simulationObjectA.AngularVelocity) +
			                               angularComponentB.Dot (simulationObjectB.AngularVelocity);

			jacobianVelocityValue -= constraintValue;

			if (startImpulseProperties == null)
				startImpulseProperties = new StartImpulseProperties(0.0);

			return new JacobianContact (
				indexA,
				indexB,
				contactReference,
				linearComponentA,
				linearComponentB,
				angularComponentA,
				angularComponentB,
				type,
				jacobianVelocityValue,
				correctionValue,
				cfm,
				constraintLimit,
				startImpulseProperties);
		}