21 INLINE CollisionPolygon::
28 setup_points(array, array + 3);
36 INLINE CollisionPolygon::
44 setup_points(array, array + 4);
53 INLINE CollisionPolygon::
55 setup_points(begin, end);
64 INLINE CollisionPolygon::
76 return _points.size();
89 rederive_to_3d_mat(to_3d_mat);
90 return to_3d(_points[n]._p, to_3d_mat);
135 _volume_pcollector.flush_level();
136 _test_pcollector.flush_level();
144 INLINE
bool CollisionPolygon::
146 return (v1[0] * v2[1] - v1[1] * v2[0]) > 1.0e-6f;
157 INLINE PN_stdfloat CollisionPolygon::
161 return (v1[0] * v[1] - v1[1] * v[0]);
171 INLINE
LPoint2 CollisionPolygon::
174 return LPoint2(point[0], point[2]);
184 INLINE
void CollisionPolygon::
185 calc_to_3d_mat(
LMatrix4 &to_3d_mat)
const {
194 look_at(to_3d_mat, -get_plane().get_normal(),
195 LVector3(0.0f, 0.0f, 1.0f), CS_zup_right);
213 INLINE
void CollisionPolygon::
214 rederive_to_3d_mat(
LMatrix4 &to_3d_mat)
const {
224 INLINE
LPoint3 CollisionPolygon::
226 return LPoint3(point2d[0], 0.0f, point2d[1]) * to_3d_mat;
234 INLINE CollisionPolygon::PointDef::
243 INLINE CollisionPolygon::PointDef::
244 PointDef(PN_stdfloat x, PN_stdfloat y) : _p(x, y), _v(0.0f, 0.0f) {
252 INLINE CollisionPolygon::PointDef::
253 PointDef(
const CollisionPolygon::PointDef ©) : _p(copy._p), _v(copy._v) {
261 INLINE
void CollisionPolygon::PointDef::
262 operator = (
const CollisionPolygon::PointDef ©) {
This is the base class for all three-component vectors and points.
LPoint3 get_point(int n) const
Returns the nth vertex of the CollisionPolygon, expressed in 3-D space.
static const LPoint3f & zero()
Returns a zero-length point.
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...
static bool verify_points(const LPoint3 &a, const LPoint3 &b, const LPoint3 &c)
Verifies that the indicated set of points will define a valid CollisionPolygon: that is...
This is a 4-by-4 transform matrix.
int get_num_points() const
Returns the number of vertices of the CollisionPolygon.
bool invert_from(const LMatrix4f &other)
Computes the inverse of the other matrix, and stores the result in this matrix.
This is the base class for all two-component vectors and points.
This is a two-component vector offset.
void set_row(int row, const LVecBase4f &v)
Replaces the indicated row of the matrix.
This is a two-component point in space.
static void flush_level()
Flushes the PStatCollectors used during traversal.