Skip to content

Instantly share code, notes, and snippets.


Maxim Timakov max-dark

View GitHub Profile
nnaumenko /
Last active Jul 11, 2021
Simatic MC7 code
gszauer / raw_quat.cpp
Last active Apr 5, 2021
Simple Quaternions
View raw_quat.cpp
#include <iostream>
#include <cmath>
using std::cout;
typedef struct quat_t {
double w, x, y, z;
} quat, quaternion;
typedef struct euler_t {
View Quaternion Cpp
#include "Quaternion.h"
#include <cmath>
View Vector Cpp
#include "Vector.h"
#include <cmath>
const Vector Vector::zero(0.0f, 0.0f, 0.0f);
const Vector Vector::one(1.0f, 1.0f, 1.0f);
const Vector Vector::forward(0.0f, 0.0f, 1.0f);
const Vector Vector::up(0.0f, 1.0f, 0.0f);
const Vector Vector::right(1.0f, 0.0f, 0.0f);
Vector::Vector(float X, float Y, float Z) : x(X), y(Y), z(Z), w(0.0f) {}
View Matrix Cpp
#include "Matrix.h"
#include <string.h>
#include <cmath>
#define MATRIXELEMENT(mat, row, col) mat[row * 4 + col]
const Matrix Matrix::zero;
const Matrix Matrix::identity(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f );
Matrix::Matrix() {
jzrake / Makefile
Created Apr 17, 2012
Wrapping C++ classes with Lua
View Makefile
LUAHOME = $(HOME)/Work/lunum/lua-5.2.0
CFLAGS = -Wall
default : luawrap
luawrap : luawrap.cpp
$(CXX) $(CFLAGS) -o $@ $^ -L$(LUAHOME)/lib -I$(LUAHOME)/include -llua
clean :