Subversion Repositories gelsvn

Rev

Rev 541 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 541 Rev 595
Line -... Line 1...
-
 
1
/* ----------------------------------------------------------------------- *
-
 
2
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
3
 * Copyright (C) the authors and DTU Informatics
-
 
4
 * For license and list of authors, see ../../doc/intro.pdf
-
 
5
 * ----------------------------------------------------------------------- */
-
 
6
 
1
#include "CGLA/Vec3d.h"
7
#include "CGLA/Vec3d.h"
2
#include "Geometry/TriMesh.h"
8
#include "Geometry/TriMesh.h"
3
 
9
 
4
#include "BSPTree.h"
10
#include "BSPTree.h"
5
 
11
 
Line 461... Line 467...
461
    //if (!ray.has_hit)
467
    //if (!ray.has_hit)
462
    //  return false;
468
    //  return false;
463
    else 
469
    else 
464
    {
470
    {
465
      // Calculate the normal at the intersection
471
      // Calculate the normal at the intersection
466
      ray.id = reinterpret_cast<int>(ray.hit_object);
472
      ray.id = reinterpret_cast<size_t>(ray.hit_object);
467
      ray.hit_object = trimesh[ray.id];
473
      ray.hit_object = trimesh[ray.id];
468
      
474
      
469
      const Vec3i& face = ray.hit_object->normals.face(ray.hit_face_id);
475
      const Vec3i& face = ray.hit_object->normals.face(ray.hit_face_id);
470
      const Vec3f& normal0 = ray.hit_object->normals.vertex(face[0]);
476
      const Vec3f& normal0 = ray.hit_object->normals.vertex(face[0]);
471
      const Vec3f& normal1 = ray.hit_object->normals.vertex(face[1]);
477
      const Vec3f& normal1 = ray.hit_object->normals.vertex(face[1]);