overte/libraries/shared/src/RayIntersectionInfo.h
Andrew Meadows 1df6c32a4e moving Shape* back into shared lib
removing dependency of entities lib on physics lib
physics lib now depends on entities lib
2014-12-01 16:03:14 -08:00

37 lines
934 B
C++

//
// RayIntersectionInfo.h
// libraries/physcis/src
//
// Created by Andrew Meadows 2014.09.09
// Copyright 2014 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
//
#ifndef hifi_RayIntersectionInfo_h
#define hifi_RayIntersectionInfo_h
#include <glm/glm.hpp>
class Shape;
class RayIntersectionInfo {
public:
RayIntersectionInfo() : _rayStart(0.0f), _rayDirection(1.0f, 0.0f, 0.0f), _rayLength(FLT_MAX),
_hitDistance(FLT_MAX), _hitNormal(1.0f, 0.0f, 0.0f), _hitShape(NULL) { }
glm::vec3 getIntersectionPoint() const { return _rayStart + _hitDistance * _rayDirection; }
// input
glm::vec3 _rayStart;
glm::vec3 _rayDirection;
float _rayLength;
// output
float _hitDistance;
glm::vec3 _hitNormal;
Shape* _hitShape;
};
#endif // hifi_RayIntersectionInfo_h