code stringlengths 1 2.01M | repo_name stringlengths 3 62 | path stringlengths 1 267 | language stringclasses 231
values | license stringclasses 13
values | size int64 1 2.01M |
|---|---|---|---|---|---|
#include <UnitTest++.h>
#include <Utility/CheckPoint.hpp>
#include <3rdParty/TaucsWrapper.hpp>
#include <zMat.hpp>
using namespace zzz;
#ifdef ZZZ_LIB_TAUCS
SUITE(TaucsTest)
{
TEST(SymmetricTest)
{
// 1 0.5 0 0
// 0.5 1 0.5 0
// 0 0.5 1 0.5
// 0 0 0.5 ... | zzz-engine | EngineTest/MathTest/TaucsTest.cpp | C++ | gpl3 | 1,845 |
#include <UnitTest++.h>
#include <Utility/Global.hpp>
using namespace zzz;
SUITE(GlobalTest)
{
TEST(AssignAndRetrieve)
{
ZGLOBAL_DEFINE(int, global_x, 10);
*(Global::Instance().Get<int*>("global_x"))=100;
CHECK_EQUAL(100,global_x);
}
} | zzz-engine | EngineTest/MathTest/GlobalTest.cpp | C++ | gpl3 | 268 |
#include <UnitTest++.h>
#include <3rdParty/CGALDelaunay.hpp>
#include <Math/Vector3.hpp>
#include <Math/Vector2.hpp>
#include <Utility/TextProgressBar.hpp>
#include <vector>
using namespace zzz;
#ifdef ZZZ_LIB_CGAL
SUITE(CGALTest)
{
bool CheckInVector(const Vector3i &t, const int i) {
if (t[0]==i) re... | zzz-engine | EngineTest/MathTest/CGALDelaunayTest.cpp | C++ | gpl3 | 2,850 |
#include <UnitTest++.h>
#include <XML/RapidXML.hpp>
#ifdef ZZZ_LIB_RAPIDXML
using namespace zzz;
/*
<?xml version="1.0" ?>
<MyApp>
<Messages>
<Welcome>Welcome to MyApp</Welcome>
<Farewell>Thank you for using MyApp</Farewell>
</Messages>
<Windows>
<Window name="MainFrame" x="5" y="15" w... | zzz-engine | EngineTest/MathTest/RapidXMLTest.cpp | C++ | gpl3 | 2,753 |
#include <UnitTest++.h>
#include <3rdParty/ANNChar4Vector.hpp>
// using namespace zzz;
// SUITE(ANNTest)
// {
// TEST(ANNCharTest)
// {
// RandomInteger<zuint> r(0,255);
// ANNChar4Vector<128> ann;
// vector<Vector<128,zuchar> > pool;
// pool.reserve(20000);
// for (zuint i=0; i<2... | zzz-engine | EngineTest/MathTest/ANNTest.cpp | C++ | gpl3 | 983 |
#include <UnitTest++.h>
#include <GraphicsAlgo/Delaunay.hpp>
#include <Math/Vector2.hpp>
using namespace zzz;
SUITE(DelaunayTest)
{
bool CheckInVector(const Vector3i &t, const int i) {
if (t[0]==i) return true;
if (t[1]==i) return true;
if (t[2]==i) return true;
return false;
}
bool ... | zzz-engine | EngineTest/MathTest/DelaunayTest.cpp | C++ | gpl3 | 2,748 |
#pragma once
#include <UnitTest++.h>
#include <Math/DVector.hpp>
using namespace zzz;
SUITE(DVectorTest)
{
TEST(Construct)
{
DVector<int,true> x(10);
}
} | zzz-engine | EngineTest/MathTest/DVectorTest.cpp | C++ | gpl3 | 175 |
#define SCL_SECURE_NO_WARNINGS
#include <UnitTest++.h>
#include <Utility/CmdParser.hpp>
using namespace zzz;
ZFLAGS_STRING2(istr,"","Input string",'s');
ZFLAGS_DOUBLE2(idbl,50,"Input double",'d');
ZFLAGS_INT2(iint,1,"Input int",'i');
ZFLAGS_SWITCH2(iswt,"Input switch",'w');
ZFLAGS_BOOL2(ibool,true,"Input bool... | zzz-engine | EngineTest/MathTest/CmdParserTest.cpp | C++ | gpl3 | 1,147 |
#include <UnitTest++.h>
#include <3rdparty/RegularExpression.hpp>
#ifdef ZZZ_LIB_BOOST
using namespace zzz;
SUITE(RegularExpressionTest)
{
TEST(MatchTest)
{
RegularExpression re;
//credit card
re.Compile("(\\d{4}[- ])(\\d{4}[- ]){2}(\\d{4})");
CHECK_EQUAL(true,re.Match("1234 5678 9183... | zzz-engine | EngineTest/MathTest/RegularExpressTest.cpp | C++ | gpl3 | 1,301 |
#include <UnitTest++.h>
#include <vector>
#include <Math/Vector3.hpp>
#include <SfM/Homography.hpp>
#include <SfM/Affine.hpp>
using namespace zzz;
#if defined(ZZZ_LIB_LAPACK)
SUITE(HomographyTest)
{
TEST(AffineTest)
{
vector<Vector2d> a,b;
a.push_back(Vector2d(0,0)); b.push_back(Vector2d(1,1));
a.push_... | zzz-engine | EngineTest/MathTest/HomographyTest.cpp | C++ | gpl3 | 2,155 |
#include <UnitTest++.h>
#include <zCoreAutoLink.hpp>
#include <zGraphicsAutoLink.hpp>
#include <Utility/CmdParser.hpp>
int main(int argc, char** argv)
{
ZCMDPARSE(argv[0]);
return UnitTest::RunAllTests();
}
| zzz-engine | EngineTest/MathTest/main.cpp | C++ | gpl3 | 213 |
#include <zMat.hpp>
#include <UnitTest++.h>
namespace zzz{
struct ClassA{
int x;
void operator =(const ClassA &other) {x=other.x+1;}
};
template<>
class IOObject<ClassA> {
public:
static void CopyData(ClassA* dst, const ClassA* src, zsize size) {
memcpy(dst,src,sizeof(ClassA)*... | zzz-engine | EngineTest/MathTest/zMatrixTest.cpp | C++ | gpl3 | 9,101 |
#include <UnitTest++.h>
#include <vector>
#include <Math/Vector2.hpp>
#include <Math/Vector3.hpp>
#include <Graphics/GeometryHelper.hpp>
#include <Graphics/Quaternion.hpp>
using namespace zzz;
using namespace std;
SUITE(GeometryHelperTest)
{
TEST(PolygonToTriangles)
{
// 101 |-|
// 1 ... | zzz-engine | EngineTest/MathTest/GeometryHelperTest.cpp | C++ | gpl3 | 3,841 |
#include <UnitTest++.h>
#include <3rdParty/AlglibPolyfit.hpp>
#ifdef ZZZ_LIB_ALGLIB
#include <Utility/StringTools.hpp>
#include <Math/Vector4.hpp>
using namespace zzz;
TEST(AlglibPolyFitTest)
{
vector<float> x,y;
FromString("0 0.1000 0.2000 0.3000 0.4000 0.5000 0.6000 0.7000 0.8000 0.9000 1.0000 1.1000 1.2... | zzz-engine | EngineTest/MathTest/AlglibPolyFitTest.cpp | C++ | gpl3 | 1,100 |
#include <UnitTest++.h>
#include <yaml-cpp/yaml.h>
#include <common.hpp>
#include <Math/Vector3.hpp>
using namespace std;
using namespace zzz;
SUITE(YamlTest) {
const string file_content = ""
"- name: Ogre\n"
" position:\n"
" - 0\n"
" - 5\n"
" - 0\n"
" powers:\n"
" - name: Club\n... | zzz-engine | EngineTest/MathTest/YamlTest.cpp | C++ | gpl3 | 2,845 |
#include <Utility/STLVector.hpp>
#include <Utility/STLString.hpp>
#include <UnitTest++.h>
using namespace zzz;
SUITE(STLHelperTest)
{
TEST(STLVectorTest)
{
// constructor
STLVector<int> x, x1;
STLVector<int> y(10);
STLVector<int> z(5,1);
std::vector<int> wv;
for (int i=0; i<10... | zzz-engine | EngineTest/MathTest/STLHelperTest.cpp | C++ | gpl3 | 2,883 |
#include <UnitTest++.h>
#include <Math/Vector.hpp>
#include <Math/Array1.hpp>
#include <Math/Array2.hpp>
#include <Math/Random.hpp>
using namespace zzz;
SUITE(ArrayTest)
{
TEST(Constructor)
{
Vector<2,zuint> sizes(2,2);
Array<2,float> x(2,2);
}
TEST(InterpolateTest2)
{
RandomReal<double> r;
... | zzz-engine | EngineTest/MathTest/ArrayTest.cpp | C++ | gpl3 | 1,510 |
#include <Math/Array2.hpp>
#include <3rdparty/FFTW3Wrapper.hpp>
#include <UnitTest++.h>
#include <Math/Random.hpp>
#include <vector>
using namespace zzz;
#ifdef ZZZ_LIB_FFTW
SUITE(FFTWTest)
{
TEST(2DFFTWTest)
{
RandomReal<double> r;
Array<2,double> v(4,6),v2;
for (zuint i=0; i<v.size(); i... | zzz-engine | EngineTest/MathTest/FFTWTest.cpp | C++ | gpl3 | 894 |
#include <UnitTest++.h>
#include <Graphics/Quaternion.hpp>
#include <Math/Random.hpp>
#include <Math/Vector3.hpp>
#include <Graphics/Rotation.hpp>
using namespace zzz;
SUITE(QuaternionTest)
{
TEST(MultiplyTest)
{
RandomReal<float> r;
r.SeedFromTime();
Vector3f v(r.Rand(), r.Rand(), r.Rand(... | zzz-engine | EngineTest/MathTest/QuaternionTest.cpp | C++ | gpl3 | 1,956 |
#define ZOPTIMIZE_ABS
#define ZOPTIMIZE_SIGN
#define ZOPTIMIZE_MINMAX
#define ZOPTIMIZE_SETCLEARBIT
#include <UnitTest++.h>
#include <Math/Math.hpp>
#include <Utility/Tools.hpp>
using namespace zzz;
SUITE(MathOptTest)
{
TEST(AbsOptIntTest)
{
int x=0;
CHECK_EQUAL(std::abs(x),Abs(x));
CH... | zzz-engine | EngineTest/MathTest/MathOptTest.cpp | C++ | gpl3 | 3,212 |
#include <Math/Vector2.hpp>
#include <Math/Vector3.hpp>
#include <Math/Vector4.hpp>
#include <Math/Math.hpp>
#include <UnitTest++.h>
namespace zzz{
struct ClassA{
int x;
void operator =(const ClassA &other) {x=other.x+1;}
};
template<>
class IOObject<ClassA> {
public:
static void Co... | zzz-engine | EngineTest/MathTest/VectorTest.cpp | C++ | gpl3 | 3,064 |
#include <UnitTest++.h>
#include <Math/IterExitCond.hpp>
using namespace zzz;
SUITE(IterExitCondTest)
{
TEST(ResidueTest)
{
IterExitCond<double> cond;
cond.SetCondResidue(0.1);
CHECK(!cond.IsSatisfied(10));
CHECK(!cond.IsSatisfied(-5));
CHECK(!cond.IsSatisfied(1));
CHECK(!cond.... | zzz-engine | EngineTest/MathTest/IterExitCondTest.cpp | C++ | gpl3 | 1,162 |
#include <UnitTest++.h>
#include <Utility/AutoloadCacheSet.hpp>
#include <vector>
using namespace zzz;
using namespace std;
SUITE(CacheSetTest)
{
struct Content
{
Content(int i):x(i){construct_seq.push_back(i);}
~Content(){destruct_seq.push_back(x);}
int x;
static vector<int> constru... | zzz-engine | EngineTest/MathTest/CacheSetTest.cpp | C++ | gpl3 | 1,105 |
#include <UnitTest++.h>
#include <Utility/FileTools.hpp>
using namespace std;
using namespace zzz;
SUITE(PathTest)
{
#ifdef ZZZ_OS_WIN
TEST(PathTest)
{
string p="c:\\wzx\\sub\\..\\abcd.txt";
CHECK_EQUAL("abcd.txt",GetFilename(p));
CHECK_EQUAL(".txt",GetExt(p));
CHECK_EQUAL("abcd",Get... | zzz-engine | EngineTest/MathTest/PathTest.cpp | C++ | gpl3 | 1,898 |
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(zzzEngineBuild)
SET(EXECUTABLE_OUTPUT_PATH, bin)
SET(LIBRARY_OUTPUT_PATH, lib)
ADD_SUBDIRECTORY(zCore)
ADD_SUBDIRECTORY(zGraphics)
ADD_SUBDIRECTORY(zVision)
ADD_SUBDIRECTORY(zMatrix)
ADD_SUBDIRECTORY(zImage)
ADD_SUBDIRECTORY(zVisualization)
#ADD_SUBDIRECTORY(zAi... | zzz-engine | zzzEngine/CMakeLists.txt | CMake | gpl3 | 323 |
SET(THISLIB zAi)
FILE(GLOB_RECURSE LibSrc *.cpp)
IF( "${DEBUG_MODE}" EQUAL "1")
SET(THISLIB ${THISLIB}D)
ENDIF()
IF( "${BIT_MODE}" EQUAL "64" )
SET(THISLIB ${THISLIB}_X64)
ENDIF()
ADD_LIBRARY(${THISLIB} STATIC ${LibSrc})
| zzz-engine | zzzEngine/zAI/CMakeLists.txt | CMake | gpl3 | 232 |
#pragma once
namespace zzz{
template<typename T>
struct RTreeFunction
{
typedef RTreeFunction<T> *(*RTreeFuncGenerator)(void*);
virtual int operator()(const T *v)=0;
virtual void print()=0;
};
#define MAX_LEVEL 12
#define MIN_NELEMENT 1
} | zzz-engine | zzzEngine/zAI/zAI/RTree/RTreeFunction.hpp | C++ | gpl3 | 263 |
#pragma once
#include "../common.hpp"
#include "RTreeFunction.hpp"
namespace zzz{
template <typename T>
struct RTreeNodeBase
{
typedef enum{NODE,LEAF} NODETYPE;
const NODETYPE type_;
RTreeNodeBase(const int level,NODETYPE type, typename RTreeFunction<T>::RTreeFuncGenerator funcgen)
:level_(level... | zzz-engine | zzzEngine/zAI/zAI/RTree/RTreeNodeLeaf.hpp | C++ | gpl3 | 5,915 |
#pragma once
#include "RTreeNodeLeaf.hpp"
namespace zzz{
//Randomized Tree
//To classify T
template <typename T,int RTREE_NODE_SPLIT=2>
class RTree
{
public:
RTree(typename RTreeFunction<T>::RTreeFuncGenerator funcgen):ntag_(0),funcgen_(funcgen)
{
head_=new RTreeLeaf<T,RTREE_NODE_SPLIT>(0,0,funcg... | zzz-engine | zzzEngine/zAI/zAI/RTree/RTree.hpp | C++ | gpl3 | 3,412 |
#pragma once
#include <zCoreConfig.hpp>
#ifdef ZZZ_DEBUG
#pragma comment(lib,"zAID.lib")
#else
#pragma comment(lib,"zAI.lib")
#endif | zzz-engine | zzzEngine/zAI/zAI/zAI.hpp | C++ | gpl3 | 138 |
#pragma once
#include "SupervisedDimensionReduction.hpp"
namespace zzz {
template<zuint N, typename T>
class LDA : public SupervisedDimensionReduction<N,T>
{
public:
template<zuint N2>
void DimensionReduce(const vector<Vector<N,T> > &data, vector<Vector<N2,T> > &newdata)
{
newdata.clear();
... | zzz-engine | zzzEngine/zAI/zAI/LDA.hpp | C++ | gpl3 | 1,550 |
#pragma once
namespace zzz {
template<zuint N, typename T>
class SupervisedDimensionReduction
{
public:
void Train(const zMatrixBaseR<double> &data, const vector<int> &label) {
// normalize label, make them 0, 1, 2,...
label_count_=0;
for (zuint i=0; i<label; i++) {
if (labelmap_.find(la... | zzz-engine | zzzEngine/zAI/zAI/SupervisedDimensionReduction.hpp | C++ | gpl3 | 1,236 |
SET(THISLIB zMatrix)
FILE(GLOB_RECURSE LibSrc *.cpp)
#MESSAGE(STATUS "files ${LibSrc}")
IF( "${DEBUG_MODE}" EQUAL "1")
SET(THISLIB ${THISLIB}D)
ENDIF()
IF( "${BIT_MODE}" EQUAL "64" )
SET(THISLIB ${THISLIB}_X64)
ENDIF()
ADD_LIBRARY(${THISLIB} STATIC ${LibSrc})
| zzz-engine | zzzEngine/zMatrix/CMakeLists.txt | CMake | gpl3 | 272 |
#pragma once
#include "zMatrixBase.hpp"
//for mat1+mat2, two matricies
namespace zzz{
#define MATRIX_EXPRESSION(name,ope) \
template<typename T,class Major>\
class zMatrix##name##Expression : public zMatrixBaseR<T,Major>\
{\
public:\
explicit zMatrix##name##Expression(const zMatrixBaseR<T,Major> &mat1, c... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionM.hpp | C++ | gpl3 | 4,002 |
#pragma once
#include "zMatrixBase.hpp"
namespace zzz{
//func(v,mat)
#define CONSTANT_LEFT_EXPRESSIONC(name,func) \
template<typename T,class Major>\
class zFunctionLeft##name##ExpressionC : public zMatrixBaseR<T,Major>\
{\
public:\
explicit zFunctionLeft##name##ExpressionC(const T &v, const zMatrixBaseR<T... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionFunctionC.hpp | C++ | gpl3 | 1,712 |
#pragma once
#include <Math/Complex.hpp>
#include "zMatrixBase.hpp"
namespace zzz{
//specific for complex
#define COMPLEX_EXPRESSION(name,ope) \
template<typename T,class Major>\
class zComplex##name##Expression : public zMatrixBaseR<Complex<T>,Major>\
{\
public:\
explicit zComplex##name##Expression(const... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionComplex.hpp | C++ | gpl3 | 1,998 |
#pragma once
#include "zMatrixBase.hpp"
namespace zzz{
//func(mat,mat)
#define CONSTANT_EXPRESSIONM(name,func) \
template<typename T,class Major>\
class zFunction##name##ExpressionM : public zMatrixBaseR<T,Major>\
{\
public:\
explicit zFunction##name##ExpressionM(const zMatrixBaseR<T,Major>& mat1, const zM... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionFunctionM.hpp | C++ | gpl3 | 977 |
#pragma once
#include <Utility/Log.hpp>
//for base class of all zMatrix classes
//can choose row major or column major, column major is default
//#include "zSubMatrix.hpp"
namespace zzz{
class EndlessArray;
template<typename T, class Major>
class zSubMatrixR;
template<typename T, class Major>
class zSub... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixBase.hpp | C++ | gpl3 | 6,495 |
#pragma once
#include "zMatrix.hpp"
//just a special derivation of zmatrix(1,n) or zmatrix(n,1), column major is default
namespace zzz{
template<typename T, typename Major=zColMajor>
class zVector : public zMatrix<T,Major>
{
public:
//constructor
explicit zVector(){}
explicit zVector(zuint l):zMatrix<... | zzz-engine | zzzEngine/zMatrix/zMatrix/zVector.hpp | C++ | gpl3 | 1,624 |
#pragma once
namespace zzz{
/////////////////////////////////////////////////
//GradientX
template<typename T,class Major>
class zSpecialGradxExpression : public zMatrixBaseR<T,Major>
{
using zMatrixBaseR<T,Major>::rows_;
using zMatrixBaseR<T,Major>::cols_;
public:
explicit zSpecialGradxExpression(con... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionSpecial.hpp | C++ | gpl3 | 2,479 |
#pragma once
#include <LibraryConfig.hpp>
//use lapack to do high level math
#include "zMatrix.hpp"
namespace zzz{
bool LUFactorization(zMatrix<double,zColMajor> &mat, zMatrix<long,zColMajor> &IPIV, long *info=NULL);
bool CholeskyFactorization(zMatrix<double,zColMajor> &A, long *info=NULL);
// ATTENTIO... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixLapack.hpp | C++ | gpl3 | 1,577 |
#pragma once
#include "zMatrixBase.hpp"
namespace zzz{
template<typename T,class Major>
class HCombineMatrixR : public zMatrixBaseR<T,Major>
{
public:
explicit HCombineMatrixR(const zMatrixBaseR<T,Major> &mat1, const zMatrixBaseR<T,Major> &mat2)
:mat1_(mat1),mat2_(mat2),zMatrixBaseR<T,Major>(mat1.rows... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixCombine.hpp | C++ | gpl3 | 1,553 |
#pragma once
#include "zMatrixBase.hpp"
//for mat+v or v+mat, one matrix and one scalar
namespace zzz{
///////////////////////////////////////////////////
//Left
#define CONSTANT_LEFT_EXPRESSION(name,ope) \
template<typename T, class Major>\
class zConstantLeft##name##Expression : public zMatrixBaseR<T,Majo... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionC.hpp | C++ | gpl3 | 2,390 |
#pragma once
#include "zMatrixBase.hpp"
// for Reshape(mat,row,col)
namespace zzz{
template<typename T,class Major>
class zFunctionReshapeR : public zMatrixBaseR<T,Major>
{
public:
explicit zFunctionReshapeR(const zMatrixBaseR<T,Major>& mat, zuint row, zuint col)
:zMatrixBaseR<T,Major>(row,col),Mat_(ma... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixReshape.hpp | C++ | gpl3 | 1,695 |
#pragma once
#include "zMatrixBase.hpp"
//for f(mat)
namespace zzz{
#define CONSTANT_EXPRESSION(name,ope) \
template<typename T,class Major>\
class zFunction##name##Expression : public zMatrixBaseR<T,Major>\
{\
public:\
explicit zFunction##name##Expression(const zMatrixBaseR<T,Major>& mat)\
:zMatrixBa... | zzz-engine | zzzEngine/zMatrix/zMatrix/zExpressionFunction.hpp | C++ | gpl3 | 1,413 |
#pragma once
// Since there are many inter-reference inside these files,
// it is better to include this file when use zMatrix.
#include "zMatrixBase.hpp"
#include "zSubMatrix.hpp"
#include "zMatrix.hpp"
#include "zExpressionFunctionC.hpp"
#include "zExpressionFunctionM.hpp"
#include "zExpressionC.hpp"
#... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMat.hpp | C++ | gpl3 | 1,489 |
#pragma once
#include "zMatrixBase.hpp"
//for constant matrix like ones and zeros
namespace zzz{
template<typename T,class Major>
class zConstantMatrix : public zMatrixBaseR<T,Major> //should not matter if rowmajor or colmajor
{
public:
//constructor
zConstantMatrix(zuint r, zuint c, T v):zMatrixBaseR... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixConstant.hpp | C++ | gpl3 | 2,281 |
#pragma once
//some tools for matrix
#include "zMatrix.hpp"
namespace zzz{
template<typename T,class Major>
const zMatrix<T,zColMajor> Temp(const zMatrixBaseR<T,Major> &mat)
{
zMatrix<T,zColMajor> v(mat);
return v;
}
template<typename T,class Major>
class zTransMatrix : public zMatrixBaseR<T,Major>... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixOperation.hpp | C++ | gpl3 | 1,302 |
#pragma once
#include "zMatrixBase.hpp"
#include "zMatrix.hpp"
#include <Math/Vector.hpp>
#include <Math/Matrix.hpp>
namespace zzz{
//////////////////////////////////////////////////////////////////////////
//Vector Dress
template<typename T, unsigned int N,typename Major>
class zMatrixVectorDressR : public ... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixDress.hpp | C++ | gpl3 | 13,554 |
#pragma once
#include "zMatrixBase.hpp"
#include <Math/Array2.hpp>
//matrix and operator + -
namespace zzz{
template<typename T, typename Major=zColMajor>
class zMatrix : public zMatrixBaseW<T,Major>
{
using zMatrixBaseW<T,Major>::ToIndex;
using zMatrixBaseW<T,Major>::rows_;
using zMatrixBaseW<T,Maj... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrix.hpp | C++ | gpl3 | 2,896 |
#pragma once
#include <Math/Random.hpp>
#include <zMatrix.hpp>
namespace zzz
{
zMatrix<double, zColMajor> Rand(zuint row, zuint col);
template<typename T, typename zMajor, typename T1>
T Interpolate(const zMatrixBaseR<T,zMajor> &mat, T1 r, T1 c) {
double row(r), col(c);
// do the interpolation
zuint... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixFunction.hpp | C++ | gpl3 | 893 |
#pragma once
#include "zMatrixBase.hpp"
#include "zMatrix.hpp"
#include <Math/Vector.hpp>
#include <Math/Matrix.hpp>
namespace zzz{
//////////////////////////////////////////////
//Dress to cast value
template<typename TO, typename FROM, class Major>
class zMatrixCastR : public zMatrixBaseR<TO,Major>
{
pub... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixCast.hpp | C++ | gpl3 | 843 |
#include "zMatrixLapack.hpp"
#include "zMatrixConstant.hpp"
//use lapack to do high level math
#include <3rdParty/BlasLapack.hpp>
#include <Math/Math.hpp>
namespace zzz{
#ifdef ZZZ_LIB_LAPACK
bool LUFactorization(zMatrix<double,zColMajor> &mat, zMatrix<integer,zColMajor> &IPIV, integer *info)
{
/*
* ... | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixLapack.cpp | C++ | gpl3 | 33,496 |
#pragma once
#include <Math\Vector2.hpp>
//sub matrix support, works like matlab
namespace zzz{
template<typename T,class Major>
class zMatrixBaseR;
class EndlessArray
{
public:
explicit EndlessArray(int begin):begin_(begin){}
int begin_;
};
inline const EndlessArray Colon(int begin=0)
{
retur... | zzz-engine | zzzEngine/zMatrix/zMatrix/zSubMatrix.hpp | C++ | gpl3 | 11,301 |
#pragma once
#include <vector>
#include "zMatrixBase.hpp"
// Sparse Matrix, still lack of operation
namespace zzz {
// It should no be derived from zMatrixBaseW,
// since we don't want it to be writable as general zMatrixBaseW.
// Although it can, any operation will destroy the sparsity.
template<typename ... | zzz-engine | zzzEngine/zMatrix/zMatrix/zSparseMatrix.hpp | C++ | gpl3 | 7,383 |
#include <zMatrixFunction.hpp>
#include <zCoreAutoLink.hpp>
namespace zzz {
zMatrix<double, zColMajor> Rand(zuint row, zuint col)
{
RandomReal<double> r(0.0, 1.0);
zMatrix<double, zColMajor> mat(row, col);
for (zuint i=0; i<mat.size(); i++)
mat[i]=r.Rand();
return mat;
}
}; // namespace zzz | zzz-engine | zzzEngine/zMatrix/zMatrix/zMatrixFunction.cpp | C++ | gpl3 | 317 |
SET(THISLIB zGraphics)
FILE(GLOB_RECURSE LibSrc *.cpp)
FILE(GLOB_RECURSE RemoveSrc zScriptRenderer.cpp)
FILE(GLOB_RECURSE RemoveSrc1 z*.cpp)
FILE(GLOB_RECURSE RemoveSrc2 *Script.cpp)
LIST(REMOVE_ITEM LibSrc ${RemoveSrc})
LIST(REMOVE_ITEM LibSrc ${RemoveSrc1})
LIST(REMOVE_ITEM LibSrc ${RemoveSrc2})
#MESSAGE(STAT... | zzz-engine | zzzEngine/zGraphics/CMakeLists.txt | CMake | gpl3 | 528 |
#pragma once
#include <EnvDetect.hpp>
#include <LibraryConfig.hpp>
#ifdef ZZZ_LIB_MINIMAL
#include "zGraphicsConfig.hpp.minimal"
#else
#ifdef ZZZ_OS_WIN32
#include "zGraphicsConfig.hpp.win32"
#endif
#ifdef ZZZ_OS_WIN64
#include "zGraphicsConfig.hpp.win64"
#endif
#ifdef ZZZ_OS_MINGW
#include "zG... | zzz-engine | zzzEngine/zGraphics/zGraphics/zGraphicsConfig.hpp | C++ | gpl3 | 790 |
#pragma once
// Separate link so when change a lib, only link needs redo.
#include "zGraphicsConfig.hpp"
#include "zGraphicsAutoLink3rdParty.hpp"
#ifndef ZZZ_NO_PRAGMA_LIB
#ifdef ZZZ_COMPILER_MSVC
#ifdef ZZZ_DYNAMIC
#ifdef ZZZ_DEBUG
#ifndef ZZZ_OS_WIN64
#pragma comment(lib,"zGraphicsdllD.li... | zzz-engine | zzzEngine/zGraphics/zGraphics/zGraphicsAutoLink.hpp | C++ | gpl3 | 1,031 |
#pragma once
// Separate link so when change a lib, only link needs redo.
#include "zGraphicsConfig.hpp"
#ifndef ZZZ_NO_PRAGMA_LIB
#ifdef ZZZ_COMPILER_MSVC
// GLEW will be built along with the engine
#ifdef ZZZ_DEBUG
#ifndef ZZZ_OS_WIN64
#pragma comment(lib,"GlewD.lib")
#else
#pragma comme... | zzz-engine | zzzEngine/zGraphics/zGraphics/zGraphicsAutoLink3rdParty.hpp | C++ | gpl3 | 2,271 |
#include "ArcBallRenderer.hpp"
namespace zzz {
ArcBallRenderer::ArcBallRenderer()
{
pCurObjArcBall_=NULL;
pCurEnvArcBall_=NULL;
lockArcBall_=false;
}
ArcBallRenderer::~ArcBallRenderer()
{
}
} | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/ArcBallRenderer.cpp | C++ | gpl3 | 216 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "ArcBallRenderer.hpp"
#include "../Graphics/ArcBall.hpp"
namespace zzz {
class ZGRAPHICS_CLASS OneObjRenderer : public ArcBallRenderer
{
public:
OneObjRenderer();
void ResetArcball();
ArcBallGUI objArcBall_;
protected:
void CreateMsg();
void AfterOnSize(... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/OneObjRenderer.hpp | C++ | gpl3 | 643 |
#include "OneObjEnvRenderer.hpp"
namespace zzz {
void OneObjEnvRenderer::AfterOnSize(unsigned int nType, int cx, int cy)
{
camera_.OnSize(nType, cx, cy);
objArcBall_.OnSize(nType, cx, cy);
envArcBall_.OnSize(nType, cx, cy);
}
void OneObjEnvRenderer::DrawObj()
{
glColor3f(1.0,1.0,1.0);
glBegin(G... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/OneObjEnvRenderer.cpp | C++ | gpl3 | 2,006 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Renderer.hpp"
#include "../Graphics/Camera.hpp"
#include <Math/Vector2.hpp>
#include "../GraphicsGUI/MovingCameraGUI.hpp"
namespace zzz{
class ZGRAPHICS_CLASS CameraRenderer : public Renderer
{
public:
CameraRenderer();
void DrawObj();
void Set... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/CameraRenderer.hpp | C++ | gpl3 | 704 |
#pragma once
#include "Vis2DRenderer.hpp"
#include <Image/Image.hpp>
#include <Math/Vector2.hpp>
namespace zzz{
/// To manipulate A SINGLE image
/// some functions are overriden to satisfy the relative to image originate
template<typename T>
class OneImageRenderer : public Vis2DRenderer, public GraphicsHelper... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/OneImageRenderer.hpp | C++ | gpl3 | 973 |
#pragma once
#include <zGraphicsConfig.hpp>
#include <Math/Vector2.hpp>
#include "../Graphics/Coordinate.hpp"
#include "../Resource/Mesh/Mesh.hpp"
#include "../Resource/Texture/TextureSpecify.hpp"
#include "../Resource/Shader/ShaderSpecify.hpp"
#include "../FBO/FBO.hpp"
#include "../FBO/RenderBuffer.hpp"
#incl... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/ControlRenderer.hpp | C++ | gpl3 | 1,612 |
#include "Vis2DRenderer.hpp"
namespace zzz{
zzz::Vis2DRenderer::Vis2DRenderer()
{
posx_=0;posy_=0;
zoomratio_=1;
showMsg_=false;
allowmove_=true;
allowzoom_=true;
middleButton_ = false;
}
void Vis2DRenderer::OnMouseMove(unsigned int nFlags,int x,int y)
{
if(allowmove_ && middleButton_)
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/Vis2DRenderer.cpp | C++ | gpl3 | 2,846 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "../FBO/FBO.hpp"
#include "../FBO/RenderBuffer.hpp"
#include <common.hpp>
#include "../Resource/Texture/TextureSpecify.hpp"
#include "../Resource/Mesh/Mesh.hpp"
#include "../Resource/Shader/Shader.hpp"
#include <Utility/Singleton.hpp>
#ifdef ZZZ_LIB_BOOST
#... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/RendererHelper.hpp | C++ | gpl3 | 1,261 |
#include "OneObjRenderer.hpp"
#include <Utility\StringPrintf.hpp>
namespace zzz {
OneObjRenderer::OneObjRenderer()
{
pCurObjArcBall_=&objArcBall_;
pCurEnvArcBall_=NULL;
}
void OneObjRenderer::AfterOnSize(unsigned int nType, int cx, int cy)
{
camera_.OnSize(nType, cx, cy);
objArcBall_.OnSize(nType... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/OneObjRenderer.cpp | C++ | gpl3 | 1,581 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "ArcBallRenderer.hpp"
namespace zzz {
class ZGRAPHICS_CLASS MultiObjEnvRenderer : public ArcBallRenderer
{
public:
MultiObjEnvRenderer();
void ResetArcball();
int curObjArcBall_;
bool allArcBall_;
ArcBallGUI objArcBall_[10]; //arcball for object ro... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/MultiObjEnvRenderer.hpp | C++ | gpl3 | 1,014 |
#pragma once
#include <zGraphicsConfig.hpp>
#include <common.hpp>
#include "../GraphicsGUI/ArcBallGUI.hpp"
#include "Renderer.hpp"
namespace zzz {
class ZGRAPHICS_CLASS ArcBallRenderer : public Renderer
{
public:
ArcBallRenderer();
virtual ~ArcBallRenderer();
ArcBallGUI *pCurObjArcBall_,*pCurEnvArc... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/ArcBallRenderer.hpp | C++ | gpl3 | 361 |
#include "RendererHelper.hpp"
#include "../Graphics/OpenGLTools.hpp"
#include <Utility/Timer.hpp>
#ifdef ZZZ_LIB_BOOST
namespace zzz{
RendererHelper::RendererHelper()
:zNear(0.1), zFar(1000), depthbuffer(GL_DEPTH_COMPONENT)
{
}
RendererHelper::~RendererHelper()
{
}
void RendererHelper::RenderCubemap(T... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/RendererHelper.cpp | C++ | gpl3 | 11,406 |
#include "MultiObjEnvRenderer.hpp"
#include "../Graphics\ColorDefine.hpp"
#include <Utility/StringPrintf.hpp>
namespace zzz {
void MultiObjEnvRenderer::DrawObj()
{
ColorDefine::white.ApplyGL();
glBegin(GL_QUADS);
glVertex3d(-1,-1,0);
glVertex3d(1,-1,0);
glVertex3d(1,1,0);
glVertex3d(-1,1,0);
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/MultiObjEnvRenderer.cpp | C++ | gpl3 | 5,134 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Renderer.hpp"
namespace zzz{
class ZGRAPHICS_CLASS SwitchRenderer : public Renderer
{
public:
SwitchRenderer(void);
~SwitchRenderer(void);
bool AddRenderer(Renderer *, const int idx);
bool SwitchTo(const int idx);
virtual void SetContext(C... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/SwitchRenderer.hpp | C++ | gpl3 | 1,415 |
#include "zScriptRenderer.hpp"
namespace zzz{
zScriptRenderer::zScriptRenderer()
:loaded(false)
{
}
void zScriptRenderer::LoadRenderScript( const char *filename )
{
loaded=m_zRS.LoadScript(filename);
m_zRS.SetVariable("i_width",width_);
m_zRS.SetVariable("i_height",height_);
m_zRS.SetVariable("i_... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/zScriptRenderer.cpp | C++ | gpl3 | 1,366 |
#include "CameraRenderer.hpp"
#include "../Context/Context.hpp"
#include "../Graphics/ColorDefine.hpp"
namespace zzz{
CameraRenderer::CameraRenderer()
{
}
void CameraRenderer::AfterOnSize(unsigned int nType, int cx, int cy)
{
camera_.OnSize(nType, cx, cy);
}
void CameraRenderer::SetupCamera()
{
c... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/CameraRenderer.cpp | C++ | gpl3 | 1,935 |
#include "ControlRenderer.hpp"
#include "../Resource/Mesh/MeshIO/MeshIO.hpp"
namespace zzz
{
bool ControlRenderer::Draw()
{
if (mesh_)
{
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
camera_.ApplyGL();
objArcBall_.ApplyGL();
if (showObj_)
{
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/ControlRenderer.cpp | C++ | gpl3 | 10,971 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "ArcBallRenderer.hpp"
namespace zzz {
class ZGRAPHICS_CLASS OneObjEnvRenderer : public ArcBallRenderer
{
public:
OneObjEnvRenderer();
void ResetArcball();
int curObjArcBall_;
bool allArcBall_;
ArcBallGUI objArcBall_; //arcball for object rotation... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/OneObjEnvRenderer.hpp | C++ | gpl3 | 981 |
#pragma once
#include "MultiObjEnvRenderer.hpp"
#include "../zRenderScript/zRenderScript.hpp"
namespace zzz{
class zScriptRenderer : public MultiObjEnvRenderer
{
public:
zScriptRenderer();
void LoadRenderScript(const char *filename);
void SingleCommand(const string &str);
virtual void OnMouseWheel... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/zScriptRenderer.hpp | C++ | gpl3 | 639 |
#include "Renderer.hpp"
#include "../Context/Context.hpp"
#include "../Resource/Shader/ShaderSpecify.hpp"
#include "../Resource/Texture/Texture.hpp"
#include <Utility/Timer.hpp>
#include <common.hpp>
#include <Math/Vector4.hpp>
#include "../Graphics/BMPFont.hpp"
#include "../Graphics/ColorDefine.hpp"
#include ... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/Renderer.cpp | C++ | gpl3 | 5,556 |
#include "SwitchRenderer.hpp"
#include <Utility/Tools.hpp>
namespace zzz{
#define STATUS_NEED_RESIZE (1)
SwitchRenderer::SwitchRenderer(void)
:currenderer_(NULL)
{
}
SwitchRenderer::~SwitchRenderer(void)
{
}
bool SwitchRenderer::AddRenderer(Renderer *renderer, const int idx)
{
for (zuint i=0; i<r... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/SwitchRenderer.cpp | C++ | gpl3 | 3,716 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "../Graphics/OpenGLTools.hpp"
#include "../GraphicsGUI/CameraGUI.hpp"
#include "../Context/Context.hpp"
#include "../Graphics/Color.hpp"
#include "../Resource/ResourceManager.hpp"
namespace zzz
{
class Context;
class ZGRAPHICS_CLASS Renderer : public Unco... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/Renderer.hpp | C++ | gpl3 | 3,276 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Renderer.hpp"
#include "../Graphics/GraphicsHelper.hpp"
#include <Utility/Timer.hpp>
//For showing images
//no projective matrix
//no zooming
//middle mouse button to move around
namespace zzz
{
class ZGRAPHICS_CLASS Vis2DRenderer : public Renderer
{... | zzz-engine | zzzEngine/zGraphics/zGraphics/Renderer/Vis2DRenderer.hpp | C++ | gpl3 | 1,706 |
#include "ResourceManager.hpp"
#include "Texture/Texture2D.hpp"
#include "Shader/Shader.hpp"
#include "Mesh/Material.hpp"
#include <Utility/StringTools.hpp>
#include <Utility/FileTools.hpp>
namespace zzz{
ResourceManager __default_RM;
bool ResourceManager::Add(Texture2D *tex, const string &name, bool cover)
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/ResourceManager.cpp | C++ | gpl3 | 953 |
#pragma once
#include <zGraphicsConfig.hpp>
#include <Image/Image.hpp>
#include "Texture.hpp"
#include <Utility/Tools.hpp>
#include "../../Graphics/Coordinate.hpp"
namespace zzz{
class ZGRAPHICS_CLASS TextureCube : public Texture
{
public:
TextureCube(int newiformat=GL_RGB);
TextureCube(zuint32 size, i... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/TextureCube.hpp | C++ | gpl3 | 4,236 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Texture.hpp"
namespace zzz {
class ZGRAPHICS_CLASS Texture1D : public Texture
{
public:
Texture1D(int newiformat=GL_RGB);
Texture1D(zuint width, int newiformat);
void Create(zuint width);
bool Bind(GLenum bindto=GL_TEXTURE0);
template<typename... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture1D.hpp | C++ | gpl3 | 633 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Texture.hpp"
#include "../../Graphics/OpenGLTools.hpp"
#include <Image/Image.hpp>
#include <Utility/IOObject.hpp>
namespace zzz {
class ZGRAPHICS_CLASS Texture2D : public Texture
{
public:
Texture2D(int iformat=GL_RGB);
Texture2D(zuint width, zuint ... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture2D.hpp | C++ | gpl3 | 2,995 |
#include "TextureCube.hpp"
#include <Math/Math.hpp>
#include <Utility/StringTools.hpp>
#include <Utility/FileTools.hpp>
namespace zzz{
TextureCube::TextureCube(int newiformat)
:Texture(GL_TEXTURE_CUBE_MAP, newiformat)
{}
TextureCube::TextureCube(zuint32 size, int newiformat)
:Texture(GL_TEXTURE_CUBE_MAP,... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/TextureCube.cpp | C++ | gpl3 | 10,703 |
#include "Texture2D.hpp"
#include <Utility/Tools.hpp>
#include "../../FBO/FBO.hpp"
namespace zzz{
//you cannot gen texture in constructor
//since it might construct before opengl is initialized
Texture2D::Texture2D(int newiformat)
:Texture(GL_TEXTURE_2D, newiformat), width_(0), height_(0)
{}
Texture2D::Tex... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture2D.cpp | C++ | gpl3 | 4,169 |
#include "Texture1D.hpp"
#include <Utility/Tools.hpp>
#include <Math/Vector4.hpp>
#include <Math/Vector3.hpp>
namespace zzz{
Texture1D::Texture1D(int newiformat)
:Texture(GL_TEXTURE_1D, newiformat), width_(0)
{}
Texture1D::Texture1D(zuint width, int newiformat)
:Texture(GL_TEXTURE_1D, newiformat)
{}
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture1D.cpp | C++ | gpl3 | 2,223 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Texture2D.hpp"
#include <ImageIO\ILImage.hpp>
namespace zzz {
template<>
class IOObject<Texture2D>
{
public:
static void WriteFileB(FILE *fp, const Texture2D &src) {
IOObj::WriteFileB(fp, src.GetInternalFormat());
IOObj::WriteFileB(fp, src.Get... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture2DIOObject.hpp | C++ | gpl3 | 3,488 |
#include "Texture.hpp"
namespace zzz{
bool zzz::Texture::Disable(GLenum level)
{
int lastLevel;
CHECK_GL_ERROR()
glGetIntegerv(GL_ACTIVE_TEXTURE,&lastLevel);
CHECK_GL_ERROR()
glActiveTexture(level);
CHECK_GL_ERROR()
glDisable(GL_TEXTURE_1D);
CHECK_GL_ERROR()
glDisable(GL_TEXTURE_2D);
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture.cpp | C++ | gpl3 | 2,159 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "Texture2D.hpp"
#include "TextureCube.hpp"
namespace zzz{
#define TEXTURE2D_SPECIFY(classname,iformat) \
class classname : public Texture2D\
{\
public:\
classname():Texture2D(iformat){;}\
classname(const string & filename):Texture2D(filename,iformat... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/TextureSpecify.hpp | C++ | gpl3 | 1,232 |
#pragma once
#include <zGraphicsConfig.hpp>
#include <common.hpp>
#include "../../Graphics/Graphics.hpp"
#include "../../Graphics/OpenGLTools.hpp"
#include <Utility/Uncopyable.hpp>
namespace zzz{
class ZGRAPHICS_CLASS Texture : public Uncopyable
{
public:
Texture(GLenum tex_target, GLenum internalFormat);... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Texture/Texture.hpp | C++ | gpl3 | 1,025 |
#pragma once
#include <zGraphicsConfig.hpp>
#include "../../Graphics/Graphics.hpp"
namespace zzz{
class ZGRAPHICS_CLASS Light {
public:
Light();
void Enable(GLenum l=0);
void Disable();
void DrawLine();
void Rotate(const GLfloat *rotmat);
static void Disable(GLenum l);
static void DisableAll();
GLenum... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Light/Light.hpp | C++ | gpl3 | 405 |
#include "Light.hpp"
#include <Utility/Tools.hpp>
namespace zzz{
Light::Light()
{
mylight_=0;
pos_[0]=0; pos_[1]=0; pos_[2]=0; pos_[3]=0;
amb_[0]=0; amb_[1]=0; amb_[2]=0; amb_[3]=0;
dif_[0]=0; dif_[1]=0; dif_[2]=0; dif_[3]=0;
spe_[0]=0; spe_[1]=0; spe_[2]=0; spe_[3]=0;
inited_=false;
}
void Light::Ena... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Light/Light.cpp | C++ | gpl3 | 1,473 |
#include "SimpleMesh.hpp"
#include "../../Graphics/Graphics.hpp"
namespace zzz{
SimpleMesh::SimpleMesh()
{}
void SimpleMesh::Clear()
{
faces_.clear();
vertices_.clear();
triangles_.clear();
normals_.clear();
texcoords_.clear();
ClrAllFlags();
}
void SimpleMesh::DrawTriangles()
{
if (... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Mesh/SimpleMesh.cpp | C++ | gpl3 | 2,648 |
#include "Mesh.hpp"
//#include "ObjMesh.hpp"
namespace zzz{
}
| zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Mesh/Mesh.cpp | C++ | gpl3 | 72 |
#pragma once
#include <zGraphicsConfig.hpp>
#include <Math/Vector3.hpp>
#include <Utility/HasFlag.hpp>
#include <Utility/STLVector.hpp>
//hold only vertex
//2 ways, face indexes vertex
//or redundant triangle
//can convert from one to another
namespace zzz{
const int SMESH_POS =0x00000001;
const int SME... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Mesh/SimpleMesh.hpp | C++ | gpl3 | 957 |
#include "Material.hpp"
#include "../../Graphics/Graphics.hpp"
#include <Utility/Tools.hpp>
#include <Resource/Texture/Texture2DIOObject.hpp>
namespace zzz{
Material::Material()
:diffuse_(0.8f,0.8f,0.8f,1.0f),
ambient_(0.7f,0.7f,0.7f,1.0f),
specular_(1.0f,1.0f,1.0f,1.0f),
emission_(0.0f,0.0f,0.0f,1.0f),
... | zzz-engine | zzzEngine/zGraphics/zGraphics/Resource/Mesh/Material.cpp | C++ | gpl3 | 1,332 |