-
-
Notifications
You must be signed in to change notification settings - Fork 195
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Raycast improvements with contact normal (#2899)
This PR adds `RayCastHit` returns as part of every raycast not just the physics world query! * Additionally added the ray distance and the contact normal for the surface
- Loading branch information
Showing
13 changed files
with
150 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Vector } from '../../Math/vector'; | ||
import { Collider } from '../Colliders/Collider'; | ||
import { BodyComponent } from '../BodyComponent'; | ||
|
||
|
||
export interface RayCastHit { | ||
/** | ||
* The distance along the ray cast in pixels that a hit was detected | ||
*/ | ||
distance: number; | ||
/** | ||
* Reference to the collider that was hit | ||
*/ | ||
collider: Collider; | ||
/** | ||
* Reference to the body that was hit | ||
*/ | ||
body: BodyComponent; | ||
/** | ||
* World space point of the hit | ||
*/ | ||
point: Vector; | ||
|
||
/** | ||
* Normal vector of hit collider | ||
*/ | ||
normal: Vector; | ||
} |
Oops, something went wrong.