PxArticulation.h

Go to the documentation of this file.
00001 //
00002 // Redistribution and use in source and binary forms, with or without
00003 // modification, are permitted provided that the following conditions
00004 // are met:
00005 //  * Redistributions of source code must retain the above copyright
00006 //    notice, this list of conditions and the following disclaimer.
00007 //  * Redistributions in binary form must reproduce the above copyright
00008 //    notice, this list of conditions and the following disclaimer in the
00009 //    documentation and/or other materials provided with the distribution.
00010 //  * Neither the name of NVIDIA CORPORATION nor the names of its
00011 //    contributors may be used to endorse or promote products derived
00012 //    from this software without specific prior written permission.
00013 //
00014 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
00015 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00016 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00017 // PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00018 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00019 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00020 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00021 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
00022 // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00023 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00024 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00025 //
00026 // Copyright (c) 2008-2018 NVIDIA Corporation. All rights reserved.
00027 // Copyright (c) 2004-2008 AGEIA Technologies, Inc. All rights reserved.
00028 // Copyright (c) 2001-2004 NovodeX AG. All rights reserved.  
00029 
00030 
00031 #ifndef PX_PHYSICS_NX_ARTICULATION
00032 #define PX_PHYSICS_NX_ARTICULATION
00033 
00036 #include "PxPhysXConfig.h"
00037 #include "common/PxBase.h"
00038 
00039 #if !PX_DOXYGEN
00040 namespace physx
00041 {
00042 #endif
00043 
00044 class PxArticulationLink;
00045 
00053 class PxArticulationDriveCache
00054 {
00055 protected:
00056     PxArticulationDriveCache();
00057 };
00058 
00069 class PxArticulation : public PxBase
00070 {
00071 public:
00079     virtual     void            release() = 0;
00080 
00088     virtual     PxScene*        getScene()  const = 0;
00089 
00090 
00103     virtual     void            setMaxProjectionIterations(PxU32 iterations) = 0;
00104 
00113     virtual     PxU32           getMaxProjectionIterations() const = 0;
00114 
00126     virtual     void            setSeparationTolerance(PxReal tolerance) = 0;
00127 
00136     virtual     PxReal          getSeparationTolerance() const = 0;
00137 
00138 
00151     virtual     void            setInternalDriveIterations(PxU32 iterations) = 0;
00152 
00161     virtual     PxU32           getInternalDriveIterations() const = 0;
00162 
00163 
00177     virtual     void            setExternalDriveIterations(PxU32 iterations) = 0;
00178 
00187     virtual     PxU32           getExternalDriveIterations() const = 0;
00188 
00189 
00190 
00207     virtual     void                setSolverIterationCounts(PxU32 minPositionIters, PxU32 minVelocityIters = 1) = 0;
00208 
00214     virtual     void                getSolverIterationCounts(PxU32 & minPositionIters, PxU32 & minVelocityIters) const = 0;
00215 
00248     virtual     bool                isSleeping() const = 0;
00249 
00259     virtual     void                setSleepThreshold(PxReal threshold) = 0;
00260 
00268     virtual     PxReal              getSleepThreshold() const = 0;
00269 
00283     virtual     void                setStabilizationThreshold(PxReal threshold) = 0;
00284 
00294     virtual     PxReal              getStabilizationThreshold() const = 0;
00295 
00311     virtual     void                setWakeCounter(PxReal wakeCounterValue) = 0;
00312 
00320     virtual     PxReal              getWakeCounter() const = 0;
00321 
00333     virtual     void                wakeUp()    = 0;
00334 
00346     virtual     void                putToSleep()    = 0;
00347 
00360     virtual         PxArticulationLink*         createLink(PxArticulationLink* parent, const PxTransform& pose) = 0;
00361 
00362 
00367     virtual     PxU32           getNbLinks() const = 0;
00368 
00382     virtual     PxU32           getLinks(PxArticulationLink** userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const = 0;
00383 
00394     virtual     void            setName(const char* name)       = 0;
00395 
00403     virtual     const char*     getName()           const   = 0;
00404 
00414     virtual     PxBounds3       getWorldBounds(float inflation=1.01f) const = 0;
00415 
00423     virtual     PxAggregate*    getAggregate() const = 0;
00424 
00439     virtual     PxArticulationDriveCache* 
00440                                 createDriveCache(PxReal compliance, PxU32 driveIterations) const = 0;
00441 
00442 
00455     virtual     void            updateDriveCache(PxArticulationDriveCache& driveCache,
00456                                                  PxReal compliance, 
00457                                                  PxU32 driveIterations) const = 0;
00458 
00466     virtual     void            releaseDriveCache(PxArticulationDriveCache& driveCache) const = 0;
00467 
00481     virtual     void            applyImpulse(PxArticulationLink* link,
00482                                              const PxArticulationDriveCache& driveCache,
00483                                              const PxVec3& linearImpulse,
00484                                              const PxVec3& angularImpulse) = 0;
00485 
00503     virtual     void            computeImpulseResponse(PxArticulationLink*link,
00504                                                        PxVec3& linearResponse, 
00505                                                        PxVec3& angularResponse,
00506                                                        const PxArticulationDriveCache& driveCache,
00507                                                        const PxVec3& linearImpulse,
00508                                                        const PxVec3& angularImpulse) const = 0;
00509 
00510 
00511     //public variables:
00512                 void*           userData;   
00513 
00514     virtual     const char*     getConcreteTypeName() const { return "PxArticulation"; }
00515 
00516 protected:
00517     PX_INLINE                   PxArticulation(PxType concreteType, PxBaseFlags baseFlags) : PxBase(concreteType, baseFlags) {}
00518     PX_INLINE                   PxArticulation(PxBaseFlags baseFlags) : PxBase(baseFlags) {}
00519     virtual                     ~PxArticulation() {}
00520     virtual     bool            isKindOf(const char* name) const { return !::strcmp("PxArticulation", name) || PxBase::isKindOf(name); }
00521 
00522 
00523 };
00524 
00525 #if !PX_DOXYGEN
00526 } // namespace physx
00527 #endif
00528 
00530 #endif


Copyright © 2008-2018 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com