Files
cocos4/native/cocos/core/geometry/Line.cpp
T
minggo 5410a48a58 Implement more logic in native (#4131)
Co-authored-by: bofeng.song <bofeng.song@chukong-inc.com>
Co-authored-by: dumganhar <dumganhar@gmail.com>
Co-authored-by: mmyduckx <308303735@qq.com>
Co-authored-by: Patrice Jiang <397136899@qq.com>
Co-authored-by: 江战 <40414978+PatriceJiang@users.noreply.github.com>
2022-01-07 18:39:40 +08:00

57 lines
1.1 KiB
C++

#include "core/geometry/Line.h"
namespace cc {
namespace geometry {
Line *Line::create(float sx,
float sy,
float sz,
float ex,
float ey,
float ez) {
return new Line(sx, sy, sz, ex, ey, ez);
}
Line *Line::clone(const Line &a) {
return new Line(
a.s.x, a.s.y, a.s.z,
a.e.x, a.e.y, a.e.z);
}
Line *Line::copy(Line *out, const Line &a) {
out->s = a.s;
out->e = a.e;
return out;
}
Line *Line::fromPoints(Line *out, const Vec3 &start, const Vec3 &end) {
out->s = start;
out->e = end;
return out;
}
Line *Line::set(Line *out,
float sx,
float sy,
float sz,
float ex,
float ey,
float ez) {
out->s.x = sx;
out->s.y = sy;
out->s.z = sz;
out->e.x = ex;
out->e.y = ey;
out->e.z = ez;
return out;
}
Line::Line(float sx, float sy, float sz, float ex, float ey, float ez) {
setType(ShapeEnum::SHAPE_LINE);
s = {sx, sy, sz};
e = {ex, ey, ez};
}
} // namespace geometry
} // namespace cc