本文整理汇总了C++中Point::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Point::Init方法的具体用法?C++ Point::Init怎么用?C++ Point::Init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Point
的用法示例。
在下文中一共展示了Point::Init方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetUp
virtual void SetUp() {
for (int i = 0; i < 7; ++i) {
Point p;
p.Init(i*53 % 13, i * 3.14, i / 1.123);
p.id_ = i;
points06.push_back(p);
}
for (int i = 7; i < 14; ++i) {
Point p;
p.Init(i*53 % 13, i * 3.14, i / 1.123);
p.id_ = i;
points713.push_back(p);
}
for (int i = 3; i < 10; ++i) {
Point p;
p.Init(i+1, i+2, i+3);
p.id_ = i;
saddle.push_back(p);
}
too_many = points06;
Point p;
p.Init(1, 2, 3);
p.id_ = 7;
too_many.push_back(p);
}
示例2: SetUp
virtual void SetUp() {
ZeroMag_.Init(0, 0, 0);
NearZeroMag_.Init(0.000000000000000000001,
0.000000000000000000001,
0.000000000000000000001);
for (int i = 19; i >= 0; --i) {
Point p;
p.Init(i*173, i/79, i*1.735);
p.id_ = i;
points.push_back(p);
}
}
示例3: TryShoot
void TryShoot(double t)
{
Point c;
c.Init(a.x + t * (b.x - a.x), a.y + t * (b.y - a.y), a.z + t * (b.z - a.z));
int i;
for (i = 0; i < n && !HitBuilding(s, c, B[i]); ++i);
if (i == n && resT > t)
resT = t;
}
示例4: Normalize
// Normalize finds the unit vector
// return the unit vector
Point Point::Normalize() {
Point p;
float mag = Magnitude();
if (mag == 0) {
p.Init();
return p;
}
p.x_ = x_ / mag;
p.y_ = y_ / mag;
p.z_ = z_ / mag;
return p;
}
示例5: HitPlane
void HitPlane(const Point & p, const Point & q, const Point & r, const Point & a, const Point & b)
{
double t;
if (Intersect(p, q, r, a, b, t))
{
Point c;
c.Init(a.x+t*(b.x-a.x), a.y+t*(b.y-a.y), a.z+t*(b.z-a.z));
if (Inside(c, p, r) != 0)
{
mint = min(mint, t);
maxt = max(maxt, t);
}
}
}
示例6: Init
// Init initializes the PSObject with the given information
// identification : the id of the object
// called : the name of the object
// points : a vector of Points that define the PhaseSpace Object
// t : the type_ of object
bool PSObject::Init(int ident, string call,
vector<Point> points, string t, bool rigid) {
Point p;
p.Init();
center_ = p;
angle_.push_back(1);
angle_.push_back(0);
angle_.push_back(0);
angle_.push_back(0);
Point x_axis;
x_axis.Init(1, 0, 0);
Point y_axis;
y_axis.Init(0, 1, 0);
Point z_axis;
z_axis.Init(0, 0, 1);
axes_.push_back(x_axis);
axes_.push_back(y_axis);
axes_.push_back(z_axis);
dim_.push_back(.1);
dim_.push_back(.1);
dim_.push_back(.1);
name_ = call;
id_ = ident;
bool success;
if (t == "glove") {
GloveType* g = new GloveType;
success = g->Init(points, rigid);
type_ = static_cast<ObjectType*>(g);
ext_ = "glove";
} else {
DefaultType* d = new DefaultType;
success = d->Init(points, rigid);
type_ = static_cast<ObjectType*>(d);
ext_ = "default";
}
UpdateFields();
return success;
}