cloth2

diff src/object.cc @ 0:ef0c22554406

cloth sim test, initial commit
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 11 Jan 2016 16:51:16 +0200
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/object.cc	Mon Jan 11 16:51:16 2016 +0200
     1.3 @@ -0,0 +1,27 @@
     1.4 +#include "object.h"
     1.5 +#include "opengl.h"
     1.6 +
     1.7 +Object::~Object()
     1.8 +{
     1.9 +}
    1.10 +
    1.11 +Triangle::Triangle()
    1.12 +{
    1.13 +}
    1.14 +
    1.15 +Triangle::Triangle(const Vector3 &a, const Vector3 &b, const Vector3 &c)
    1.16 +{
    1.17 +	v[0] = a;
    1.18 +	v[1] = b;
    1.19 +	v[2] = c;
    1.20 +	normal = normalize(cross(b - a, c - a));
    1.21 +}
    1.22 +
    1.23 +bool Triangle::intersect(const Ray &ray, HitPoint *pt) const
    1.24 +{
    1.25 +	return false;
    1.26 +}
    1.27 +
    1.28 +void Triangle::draw() const
    1.29 +{
    1.30 +}