Removed some trailing white space. Fixed FindGLM.

This commit is contained in:
Cirilo Bernardo 2015-12-10 11:31:44 +11:00
parent 41025154a6
commit 4e12999fa8
10 changed files with 45 additions and 42 deletions

View File

@ -274,14 +274,14 @@ void C3D_MODEL_VIEWER::OnPaint( wxPaintEvent &event )
double modelunit_to_3d_units_factor = m_BiuTo3Dunits * UNITS3D_TO_UNITSPCB;
const SFVEC3F model_center = m_ogl_3dmodel->GetBBox().GetCenter();
glTranslatef( model_center.x, model_center.y, model_center.z );
glScaled( modelunit_to_3d_units_factor, modelunit_to_3d_units_factor, modelunit_to_3d_units_factor);
//const SFVEC3F model_center = m_ogl_3dmodel->GetBBox().GetCenter();
//glTranslatef( -model_center.x, -model_center.y, -model_center.z );
m_ogl_3dmodel->Draw_opaque();
//m_ogl_3dmodel->Draw_transparent();
//m_ogl_3dmodel->Draw_bboxes();
m_ogl_3dmodel->Draw_bboxes();
glPopMatrix();
}

View File

@ -34,7 +34,7 @@
#include "common_ogl/openGL_includes.h"
#include "3d_rendering/3d_render_raytracing/shapes3D/cbbox.h"
///
///
class GLM_ALIGN(CLASS_ALIGNMENT) C_OGL_3DMODEL
{
public:

View File

@ -33,7 +33,7 @@
#include "ray.h"
#include "hitinfo.h"
///
///
class GLM_ALIGN(CLASS_ALIGNMENT) CMATERIAL
{
public:
@ -63,7 +63,7 @@ public:
virtual bool isTransparent(Vec3f point){return ((transparentColor.x()>0)||(transparentColor.y()>0)||(transparentColor.z()>0));}
*/
protected:
SFVEC3F m_ambientColor;
SFVEC3F m_ambientColor;
// NOTE: we will not use diffuse color material here,
// because it will be stored in object, since there are objects (i.e: triangles)
// that can have per vertex color

View File

@ -92,11 +92,11 @@ bool CIMAGE::wrapCoords( int *aXo, int *aYo ) const
default:
break;
}
if( (x < 0) || (x >= (int)m_width) ||
(y < 0) || (y >= (int)m_height) )
return false;
*aXo = x;
*aYo = y;
@ -206,7 +206,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe
else
{
if ( (aImgA == NULL) || (aImgB == NULL) )
return;
return;
}
switch(aOperation)
@ -281,7 +281,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe
m_pixels[it] = aImgA->m_pixels[it] ^ aImgB->m_pixels[it];
}
break;
case COPY_BLEND50:
for( unsigned int it = 0;it < m_wxh; it++ )
{
@ -332,7 +332,7 @@ static const S_FILTER FILTERS[] = {
7,
255
},
// Blur
{
{ { 3, 5, 7, 5, 3},
@ -457,7 +457,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
#ifdef USE_OPENMP
#pragma omp parallel for
#endif /* USE_OPENMP */
for( int iy = 0; iy < (int)m_height; iy++)
{
for( int ix = 0; ix < (int)m_width; ix++ )
@ -473,7 +473,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
v += pixelv * factor;
}
}
v /= filter.div;
v += filter.offset;
@ -500,7 +500,7 @@ void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray )
void CIMAGE::SaveAsPNG( wxString aFileName ) const
{
unsigned char* pixelbuffer = (unsigned char*) malloc( m_wxh * 3 );
wxImage image( m_width, m_height );
for( unsigned int i = 0; i < m_wxh; i++)

View File

@ -108,7 +108,7 @@ public:
* @param aValue value to set the pixel
*/
void Setpixel( int aX, int aY, unsigned char aValue );
/**
* Function Getpixel
* get the pixel value from pixel position, position is clamped in accord with the

View File

@ -80,11 +80,11 @@ bool CIMAGE::wrapCoords( int *aXo, int *aYo ) const
default:
break;
}
if( (x < 0) || (x >= (int)m_width) ||
(y < 0) || (y >= (int)m_height) )
return false;
*aXo = x;
*aYo = y;
@ -127,7 +127,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe
else
{
if ( (aImgA == NULL) || (aImgB == NULL) )
return;
return;
}
switch(aOperation)
@ -202,7 +202,7 @@ void CIMAGE::CopyFull( const CIMAGE *aImgA, const CIMAGE *aImgB, E_IMAGE_OP aOpe
m_pixels[it] = aImgA->m_pixels[it] ^ aImgB->m_pixels[it];
}
break;
case COPY_BLEND50:
for( unsigned int it = 0;it < m_wxh; it++ )
{
@ -253,7 +253,7 @@ static const S_FILTER FILTERS[] = {
7,
255
},
// Blur
{
{ { 3, 5, 7, 5, 3},
@ -378,7 +378,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
#ifdef USE_OPENMP
#pragma omp parallel for
#endif /* USE_OPENMP */
for( int iy = 0; iy < (int)m_height; iy++)
{
for( int ix = 0; ix < (int)m_width; ix++ )
@ -394,7 +394,7 @@ void CIMAGE::EfxFilter( CIMAGE *aInImg, E_FILTER aFilterType )
v += pixelv * factor;
}
}
v /= filter.div;
v += filter.offset;
@ -421,7 +421,7 @@ void CIMAGE::SetPixelsFromNormalizedFloat( const float * aNormalizedFloatArray )
void CIMAGE::SaveAsPNG( wxString aFileName ) const
{
unsigned char* pixelbuffer = (unsigned char*) malloc( m_wxh * 3 );
wxImage image( m_width, m_height );
for( unsigned int i = 0; i < m_wxh; i++)

View File

@ -99,7 +99,7 @@ public:
* @param aValue value to set the pixel
*/
void Setpixel( int aX, int aY, unsigned char aValue );
/**
* Function Getpixel
* get the pixel value from pixel position, position is clamped in accord with the

View File

@ -8,15 +8,16 @@ if( ${CMAKE_MAJOR_VERSION} STREQUAL "2" AND ${CMAKE_MINOR_VERSION} STREQUAL "8"
endif()
find_path( GLM_INCLUDE_DIR glm.hpp PATH_SUFFIXES glm )
find_path( GLM_INCLUDE_DIR glm/glm.hpp )
if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
if( NOT ${GLM_INCLUDE_DIR} STREQUAL "GLM_INCLUDE_DIR-NOTFOUND" )
# attempt to extract the GLM Version information from setup.hpp
find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES core detail NO_DEFAULT_PATH )
find_file( GLM_SETUP setup.hpp PATHS ${GLM_INCLUDE_DIR} PATH_SUFFIXES glm/core glm/detail NO_DEFAULT_PATH )
if( GLM_SETUP )
if( NOT ${GLM_SETUP} STREQUAL "GLM_SETUP-NOTFOUND" )
# extract the "#define GLM_VERSION*" lines
file( STRINGS ${GLM_SETUP} _version REGEX "^#define.*GLM_VERSION.*" )
@ -50,14 +51,16 @@ if( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
set( GLM_VERSION ${_GLM_VERSION_MAJOR}.${_GLM_VERSION_MINOR}.${_GLM_VERSION_PATCH}.${_GLM_VERSION_REVISION} )
unset( GLM_SETUP CACHE )
endif( GLM_SETUP )
endif()
endif( NOT ${GLM_INCLUDE_DIR} STREQUAL "" )
endif()
include( FindPackageHandleStandardArgs )
FIND_PACKAGE_HANDLE_STANDARD_ARGS( GLM
REQUIRED_VARS GLM_INCLUDE_DIR
REQUIRED_VARS
GLM_INCLUDE_DIR
GLM_VERSION
VERSION_VAR GLM_VERSION )

View File

@ -30,7 +30,7 @@
#define IFSG_API_H
#include <wx/string.h>
#include <glm.hpp>
#include <glm/glm.hpp>
#include "plugins/3dapi/sg_types.h"
#include "plugins/3dapi/sg_base.h"

View File

@ -31,15 +31,15 @@
#define XV3D_TYPES_H
#define GLM_FORCE_RADIANS
#include <glm.hpp>
#include <gtc/matrix_transform.hpp>
#include <gtc/type_ptr.hpp>
#include <gtx/matrix_major_storage.hpp>
#include <gtx/matrix_decompose.hpp>
#include <gtx/quaternion.hpp>
#include <gtx/fast_square_root.hpp>
#include <gtx/rotate_vector.hpp>
//#include <gtx/simd_vec4.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include <glm/gtx/matrix_major_storage.hpp>
#include <glm/gtx/matrix_decompose.hpp>
#include <glm/gtx/quaternion.hpp>
#include <glm/gtx/fast_square_root.hpp>
#include <glm/gtx/rotate_vector.hpp>
//#include <glm/gtx/simd_vec4.hpp>
typedef glm::uvec2 SFVEC2UI;
typedef glm::ivec2 SFVEC2I;