%module tgt %include "stdint.i" %{ #include "ext/tgt/camera.h" #include "ext/tgt/vector.h" #include "ext/tgt/event/eventlistener.h" %} namespace tgt { /* Vector2 */ template struct Vector2 { Vector2(T t); Vector2(T t1, T t2); static Vector2 zero; }; %template(ivec2) Vector2; typedef Vector2 ivec2; %template(vec2) Vector2; typedef Vector2 vec2; /* Vector3 */ template struct Vector3 { Vector3(); explicit Vector3(T v); Vector3(T t1, T t2, T t3); Vector3(const Vector2& vec, T z_); Vector3(T _x, const Vector2& v); static Vector3 zero; }; %template(vec3) Vector3; typedef Vector3 vec3; %template(svec3) Vector3; typedef Vector3 svec3; /* Vector4 */ template struct Vector4 { Vector4() {} explicit Vector4(T init); Vector4(T t1, T t2, T t3, T t4); Vector4(const Vector2& v1, const Vector2& v2); Vector4(const Vector2& vec, T z_, T w_); Vector4(T _x, T _y, const Vector2& v); }; %template(vec4) Vector4; typedef Vector4 vec4; %template(col4) Vector4; typedef Vector4 col4; /* EventListener */ class EventListener { public: EventListener(); virtual ~EventListener(); }; /* Camera */ class Camera { public: enum ProjectionMode { ORTHOGRAPHIC, PERSPECTIVE, FRUSTUM }; Camera(const vec3& position = vec3(0.f, 0.f, 0.f), const vec3& focus = vec3(0.f, 0.f, -1.f), const vec3& up = vec3(0.f, 1.f, 0.f), float fovy = 45.f, float ratio = static_cast(GLCanvas::DEFAULT_WINDOW_WIDTH) / GLCanvas::DEFAULT_WINDOW_HEIGHT, float distn = 0.1f, float distf = 50.f, ProjectionMode pm = PERSPECTIVE); virtual ~Camera(); }; }