| 50 | } |
| 51 | |
| 52 | Sc::BodyCore::BodyCore(PxActorType::Enum type, const PxTransform& bodyPose) |
| 53 | : RigidCore(type) |
| 54 | { |
| 55 | const PxTolerancesScale& scale = Physics::getInstance().getTolerancesScale(); |
| 56 | // sizeof(BodyCore) = 176 => 160 => 144 => 160 bytes |
| 57 | |
| 58 | mCore.wakeCounter = Sc::Physics::sWakeCounterOnCreation; |
| 59 | mCore.inverseInertia = PxVec3(1.0f); |
| 60 | mCore.inverseMass = 1.0f; |
| 61 | mCore.body2World = bodyPose; |
| 62 | |
| 63 | PX_ASSERT(mCore.body2World.p.isFinite()); |
| 64 | PX_ASSERT(mCore.body2World.q.isFinite()); |
| 65 | |
| 66 | mCore.sleepThreshold = 5e-5f * scale.speed * scale.speed; |
| 67 | mCore.freezeThreshold = 2.5e-5f * scale.speed * scale.speed; |
| 68 | mSimStateData = NULL; |
| 69 | mCore.maxPenBias = -1e32f;//-PX_MAX_F32; |
| 70 | mCore.mFlags = PxRigidBodyFlags(); |
| 71 | mCore.linearVelocity = PxVec3(0.0f); |
| 72 | mCore.angularVelocity = PxVec3(0.0f); |
| 73 | mCore.linearDamping = 0.0f; |
| 74 | mCore.solverIterationCounts = (1 << 8) | 4; |
| 75 | mCore.contactReportThreshold = PX_MAX_F32; |
| 76 | mCore.setBody2Actor(PxTransform(PxIdentity)); |
| 77 | mCore.ccdAdvanceCoefficient = 0.15f; |
| 78 | mCore.maxContactImpulse = 1e32f;// PX_MAX_F32; |
| 79 | mCore.isFastMoving = false; |
| 80 | mCore.lockFlags = PxRigidDynamicLockFlags(0); |
| 81 | |
| 82 | if(type == PxActorType::eRIGID_DYNAMIC) |
| 83 | { |
| 84 | mCore.angularDamping = 0.05f; |
| 85 | mCore.maxAngularVelocitySq = 100.0f * 100.0f; |
| 86 | // mCore.maxAngularVelocitySq = 7.0f * 7.0f; |
| 87 | mCore.maxLinearVelocitySq = 1e32f; //PX_MAX_F32; |
| 88 | } |
| 89 | else |
| 90 | { |
| 91 | mCore.linearDamping = 0.05f; |
| 92 | mCore.angularDamping = 0.05f; |
| 93 | mCore.maxAngularVelocitySq = 50.0f * 50.0f; |
| 94 | mCore.maxLinearVelocitySq = 100.f * 100.f * scale.length * scale.length; |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | Sc::BodyCore::~BodyCore() |
| 99 | { |
nothing calls this directly
no test coverage detected