Struct collision::algorithm::minkowski::GJK [] [src]

pub struct GJK<SP, E, S> { /* fields omitted */ }

Gilbert-Johnson-Keerthi narrow phase collision detection algorithm.

Type parameters:

Methods

impl<SP, E, S> GJK<SP, E, S> where
    SP: SimplexProcessor,
    SP::Point: EuclideanSpace<Scalar = S>,
    S: BaseFloat,
    E: EPA<Point = SP::Point>, 
[src]

[src]

Create a new GJK algorithm implementation

[src]

Create a new GJK algorithm implementation with the given tolerance settings

[src]

Do intersection test on the given primitives

Parameters:

  • left: left primitive
  • left_transform: model-to-world-transform for the left primitive
  • right: right primitive,
  • right_transform: model-to-world-transform for the right primitive

Returns:

Will return a simplex if a collision was detected. For 2D, the simplex will be a triangle, for 3D, it will be a tetrahedron. The simplex will enclose the origin. If no collision was detected, None is returned.

[src]

Do time of impact intersection testing on the given primitives, and return a valid contact at the time of impact.

Parameters:

  • left: left primitive
  • left_transform: model-to-world-transform for the left primitive
  • right: right primitive,
  • right_transform: model-to-world-transform for the right primitive

Returns:

Will optionally return a contact manifold at the time of impact. If no collision was detected, None is returned.

[src]

Compute the distance between the given primitives.

Parameters:

  • left: left primitive
  • left_transform: model-to-world-transform for the left primitive
  • right: right primitive,
  • right_transform: model-to-world-transform for the right primitive

Returns:

Will optionally return the distance between the objects. Will return None, if the objects are colliding.

[src]

Given a GJK simplex that encloses the origin, compute the contact manifold.

Uses the EPA algorithm to find the contact information from the simplex.

[src]

Do intersection testing on the given primitives, and return the contact manifold.

Parameters:

  • strategy: strategy to use, if CollisionOnly it will only return a boolean result, otherwise, EPA will be used to compute the exact contact point.
  • left: left primitive
  • left_transform: model-to-world-transform for the left primitive
  • right: right primitive,
  • right_transform: model-to-world-transform for the right primitive

Returns:

Will optionally return a Contact if a collision was detected. In CollisionOnly mode, this contact will only be a boolean result. For FullResolution mode, the contact will contain a full manifold (collision normal, penetration depth and contact point).

[src]

Do intersection test on the given complex shapes, and return the actual intersection point

Parameters:

  • strategy: strategy to use, if CollisionOnly it will only return a boolean result, otherwise, EPA will be used to compute the exact contact point.
  • left: shape consisting of a slice of primitive + local-to-model-transform for each primitive,
  • left_transform: model-to-world-transform for the left shape
  • right: shape consisting of a slice of primitive + local-to-model-transform for each primitive,
  • right_transform: model-to-world-transform for the right shape

Returns:

Will optionally return a Contact if a collision was detected. In CollisionOnly mode, this contact will only be a boolean result. For FullResolution mode, the contact will contain a full manifold (collision normal, penetration depth and contact point), for the contact with the highest penetration depth.

[src]

Compute the distance between the given shapes.

Parameters:

  • left: left shape
  • left_transform: model-to-world-transform for the left shape
  • right: right shape,
  • right_transform: model-to-world-transform for the right shape

Returns:

Will optionally return the smallest distance between the objects. Will return None, if the objects are colliding.

[src]

Do intersection time of impact test on the given complex shapes, and return the contact at the time of impact

Parameters:

  • strategy: strategy to use, if CollisionOnly it will only return a boolean result, otherwise, a full contact manifold will be returned.
  • left: shape consisting of a slice of primitive + local-to-model-transform for each primitive,
  • left_transform: model-to-world-transform for the left shape
  • right: shape consisting of a slice of primitive + local-to-model-transform for each primitive,
  • right_transform: model-to-world-transform for the right shape

Returns:

Will optionally return the contact if a collision was detected. In CollisionOnly mode, this contact will only be a time of impact. For FullResolution mode, the time of impact will be the earliest found among all shape primitives. Will return None if no collision was found.

Trait Implementations

impl<SP: Debug, E: Debug, S: Debug> Debug for GJK<SP, E, S>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<SP, E, S> Send for GJK<SP, E, S> where
    E: Send,
    S: Send,
    SP: Send

impl<SP, E, S> Sync for GJK<SP, E, S> where
    E: Sync,
    S: Sync,
    SP: Sync