Skip to content

Instantly share code, notes, and snippets.

View hadronized's full-sized avatar
🐺
Oublie qu’t’as aucune chance, va-y, fonce.

Dimitri Sabadie hadronized

🐺
Oublie qu’t’as aucune chance, va-y, fonce.
View GitHub Profile
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/qi_grammar.hpp>
#include <boost/spirit/include/phoenix_core.hpp>
#include <boost/spirit/include/phoenix_operator.hpp>
#include <boost/fusion/include/adapt_struct.hpp>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
# Skyoralis Static Model file
# Version 3.2
# Exported by the Blender script written by Dimitri 'Skypers' Sabadie
# Exportation date and time : 16/04/11 18:19:43
# Header
hm 3
hv 8
hi 0 12
hi 1 12
char c;
for (int r = 0; r < row; ++r) {
for (int c = 0; c < col; ++c) {
char c = (c+(r%2))%2);
case[r][c].Color = Color(c, c, c);
}
}
bool col;
for (int r = 0; r < 10; ++r) {
for (int c = 0; c < 10; ++c) {
col = (r+c)%2;
std::cout << col << ' ';
}
std::cout << std::endl;
}
template <class Format, class Dispatch>
mesh<Format, Dispatch>::mesh(std::string const &name) :
resource< mesh<Format, Dispatch> >(name),
_nbIndices(0) {
}
// after a base_type idiom ...
template <class Format, class Dispatch>
mesh<Format, Dispatch>::mesh(std::string const &name) :
aiString str;
std::for_each(_pScene->mMaterials, _pScene->mMaterials+_pScene->mNumMaterials, [&](aiMaterial *pMat) {
pMat->Get(AI_MATKEY_NAME, str);
cout << str.data << endl;
});
#include <algorithm>
#include <iostream> // std::cout / std::endl;
using namespace std;
int main() {
int const values[] = {1, 2, 3, 4, 5};
std::for_each(values, values+5, [](int v) {
cout << v << endl;
@hadronized
hadronized / assimp.cpp
Created June 12, 2011 13:02
assimp, wtf
(II) Sun Jun 12 14:59:42 2011 | 1 present materials
zsh: segmentation fault ./skyimp cube.blend
if (_pScene->HasMaterials()) {
logger::inst() << log::information << _pScene->mNumMaterials << " present materials\n";
aiString str;
aiMaterial *pMat = _pScene->mMaterials[0];
assert(pMat);
@hadronized
hadronized / float_comparison.cpp
Created June 13, 2011 15:30
float comparison
/* is that sane ? */
float a = /* ... */
float b = /* ... */
if (a == b)
/* do something */
AI_FORCE_INLINE bool aiVector3D::operator== (const aiVector3D& other) const {
return x == other.x && y == other.y && z == other.z;
}