PhysX物理引擎(3)Rigidbody Dynamics
本文主要介绍PhysX刚体动力学相关的内部机制和使用方法。 PhysX物理引擎系列记录了在实际项目中使用Nvdia PhysX 3.4物理引擎(Code, Doc)的一些经验,有不少对官方资料的补充。 Warm-up Let’s start with some key concepts: Both Kinematic and Dynamic rigidbodies are represented as PxRigidDynamic in PhysX. You can switch between them at runtime using PxRigidBody::setRigidBodyFlag(PxRigidBodyFlag::eKINEMATIC, true). Kinematic and Static actors remain stationary unless explicitly moved in code. Moving Static actors can result in incorrect collision behavior with dynamic actors. When moving Kinematic actors, always use PxRigidDynamic::setKinematicTarget each frame instead of PxRigidActor::setGlobalPose to ensure correct collision detection with dynamic actors. This post focuses on dynamic rigidbody movement, covering topics such as force and torque, gravity, sleeping, and more. ...