x
Yes
No
Do you want to visit DriveHQ English website?
首页
产品服务
价格
免费试用
下载客户端
关于我们
云文件服务
|
云备份服务
|
FTP服务
|
企业邮箱服务
|
网站托管
|
客户端软件
云文件服务
云备份服务
FTP服务
企业级邮箱服务
网站托管
客户端软件
NXU_cooking.cpp - Hosted on DriveHQ Cloud IT Platform
返回上层目录
上传
下载
共享
发布
新建文件夹
新建文件
复制
剪切
删除
粘贴
评论
升级服务
路径: \\game3dprogramming\materials\GameFactory\GameFactoryDemo\references\NxuStream2\source\NXU_cooking.cpp
旋转
特效
属性
历史版本
#include
#include
#include
#include
#include "NXU_cooking.h" #include "NxPhysicsSDK.h" #include "NxPMap.h" #include "PhysXLoader.h" // if on the Windows platform and 2.5.0 or higher, use the versioned Cooking // interface via PhysXLoader #ifdef WIN32 #if NX_SDK_VERSION_NUMBER >= 250 #define COOKING_INTERFACE 1 #endif #endif namespace NXU { #ifdef COOKING_INTERFACE NxCookingInterface *gCooking = 0; #endif bool hasCookingLibrary(void) // check to see if the cooking library is available or not! { bool ret = true; #ifdef COOKING_INTERFACE if (gCooking == 0) { gCooking = NxGetCookingLib(NX_PHYSICS_SDK_VERSION); if (gCooking == 0) { ret = false; } } #endif return ret; } bool CookConvexMesh(const ::NxConvexMeshDesc &desc, NxStream &stream) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxCookConvexMesh(desc, stream); #else return NxCookConvexMesh(desc, stream); #endif } #if NX_USE_CLOTH_API bool CookClothMesh(const ::NxClothMeshDesc &desc, NxStream &stream) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxCookClothMesh(desc, stream); #else return NxCookClothMesh(desc, stream); #endif } #endif #if NX_USE_SOFTBODY_API bool CookSoftBodyMesh(const ::NxSoftBodyMeshDesc &desc,NxStream &stream) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxCookSoftBodyMesh(desc, stream); #else return NxCookSoftBodyMesh(desc, stream); #endif } #endif bool CookTriangleMesh(const ::NxTriangleMeshDesc &desc, NxStream &stream) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxCookTriangleMesh(desc, stream); #else return NxCookTriangleMesh(desc, stream); #endif } bool InitCooking(void) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxInitCooking(); #else return NxInitCooking(); #endif } void CloseCooking() { #ifdef COOKING_INTERFACE if (!gCooking) { return ; } gCooking->NxCloseCooking(); #else return NxCloseCooking(); #endif } bool CreatePMap(NxPMap &pmap, const NxTriangleMesh &mesh, NxU32 density, NxUserOutputStream *outputStream) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxCreatePMap(pmap, mesh, density, outputStream); #else return NxCreatePMap(pmap, mesh, density, outputStream); #endif } bool ReleasePMap(NxPMap &pmap) { #ifdef COOKING_INTERFACE hasCookingLibrary(); if (!gCooking) { return false; } return gCooking->NxReleasePMap(pmap); #else return NxReleasePMap(pmap); #endif } bool SetCookingParams(const ::NxCookingParams ¶ms) { bool ret = false; #ifdef COOKING_INTERFACE hasCookingLibrary(); if (gCooking) { ret = gCooking->NxSetCookingParams(params); } #else ret = NxSetCookingParams(params); #endif return ret; } const ::NxCookingParams & GetCookingParams(void) { static NxCookingParams r; NxCookingParams &ret = r; #ifdef COOKING_INTERFACE hasCookingLibrary(); if (gCooking) { ret = gCooking->NxGetCookingParams(); } #else ret = NxGetCookingParams(); #endif return ret; } };
NXU_cooking.cpp
网页地址
文件地址
上一页
4/21
下一页
下载
( 3 KB )
Comments
Total ratings:
0
Average rating:
无评论
of 10
Would you like to comment?
Join now
, or
Logon
if you are already a member.