Struct ncollide2df64::geom::Segment
pub struct Segment { // some fields omitted }
A segment geometry.
Methods
impl Segment
fn new(a: V, b: V) -> Segment
Creates a new segment from two points.
The segment will have a default margin of 0.04.
fn new_with_margin(a: V, b: V, margin: N) -> Segment
Creates a new segment from two points and a custom margin.
impl Segment
fn a<'a>(&'a self) -> &'a V
The first point of this segment.
fn b<'a>(&'a self) -> &'a V
The second point of this segment.
fn margin(&self) -> N
The margin surrounding this segment.
Trait Implementations
impl HasAABB for Segment
impl<__E: Encoder> Encodable<__E> for Segment
Automatically derived.
fn encode(&self, __arg_0: &mut __E)
impl<__D: Decoder> Decodable<__D> for Segment
Automatically derived.
fn decode(__arg_0: &mut __D) -> Segment
impl Clone for Segment
Automatically derived.
fn clone(&self) -> Segment
impl MeshElement for Segment
fn nvertices(_: Option<Segment>) -> uint
The number of vertices of this mesh element.
fn new_with_vertices_and_indices(vs: &[V], is: &[uint], margin: N) -> Segment
Creates a new mesh element from a set of vertices and indices and the margin.
impl RayCast for Segment
fn toi_and_normal_with_ray(&self, ray: &Ray) -> Option<(N, V)>
Computes the intersection point between this geometry and a ray.
fn toi_with_ray(&self, ray: &Ray) -> Option<N>
Computes the time of impact between this geometry and a ray
fn intersects_ray(&self, ray: &Ray) -> bool
Tests whether a ray intersects this geometry.
fn toi_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<N>
Computes the time of impact between this transform geometry and a ray.
fn toi_and_normal_with_transform_and_ray(&self, m: &M, ray: &Ray) -> Option<(N, V)>
Computes the time of impact, and normal between this transformed geometry and a ray.
fn intersects_with_transform_and_ray(&self, m: &M, ray: &Ray) -> bool
Tests whether a ray intersects this transformed geometry.
impl Volumetric for Segment
fn mass_properties(&self, _: &N) -> (N, V, II)
Given a density, this computes the mass, center of mass, and inertia tensor of this object.
impl HasMargin for Segment
fn margin(&self) -> N
The geometry margin.
impl<_M: Transform<V> + Rotate<V>> Implicit<V, _M> for Segment
fn support_point_without_margin(&self, m: &_M, dir: &V) -> V
Evaluates the support function of the object. A support function is a
function associating a vector to the geometry point which maximizes their
dot product. This does not include the margin
of the object. Margins are
geometry-dependent. Use support_point
to sample the complete geometry.
Arguments:
dir
- the input of the support function. It is not required for it to be normalized.
fn support_point(&self, transform: &M, dir: &V) -> V
Evaluates the support function of the object. A support function is a function associating a vector to the geometry point which maximizes their dot product.
Arguments:
dir
- the input of the support function. It is not required for it to be normalized.
impl<_V, _M> PreferedSamplingDirections<_V, _M> for Segment
fn sample(&self, _: &_M, _: |_V|)
Applies a function to this geometry with a given transform.