CollisionSegment
from panda3d.core import CollisionSegment
- class CollisionSegment
Bases:
CollisionSolid
A finite line segment, with two specific endpoints but no thickness. It’s similar to a CollisionRay, except it does not continue to infinity.
It does have an ordering, from point A to point B. If more than a single point of the segment is intersecting a solid, the reported intersection point is generally the closest on the segment to point A.
Inheritance diagram
- __init__(*args, **kwargs)
- getClassType()
C++ Interface: get_class_type()
- get_class_type()
C++ Interface: get_class_type()
- point_a
- point_b
- setFromLens()
C++ Interface: set_from_lens(const CollisionSegment self, LensNode camera, const LPoint2f point) set_from_lens(const CollisionSegment self, LensNode camera, float px, float py)
- /**
Accepts a LensNode and a 2-d point in the range [-1,1]. Sets the
CollisionSegment so that it begins at the LensNode’s near plane and extends
to the far plane, making it suitable for picking objects from the screen
given a camera and a mouse location.
*/
- /**
Accepts a LensNode and a 2-d point in the range [-1,1]. Sets the
CollisionSegment so that it begins at the LensNode’s near plane and extends
to the far plane, making it suitable for picking objects from the screen
given a camera and a mouse location.
Returns true if the point was acceptable, false otherwise.
*/
- setPointA()
C++ Interface: set_point_a(const CollisionSegment self, const LPoint3f a) set_point_a(const CollisionSegment self, float x, float y, float z)
- setPointB()
C++ Interface: set_point_b(const CollisionSegment self, const LPoint3f b) set_point_b(const CollisionSegment self, float x, float y, float z)
- set_from_lens()
C++ Interface: set_from_lens(const CollisionSegment self, LensNode camera, const LPoint2f point) set_from_lens(const CollisionSegment self, LensNode camera, float px, float py)
- /**
Accepts a LensNode and a 2-d point in the range [-1,1]. Sets the
CollisionSegment so that it begins at the LensNode’s near plane and extends
to the far plane, making it suitable for picking objects from the screen
given a camera and a mouse location.
*/
- /**
Accepts a LensNode and a 2-d point in the range [-1,1]. Sets the
CollisionSegment so that it begins at the LensNode’s near plane and extends
to the far plane, making it suitable for picking objects from the screen
given a camera and a mouse location.
Returns true if the point was acceptable, false otherwise.
*/
- set_point_a()
C++ Interface: set_point_a(const CollisionSegment self, const LPoint3f a) set_point_a(const CollisionSegment self, float x, float y, float z)