mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 12:04:18 +02:00
Add PlaneShape::getNormal() method.
This commit is contained in:
parent
f3fb39574f
commit
e75340f8ce
2 changed files with 5 additions and 0 deletions
|
@ -30,6 +30,10 @@ PlaneShape::PlaneShape(const glm::vec4& coefficients) :
|
|||
}
|
||||
}
|
||||
|
||||
glm::vec3 PlaneShape::getNormal() const {
|
||||
return _rotation * UNROTATED_NORMAL;
|
||||
}
|
||||
|
||||
glm::vec4 PlaneShape::getCoefficients() const {
|
||||
glm::vec3 normal = _rotation * UNROTATED_NORMAL;
|
||||
return glm::vec4(normal.x, normal.y, normal.z, -glm::dot(normal, _position));
|
||||
|
|
|
@ -18,6 +18,7 @@ class PlaneShape : public Shape {
|
|||
public:
|
||||
PlaneShape(const glm::vec4& coefficients = glm::vec4(0.0f, 1.0f, 0.0f, 0.0f));
|
||||
|
||||
glm::vec3 getNormal() const;
|
||||
glm::vec4 getCoefficients() const;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue