Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CCharacterMovement::Physicalize()
- {
- // Physicalize the player as type Living.
- // This physical entity type is specifically implemented for players
- SEntityPhysicalizeParams physParams;
- physParams.type = PE_LIVING;
- physParams.nSlot = -1;
- physParams.mass = m_pCharacter->GetCVars().m_mass;
- pe_player_dimensions playerDimensions;
- // Prefer usage of a cylinder instead of capsule
- playerDimensions.bUseCapsule = 0;
- // Specify the size of our cylinder
- playerDimensions.sizeCollider = Vec3(0.5f, 0.5f, 1.0f);
- // Keep pivot at the player's feet (defined in player geometry)
- playerDimensions.heightPivot = 0.f;
- // Offset collider upwards
- playerDimensions.heightCollider = 1.f;
- playerDimensions.groundContactEps = 0.004f;
- physParams.pPlayerDimensions = &playerDimensions;
- pe_player_dynamics playerDynamics;
- playerDynamics.kAirControl = 0.f;
- playerDynamics.mass = physParams.mass;
- physParams.pPlayerDynamics = &playerDynamics;
- GetEntity()->Physicalize(physParams);
- GetEntity()->EnablePhysics(true);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement