diff options
| author | Bryan Galdrikian <[email protected]> | 2017-08-23 11:24:32 -0700 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2017-08-23 11:24:32 -0700 |
| commit | f1e539cadfb085cedc32f9773cfb9d14bfcdf138 (patch) | |
| tree | 7ca74e06a4386dd22fd850a8417a31a85d282a30 /tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp | |
| parent | Updated to CL 22661993: (diff) | |
| download | blast-f1e539cadfb085cedc32f9773cfb9d14bfcdf138.tar.xz blast-f1e539cadfb085cedc32f9773cfb9d14bfcdf138.zip | |
Removing ArtistTools and CurveEditor projects
Diffstat (limited to 'tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp')
| -rw-r--r-- | tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp | 161 |
1 files changed, 0 insertions, 161 deletions
diff --git a/tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp b/tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp deleted file mode 100644 index a3a6dd1..0000000 --- a/tools/ArtistTools/source/BlastPlugin/SampleBase/ui/EditionToolController.cpp +++ /dev/null @@ -1,161 +0,0 @@ -// This code contains NVIDIA Confidential Information and is disclosed to you -// under a form of NVIDIA software license agreement provided separately to you. -// -// Notice -// NVIDIA Corporation and its licensors retain all intellectual property and -// proprietary rights in and to this software and 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. -// -// ALL NVIDIA DESIGN SPECIFICATIONS, CODE ARE PROVIDED "AS IS.". NVIDIA MAKES -// NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO -// THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, -// MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. -// -// Information and code furnished is believed to be accurate and reliable. -// However, NVIDIA Corporation assumes no responsibility for the consequences of use of such -// information or for any infringement of patents or other rights of third parties that may -// result from its use. No license is granted by implication or otherwise under any patent -// or patent rights of NVIDIA Corporation. Details are subject to change without notice. -// This code supersedes and replaces all information previously supplied. -// NVIDIA Corporation products are not authorized for use as critical -// components in life support devices or systems without express written approval of -// NVIDIA Corporation. -// -// Copyright (c) 2008-2017 NVIDIA Corporation. All rights reserved. - - -#include "EditionToolController.h" -#include "BlastController.h" -#include "Renderer.h" -#include "PhysXController.h" -#include "SampleProfiler.h" -#include "PxRigidDynamic.h" -#include "PxScene.h" -#include "NvBlastExtPxManager.h" -#include "SceneController.h" -#include "NvBlastExtPxActor.h" -#include "GlobalSettings.h" -using namespace Nv::Blast; -using namespace physx; - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Setup -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - -EditionToolController::EditionToolController() -{ -} - -EditionToolController::~EditionToolController() -{ -} - -void EditionToolController::onSampleStart() -{ -} - -void EditionToolController::onInitialize() -{ -} - - -void EditionToolController::onSampleStop() -{ -} - -void EditionToolController::Animate(double dt) -{ - PROFILER_SCOPED_FUNCTION(); -} - - -LRESULT EditionToolController::MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - PROFILER_SCOPED_FUNCTION(); - - if (uMsg == WM_LBUTTONDOWN || uMsg == WM_MOUSEMOVE || uMsg == WM_LBUTTONUP) - { - float mouseX = (float)LOWORD(lParam); - float mouseY = (float)HIWORD(lParam); - bool press = uMsg == WM_LBUTTONDOWN; - - if (uMsg == WM_LBUTTONUP) - { - PxVec3 eyePos, pickDir; - getPhysXController().getEyePoseAndPickDir(mouseX, mouseY, eyePos, pickDir); - pickDir = pickDir.getNormalized(); - - PxRaycastHit hit; hit.shape = NULL; - PxRaycastBuffer hit1; - getPhysXController().getEditPhysXScene().raycast(eyePos, pickDir, PX_MAX_F32, hit1, PxHitFlag::ePOSITION | PxHitFlag::eNORMAL); - hit = hit1.block; - - PxRigidActor* actor = NULL; - if (hit.shape) - { - actor = hit.actor; - } - fracture(actor); - } - } - - return 1; -} - -void EditionToolController::drawUI() -{ -} - -void EditionToolController::fracture(PxActor* actor) -{ - if (NULL == actor) - { - return; - } - - BlastController& blastController = getBlastController(); - std::vector<BlastFamilyPtr>& families = blastController.getFamilies(); - if (families.size() == 0) - { - return; - } - - PxRigidDynamic* rigidDynamic = actor->is<PxRigidDynamic>(); - if (NULL == rigidDynamic) - { - return; - } - - BlastFamilyPtr pBlastFamily = NULL; - std::vector<BlastFamilyPtr>::iterator it = families.begin(); - for (; it != families.end(); it++) - { - BlastFamilyPtr f = *it; - if (f->find(*actor)) - { - pBlastFamily = f; - break; - } - } - if (NULL == pBlastFamily) - { - return; - } - - const uint32_t chunkIndex = pBlastFamily->getChunkIndexByPxActor(*actor); - - const BlastAsset& blastAsset = pBlastFamily->getBlastAsset(); - BlastAsset* pBlastAsset = (BlastAsset*)&blastAsset; - - VoronoiFractureExecutor executor; - executor.setSourceAsset(pBlastAsset); - executor.setTargetChunk(chunkIndex); - executor.execute(); -}
\ No newline at end of file |