00001 /******************************************************************************* 00002 Copyright (c) 2005-2009 David Williams 00003 00004 This software is provided 'as-is', without any express or implied 00005 warranty. In no event will the authors be held liable for any damages 00006 arising from the use of this software. 00007 00008 Permission is granted to anyone to use this software for any purpose, 00009 including commercial applications, and to alter it and redistribute it 00010 freely, subject to the following restrictions: 00011 00012 1. The origin of this software must not be misrepresented; you must not 00013 claim that you wrote the original software. If you use this software 00014 in a product, an acknowledgment in the product documentation would be 00015 appreciated but is not required. 00016 00017 2. Altered source versions must be plainly marked as such, and must not be 00018 misrepresented as being the original software. 00019 00020 3. This notice may not be removed or altered from any source 00021 distribution. 00022 *******************************************************************************/ 00023 00024 #ifndef __PolyVox_SurfaceVertex_H__ 00025 #define __PolyVox_SurfaceVertex_H__ 00026 00027 #include "PolyVoxImpl/TypeDef.h" 00028 00029 #include "PolyVoxCore/Vector.h" 00030 00031 #include <bitset> 00032 #include <vector> 00033 00034 namespace PolyVox 00035 { 00036 #ifdef SWIG 00037 class PositionMaterial 00038 #else 00039 class POLYVOX_API PositionMaterial 00040 #endif 00041 { 00042 public: 00043 PositionMaterial(); 00044 PositionMaterial(Vector3DFloat positionToSet, float materialToSet); 00045 00046 float getMaterial(void) const; 00047 const Vector3DFloat& getPosition(void) const; 00048 00049 void setMaterial(float materialToSet); 00050 void setPosition(const Vector3DFloat& positionToSet); 00051 public: 00052 //Nicely fits into four floats. 00053 Vector3DFloat position; 00054 float material; 00055 }; 00056 00057 #ifdef SWIG 00058 class PositionMaterialNormal 00059 #else 00060 class POLYVOX_API PositionMaterialNormal 00061 #endif 00062 { 00063 public: 00064 PositionMaterialNormal(); 00065 PositionMaterialNormal(Vector3DFloat positionToSet, float materialToSet); 00066 PositionMaterialNormal(Vector3DFloat positionToSet, Vector3DFloat normalToSet, float materialToSet); 00067 00068 float getMaterial(void) const; 00069 const Vector3DFloat& getNormal(void) const; 00070 const Vector3DFloat& getPosition(void) const; 00071 00072 void setMaterial(float materialToSet); 00073 void setNormal(const Vector3DFloat& normalToSet); 00074 void setPosition(const Vector3DFloat& positionToSet); 00075 00076 public: 00077 //Nicely fits into seven floats, meaning we 00078 //can squeeze in one more for material blending. 00079 Vector3DFloat position; 00080 Vector3DFloat normal; 00081 float material; //FIXME: This shouldn't be float on CPU? 00082 }; 00083 } 00084 00085 #endif