14 #ifndef PHYSXUTILLIB_H 15 #define PHYSXUTILLIB_H 39 bool box_contains_point(
const PhysxBox &box,
const LPoint3f &p);
41 LVector3f compute_box_world_edge_normal(
const PhysxBox &box,
unsigned int edge_index);
45 void set_fpu_exceptions(
bool b);
46 void set_fpu_precision24();
47 void set_fpu_precision53();
48 void set_fpu_precision64();
49 void set_fpu_rounding_chop();
50 void set_fpu_rounding_down();
51 void set_fpu_rounding_near();
52 void set_fpu_rounding_up();
53 int int_ceil(
const float &f);
54 int int_chop(
const float &f);
55 int int_floor(
const float &f);
56 float compute_distance_squared(
const PhysxRay &ray,
const LPoint3f &point);
57 float compute_square_distance(
const PhysxSegment &seg,
const LPoint3f &point);
59 void normal_to_tangents(
const LVector3f &n, LVector3f &t1, LVector3f &t2);
60 LMatrix3f find_rotation_matrix(
const LVector3f &x,
const LVector3f &b);
61 float compute_sphere_mass(
float radius,
float density);
62 float compute_sphere_density(
float radius,
float mass);
63 float compute_box_mass(
const LVector3f &extents,
float density);
64 float compute_box_density(
const LVector3f &extents,
float mass);
65 float compute_ellipsoid_mass(
const LVector3f &extents,
float density);
66 float compute_ellipsoid_density(
const LVector3f &extents,
float mass);
67 float compute_cylinder_mass(
float radius,
float length,
float density);
68 float compute_cylinder_density(
float radius,
float length,
float mass);
69 float compute_cone_mass(
float radius,
float length,
float density);
70 float compute_cone_density(
float radius,
float length,
float mass);
71 LVector3f compute_box_inertia_tensor(
float mass,
float xlength,
float ylength,
float zlength);
72 LVector3f compute_sphere_inertia_tensor(
float mass,
float radius,
bool hollow);
73 bool box_box_intersect(
const LVector3f &extents0,
const LPoint3f ¢er0,
const LMatrix3f &rotation0,
const LVector3f &extents1,
const LPoint3f ¢er1,
const LMatrix3f &rotation1,
bool full_test);
74 bool tri_box_intersect(
const LPoint3f &vertex0,
const LPoint3f &vertex1,
const LPoint3f &vertex2,
const LPoint3f ¢er,
const LVector3f &extents);
75 bool ray_plane_intersect(
const PhysxRay &ray,
const PhysxPlane &plane, LPoint3f &point_on_plane);
76 bool ray_sphere_intersect(
const LPoint3f &origin,
const LVector3f &dir,
float length,
const LPoint3f ¢er,
float radius, LPoint3f &hit_pos);
77 bool segment_box_intersect(
const LPoint3f &p1,
const LPoint3f &p2,
const LPoint3f &bbox_min,
const LPoint3f &bbox_max, LPoint3f &intercept);
78 bool ray_aabb_intersect(
const LPoint3f &min,
const LPoint3f &max,
const LPoint3f &origin,
const LVector3f &dir, LPoint3f &coord);
79 bool segment_obb_intersect(
const LPoint3f &p0,
const LPoint3f &p1,
const LPoint3f ¢er,
const LVector3f &extents,
const LMatrix3f &rot);
80 bool segment_aabb_intersect(
const LPoint3f &p0,
const LPoint3f &p1,
const LPoint3f &min,
const LPoint3f &max);
81 bool ray_obb_intersect(
const PhysxRay &ray,
const LPoint3f ¢er,
const LVector3f &extents,
const LMatrix3f &rot);
82 unsigned int ray_capsule_intersect(
const LPoint3f &origin,
const LVector3f &dir,
const PhysxCapsule &capsule);
83 bool swept_spheres_intersect(
const PhysxSphere &sphere0,
const LVector3f &velocity0,
const PhysxSphere &sphere1,
const LVector3f &velocity1);
84 bool ray_tri_intersect(
const LPoint3f &orig,
const LVector3f &dir,
const LPoint3f &vert0,
const LPoint3f &vert1,
const LPoint3f &vert2, LVector3f &hit,
bool cull);
85 bool sweep_box_capsule(
const PhysxBox &box,
const PhysxCapsule &lss,
const LVector3f &dir,
float length, LVector3f &normal);
86 bool sweep_box_sphere(
const PhysxBox &box,
const PhysxSphere &sphere,
const LVector3f &dir,
float length, LVector3f &normal);
87 bool sweep_capsule_capsule(
const PhysxCapsule &lss0,
const PhysxCapsule &lss1,
const LVector3f &dir,
float length, LPoint3f &ip, LVector3f &normal);
88 bool sweep_sphere_capsule(
const PhysxSphere &sphere,
const PhysxCapsule &lss,
const LVector3f &dir,
float length, LPoint3f &ip, LVector3f &normal);
89 bool sweep_box_box(
const PhysxBox &box0,
const PhysxBox &box1,
const LVector3f &dir,
float length, LPoint3f &ip, LVector3f &normal);
90 float point_obb_sqr_dist(
const LPoint3f &point,
const LPoint3f ¢er,
const LVector3f &extents,
const LMatrix3f &rot, LPoint3f ¶ms);
98 #endif // PHYSUTILLIB_H
Represents a sphere defined by its center point and radius.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents an oriented bounding box, as a center point, extents(radii) and a rotation.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represention of a axis aligned bounding box.
Represents a line segment.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Represents an ray as an origin and direction.