?? ray.h
字號(hào):
// Ray class
#pragma once
#include "Vector.h"
namespace Mathematics
{
/// %Ray from origin point in specified direction
class Ray
{
public:
/// default constructor.
/// does nothing for speed.
Ray() {};
/// construct a ray from given origin and direction.
/// note: the ray direction must be unit length!
Ray(const Vector &origin, const Vector &direction)
{
assert(direction.normalized());
this->origin = origin;
this->direction = direction;
}
/// calculate point along ray.
Vector point(float t) const
{
return origin + direction * t;
}
Vector origin; ///< origin of ray
Vector direction; ///< direction of ray (always unit length)
};
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -