APEX Framework: Shape.h Source File

NVIDIA APEX

Shape.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2008-2017, NVIDIA CORPORATION.  All rights reserved.
00003  *
00004  * NVIDIA CORPORATION and its licensors retain all intellectual property
00005  * and proprietary rights in and to this software, related documentation
00006  * and any modifications thereto.  Any use, reproduction, disclosure or
00007  * distribution of this software and related documentation without an express
00008  * license agreement from NVIDIA CORPORATION is strictly prohibited.
00009  */
00010 
00011 
00012 #ifndef SHAPE_H
00013 #define SHAPE_H
00014 
00020 #include "foundation/PxPreprocessor.h"
00021 #include "ApexUsingNamespace.h"
00022 
00023 #include "ApexDefs.h"
00024 
00025 /*#if PX_PHYSICS_VERSION_MAJOR < 3
00026 #include "Nxp.h"
00027 #endif*/
00028 
00029 namespace nvidia
00030 {
00031 namespace apex
00032 {
00033 
00034 PX_PUSH_PACK_DEFAULT
00035 
00036 
00037 class SphereShape;
00038 class CapsuleShape;
00039 class BoxShape;
00040 class HalfSpaceShape;
00041 class RenderDebugInterface;
00042 
00046 class Shape
00047 {
00048 public:
00049 
00051     virtual bool intersectAgainstAABB(PxBounds3) = 0;
00052 
00054     virtual PxBounds3 getAABB() const = 0;
00055 
00057     virtual const BoxShape* isBoxGeom() const
00058     {
00059         return NULL;
00060     }
00061 
00063     virtual const SphereShape* isSphereGeom() const
00064     {
00065         return NULL;
00066     }
00067 
00069     virtual const CapsuleShape* isCapsuleGeom() const
00070     {
00071         return NULL;
00072     }
00073 
00075     virtual const HalfSpaceShape* isHalfSpaceGeom() const
00076     {
00077         return NULL;
00078     }
00079 
00081     virtual void releaseApexShape() = 0;
00082 
00084     virtual void visualize(RenderDebugInterface* renderer) const = 0;
00085 
00087     virtual PxMat44 getPose() const = 0;
00088 
00090     virtual void setPose(PxMat44 pose) = 0;
00091 
00093     virtual PxMat44 getPreviousPose() const = 0;
00094 };
00095 
00097 class SphereShape : public Shape
00098 {
00099 public:
00101     virtual float getRadius() const = 0;
00102 
00104     virtual void setRadius(float radius) = 0;
00105 
00106 };
00107 
00109 class CapsuleShape : public Shape
00110 {
00111 public:
00113     virtual void getDimensions(float& height, float& radius) const = 0;
00114 
00116     virtual void setDimensions(float height, float radius) = 0;
00117 
00118 };
00119 
00121 class BoxShape : public Shape
00122 {
00123 public:
00126     virtual void setSize(PxVec3 size) = 0;
00127 
00129     virtual PxVec3 getSize() const = 0;
00130 
00131 };
00132 
00134 class HalfSpaceShape : public Shape
00135 {
00136 public:
00138     virtual void setOriginAndNormal(PxVec3 origin, PxVec3 normal) = 0;
00139 
00141     virtual PxVec3 getNormal() const = 0;
00142 
00144     virtual PxVec3 getOrigin() const = 0;
00145 
00147     virtual PxVec3 getPreviousOrigin() const = 0;
00148 };
00149 
00150 
00151 PX_POP_PACK
00152 
00153 }
00154 } // end namespace nvidia::apex
00155 
00156 #endif // SHAPE_H

Generated on Fri Dec 15 2017 13:58:35
Copyright © 2012-2017 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved.