📄 line.hpp
字号:
//=======================================================================//
// File: line.hpp //
//---------------------------------------------------------------------------//
// Copyright (C) Microsoft Corporation. All rights reserved. //
//===========================================================================//
#pragma once
#include "Stuff.hpp"
#include "Ray.hpp"
namespace Stuff {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Line3D3D ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class Line3D:
public Ray3D
{
public:
Scalar
length;
Line3D()
{}
Line3D(
const Ray3D &ray,
Scalar length
):
Ray3D(ray),
length(length)
{}
Line3D(
const Point3D &start,
const UnitVector3D &direction,
Scalar length
):
Ray3D(start,direction),
length(length)
{}
//
// Assignment operators
//
Line3D&
SetDirection(const Vector3D &vector);
void
FindEnd(Point3D *result)
{Check_Object(this); Check_Pointer(result); Ray3D::Project(length, result);}
//
// Intersection functions
//
Scalar
GetDistanceTo(
const Plane &plane,
Scalar *product
) const
{Check_Object(this); return Ray3D::GetDistanceTo(plane, product);}
Scalar
GetDistanceTo(
const Sphere &sphere,
Scalar *penetration
) const;
Scalar
GetDistanceTo(const OBB& box);
Scalar
GetDistanceTo(
const OBB& box,
int *axis
);
};
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -