Skip to content

physics::ray_intersection_info

Paweł Waligóra edited this page May 20, 2024 · 1 revision

Description

Result of physics::ray_cast() or physics::ray_cast_all() function. Holds information about ray - collider intersection.

#include "physics.h"

fields

int intersect

It's a bit mask. Last 2 bits are important. If last bit is 1 ray has entry point with the collider, else it doesn't. Analogously second to last bit determines if there is an exit point.

Scenerios:

  • entry and exit are 1 - ray intersects
  • both 0 - ray does not intersect
  • only exit point - ray starts inside the collider
  • only entry point - only possible with, as it is a one sided collider: physics::colliders::plane

glm::vec3 enter and glm::vec3 exit

Points of intersection.

physics::collider* col

Pointer to collider that intersects a ray.

float distance

Distance between ray origin and entry point. If intersect entry bit is 0, then distance = 0.0f.

Home

Git Workflow

Issues

Coding Rules

Skrypty-Tutorial

Useful resources

Game Structure

Code Structure

Clone this wiki locally