~ubuntu-branches/debian/wheezy/gource/wheezy

« back to all changes in this revision

Viewing changes to src/core/plane.cpp

  • Committer: Package Import Robot
  • Author(s): Andrew Caudwell
  • Date: 2012-04-24 11:25:45 UTC
  • mfrom: (1.2.13)
  • Revision ID: package-import@ubuntu.com-20120424112545-18fbnycu9xrsl4s5
Tags: 0.38-1
* New upstream release (closes: #667189)
* New build dependencies on libglm-dev and libboost-filesystem-dev. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
    d = 0.0f;
32
32
}
33
33
 
34
 
Plane::Plane(const vec3f & v1, const vec3f & v2, const vec3f & v3) {
35
 
    vec3f edge1 = v1 - v2;
36
 
    vec3f edge2 = v3 - v2;
 
34
Plane::Plane(const vec3 & v1, const vec3 & v2, const vec3 & v3) {
 
35
    vec3 edge1 = v1 - v2;
 
36
    vec3 edge2 = v3 - v2;
37
37
 
38
 
    normal = edge2.cross(edge1);
39
 
    normal.normalize();
 
38
    normal = normalise(glm::cross(edge2, edge1));
40
39
 
41
40
    point = v2;
42
41
 
43
 
    d = -(normal.dot(point));
 
42
    d = -(glm::dot(normal, point));
44
43
}
45
44
 
46
 
float Plane::distance(const vec3f & p) const{
47
 
    return (d + normal.dot(p));
 
45
float Plane::distance(const vec3 & p) const{
 
46
    return d + glm::dot(normal, p);
48
47
}
49
48