diff options
| author | git perforce import user <a@b> | 2016-10-25 12:29:14 -0600 |
|---|---|---|
| committer | Sheikh Dawood Abdul Ajees <Sheikh Dawood Abdul Ajees> | 2016-10-25 18:56:37 -0500 |
| commit | 3dfe2108cfab31ba3ee5527e217d0d8e99a51162 (patch) | |
| tree | fa6485c169e50d7415a651bf838f5bcd0fd3bfbd /APEX_1.4/module/iofx/src/ModifierCPU.cpp | |
| download | physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.tar.xz physx-3.4-3dfe2108cfab31ba3ee5527e217d0d8e99a51162.zip | |
Initial commit:
PhysX 3.4.0 Update @ 21294896
APEX 1.4.0 Update @ 21275617
[CL 21300167]
Diffstat (limited to 'APEX_1.4/module/iofx/src/ModifierCPU.cpp')
| -rw-r--r-- | APEX_1.4/module/iofx/src/ModifierCPU.cpp | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/APEX_1.4/module/iofx/src/ModifierCPU.cpp b/APEX_1.4/module/iofx/src/ModifierCPU.cpp new file mode 100644 index 00000000..572e8ac2 --- /dev/null +++ b/APEX_1.4/module/iofx/src/ModifierCPU.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2008-2015, NVIDIA CORPORATION. All rights reserved. + * + * NVIDIA CORPORATION and its licensors retain all intellectual property + * and proprietary rights in and to this software, related documentation + * and any modifications thereto. Any use, reproduction, disclosure or + * distribution of this software and related documentation without an express + * license agreement from NVIDIA CORPORATION is strictly prohibited. + */ + + +#include "ModifierImpl.h" + +#pragma warning (disable : 4127) + +#include "ModifierData.h" + +namespace nvidia +{ +namespace apex +{ + +#define MODIFIER_DECL +#define CURVE_TYPE const nvidia::apex::Curve* +#define EVAL_CURVE(curve, value) curve->evaluate(value) +#define PARAMS_NAME(name) name ## ParamsCPU + +#include "ModifierSrc.h" + +#undef MODIFIER_DECL +#undef CURVE_TYPE +#undef EVAL_CURVE +#undef PARAMS_NAME + +} + +namespace iofx +{ + +#define _MODIFIER(name) \ + void name ## ModifierImpl :: mapParamsCPU(ModifierParamsMapperCPU& mapper) const \ + { \ + mapParams(mapper, (name ## ParamsCPU *)NULL); \ + } \ + +#define _MODIFIER_SPRITE(name) \ + void updateSprite_##name (const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, false, ModifierUsage_Sprite> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + void updateSpriteOnSpawn_##name (const void* params, const SpriteInput& input, SpritePublicState& pubState, SpritePrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, true, ModifierUsage_Sprite> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + ModifierImpl::updateSpriteFunc name##ModifierImpl :: getUpdateSpriteFunc(ModifierStage stage) const \ + { \ + switch (stage) { \ + case ModifierStage_Spawn: return &updateSpriteOnSpawn_##name; \ + case ModifierStage_Continuous: return &updateSprite_##name; \ + default: \ + PX_ALWAYS_ASSERT(); \ + return 0; \ + } \ + } + +#define _MODIFIER_MESH(name) \ + void updateMesh_##name (const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, false, ModifierUsage_Mesh> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + void updateMeshOnSpawn_##name (const void* params, const MeshInput& input, MeshPublicState& pubState, MeshPrivateState& privState, const ModifierCommonParams& common, RandState& randState) \ + { \ + modifier##name <void, true, ModifierUsage_Mesh> (*static_cast<const name##ParamsCPU *>(params), input, pubState, privState, common, randState); \ + } \ + ModifierImpl::updateMeshFunc name##ModifierImpl :: getUpdateMeshFunc(ModifierStage stage) const \ + { \ + switch (stage) { \ + case ModifierStage_Spawn: return &updateMeshOnSpawn_##name; \ + case ModifierStage_Continuous: return &updateMesh_##name; \ + default: \ + PX_ALWAYS_ASSERT(); \ + return 0; \ + } \ + } + +#include "ModifierList.h" + +} +} // namespace nvidia |