NewtonCollisionRayCast

From Newton Wiki
Revision as of 08:02, 10 June 2019 by WikiSysop (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

NewtonCollisionRayCast

dFloat NewtonCollisionRayCast( const NewtonCollision* collisionPtr, const dFloat* p0, const dFloat* p1, dFloat* normal, int* attribute)

Usage

Ray cast specific collision object.

Parameters

  • const NewtonCollision *collisionPtr - pointer to the collision object.
  • dFloat *p0 - pointer to the first element of an array of at least three floats representing the ray origin in the local space of the geometry.
  • dFloat *p1 - pointer to the first element of an array of at least three floats representing the ray end in the local space of the geometry.
  • dFloat *normal - pointer to the first element of an array of at least three floats to hold the normal at the intersection point.
  • int *attribute - pointer to the first element of an array of at least one floats to hold the ID of the face hit by the ray.

Return

  • The parametric value of the intersection, between 0.0 and 1.0 or a value larger than 1.0 if the ray misses.

Remarks

  • This function is intended for applications using newton collision system separate from the dynamics system, also for applications implementing any king of special purpose logic like sensing distance to another object.
  • the ray must be in local coordinates to the collisions geometry, for example and application ray casting the collision geometry of of a rigid body, must first take the points p0, and p1 to the local space of the rigid body by multiplying the points by the inverse of the rigid body transformation matrix.

See also

NewtonCollisionClosestPoint NewtonCollisionPointDistance NewtonCollisionCollide NewtonCollisionCalculateAABB NewtonWorldRayCast