123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- #ifndef __CC_RAY_H_
- #define __CC_RAY_H_
- #include "math/CCMath.h"
- #include "3d/CCAABB.h"
- #include "3d/CCOBB.h"
- #include "3d/CCPlane.h"
- NS_CC_BEGIN
- class CC_DLL Ray
- {
- public:
-
- Ray();
-
- Ray(const Ray& ray);
-
-
- Ray(const Vec3& origin, const Vec3& direction);
-
- ~Ray();
-
- bool intersects(const AABB& aabb, float* distance = nullptr) const;
-
-
- bool intersects(const OBB& obb, float* distance = nullptr) const;
- float dist(const Plane& plane) const;
- Vec3 intersects(const Plane& plane) const;
-
-
- void set(const Vec3& origin, const Vec3& direction);
-
- void transform(const Mat4& matrix);
- Vec3 _origin;
- Vec3 _direction;
- };
- NS_CC_END
- #endif
|