본문 바로가기

PhysX15

2. Physics 클래스 분석 - 1 Physics 클래스는 물리 처리에 대한 모든 것을 관리한다. (블록과 블록이 이루고 있는 타워까지) Physics 생성자 Physics::Physics () { srand(time(NULL) * time(NULL)); gFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback); gPhysicsSDK = PxCreatePhysics(PX_PHYSICS_VERSION, *gFoundation, PxTolerancesScale()); if(gPhysicsSDK == NULL) { cerrcreateRigidStatic(planePos); // PxPlaneGeometry를 전달했으므로.. 2023. 2. 27.
1. WinMain - Jenga 게임 메인 로직 본 게시물은 PhysX와 DirectX11의 이해를 위해서, 아래 Github 주소에 있는 Jenga project 코드를 분석하는 글입니다. https://github.com/JaninaAlthoefer/JengaGame GitHub - JaninaAlthoefer/JengaGame: A digital implementation of the game Jenga. Written in C++ and using NVidia PhysX (physics e A digital implementation of the game Jenga. Written in C++ and using NVidia PhysX (physics engine) and DirectX. - GitHub - JaninaAlthoefer/Jenga.. 2023. 2. 26.
1. PhysX 초기화 #include int main() { // declare variables physx::PxDefaultAllocator mDefaultAllocatorCallback; // 물리 엔진에서 사용하는 모든 동적 할당은 이 할당자를 거친다. // 사용자 지정 할당자는 PxAllocatorCallback 클래스를 구현해야 한다. physx::PxDefaultErrorCallback mDefaultErrorCallback; // 오류나 경고를 처리하는 콜백 클래스이다. physx::PxDefaultCpuDispatcher* mDispatcher = NULL; // PhysX는 CPU와 GPU를 모두 사용하는 하이브리드 물리 엔진이며, // 이 클래스는 CPU 코어를 효율적으로 사용하는 데 중요한 역할을 한다... 2023. 2. 25.