private unsafe void SerializeDynamicsWorldInfo(Serializer serializer)
        {
            int   len   = 88;
            Chunk chunk = serializer.Allocate((uint)len, 1);

            using (var stream = new UnmanagedMemoryStream((byte *)chunk.OldPtr.ToPointer(), len, len, FileAccess.Write))
            {
                using (var writer = new BinaryWriter(stream))
                {
                    ContactSolverInfo solverInfo = SolverInfo;
                    writer.Write(solverInfo.Tau);
                    writer.Write(solverInfo.Damping);
                    writer.Write(solverInfo.Friction);
                    writer.Write(solverInfo.TimeStep);

                    writer.Write(solverInfo.Restitution);
                    writer.Write(solverInfo.MaxErrorReduction);
                    writer.Write(solverInfo.Sor);
                    writer.Write(solverInfo.Erp);

                    writer.Write(solverInfo.Erp2);
                    writer.Write(solverInfo.GlobalCfm);
                    writer.Write(solverInfo.SplitImpulsePenetrationThreshold);
                    writer.Write(solverInfo.SplitImpulseTurnErp);

                    writer.Write(solverInfo.LinearSlop);
                    writer.Write(solverInfo.WarmStartingFactor);
                    writer.Write(solverInfo.MaxGyroscopicForce);
                    writer.Write(solverInfo.SingleAxisRollingFrictionThreshold);

                    writer.Write(solverInfo.NumIterations);
                    writer.Write((int)solverInfo.SolverMode);
                    writer.Write(solverInfo.RestingContactRestitutionThreshold);
                    writer.Write(solverInfo.MinimumSolverBatchSize);

                    writer.Write(solverInfo.SplitImpulse);
                    writer.Write((int)0); // padding
                }
            }

            serializer.FinalizeChunk(chunk, "btDynamicsWorldFloatData", DnaID.DynamicsWorld, chunk.OldPtr);
        }
 public void SolveInternalConstraints(ContactSolverInfo solverInfo)
 {
     btMultiBodyDynamicsWorld_solveInternalConstraints(Native, solverInfo.Native);
 }
		public void AllSolved(ContactSolverInfo __unnamed0, IDebugDraw __unnamed1)
		{
			btConstraintSolver_allSolved(_native, __unnamed0._native, DebugDraw.GetUnmanaged(__unnamed1));
		}
 public void SolveExternalForces(ContactSolverInfo solverInfo)
 {
     btMultiBodyDynamicsWorld_solveExternalForces(Native, solverInfo.Native);
 }
 public void SolveConstraints(ContactSolverInfo solverInfo)
 {
     btDiscreteDynamicsWorld_solveConstraints(Native, solverInfo.Native);
 }
 public void SetDynamicsWorldInfo(ref Vector3 gravity, ContactSolverInfo solverInfo)
 {
     if (_dynamicsWorld != null)
     {
         _dynamicsWorld.SetGravity(ref gravity);
     }
 }
Exemplo n.º 7
0
 public void AllSolved(ContactSolverInfo __unnamed0, IDebugDraw __unnamed1)
 {
     btConstraintSolver_allSolved(Native, __unnamed0.Native, DebugDraw.GetUnmanaged(__unnamed1));
 }
Exemplo n.º 8
0
 public void AllSolved(ContactSolverInfo __unnamed0, DebugDraw __unnamed1)
 {
     btConstraintSolver_allSolved(Native, __unnamed0.Native, __unnamed1 != null ? __unnamed1.Native : IntPtr.Zero);
 }