Panda3D
Public Member Functions | Public Attributes | List of all members
PhysxUtilLib Class Reference

Public Member Functions

bool box_box_intersect (const LVector3f &extents0, const LPoint3f &center0, const LMatrix3f &rotation0, const LVector3f &extents1, const LPoint3f &center1, const LMatrix3f &rotation1, bool full_test)
 Boolean intersection test between two OBBs. More...
 
bool box_contains_point (const PhysxBox &box, const LPoint3f &p)
 Test if an oriented box contains a point. More...
 
PhysxBox compute_box_around_capsule (const PhysxCapsule &capsule)
 Compute a box which encloses a capsule. More...
 
float compute_box_density (const LVector3f &extents, float mass)
 Computes density of a homogeneous box according to box mass. More...
 
LVector3f compute_box_inertia_tensor (float mass, float xlength, float ylength, float zlength)
 Computes diagonalized inertia tensor for a box. More...
 
float compute_box_mass (const LVector3f &extents, float density)
 Computes mass of a homogeneous box according to box density. More...
 
LVector3f compute_box_world_edge_normal (const PhysxBox &box, unsigned int edge_index)
 Compute and edge normals for an oriented box. More...
 
PhysxCapsule compute_capsule_around_box (const PhysxBox &box)
 Compute a capsule which encloses a box. More...
 
float compute_cone_density (float radius, float length, float mass)
 Computes density of a homogeneous cone according to cone mass. More...
 
float compute_cone_mass (float radius, float length, float density)
 Computes mass of a homogeneous cone according to cone density. More...
 
float compute_cylinder_density (float radius, float length, float mass)
 Computes density of a homogeneous cylinder according to cylinder mass. More...
 
float compute_cylinder_mass (float radius, float length, float density)
 Computes mass of a homogeneous cylinder according to cylinder density. More...
 
float compute_distance_squared (const PhysxRay &ray, const LPoint3f &point)
 Compute the distance squared from a point to a ray. More...
 
float compute_ellipsoid_density (const LVector3f &extents, float mass)
 Computes density of a homogeneous ellipsoid according to ellipsoid mass. More...
 
float compute_ellipsoid_mass (const LVector3f &extents, float density)
 Computes mass of a homogeneous ellipsoid according to ellipsoid density. More...
 
float compute_sphere_density (float radius, float mass)
 Computes density of a homogeneous sphere according to sphere mass. More...
 
LVector3f compute_sphere_inertia_tensor (float mass, float radius, bool hollow)
 Computes diagonalized inertia tensor for a sphere. More...
 
float compute_sphere_mass (float radius, float density)
 Computes mass of a homogeneous sphere according to sphere density. More...
 
float compute_square_distance (const PhysxSegment &seg, const LPoint3f &point)
 Compute the distance squared from a point to a line segment. More...
 
PhysxBox create_box (const PhysxBounds3 &aabb, const LMatrix4f &mat)
 Create an oriented box from an axis aligned box and a transformation. More...
 
LMatrix3f find_rotation_matrix (const LVector3f &x, const LVector3f &b)
 Computes a rotation matrix M so that: M * x = b (x and b are unit vectors). More...
 
int int_ceil (const float &f)
 Convert a floating point number to an integer. More...
 
int int_chop (const float &f)
 Convert a floating point number to an integer. More...
 
int int_floor (const float &f)
 Convert a floating point number to an integer. More...
 
bool is_box_a_inside_box_b (const PhysxBox &a, const PhysxBox &b)
 Test if box A is inside another box B. More...
 
PhysxSphere merge_spheres (const PhysxSphere &sphere0, const PhysxSphere &sphere1)
 Compute an overall bounding sphere for a pair of spheres. More...
 
void normal_to_tangents (const LVector3f &n, LVector3f &t1, LVector3f &t2)
 Get the tangent vectors associated with a normal. More...
 
float point_obb_sqr_dist (const LPoint3f &point, const LPoint3f &center, const LVector3f &extents, const LMatrix3f &rot, LPoint3f &params)
 Point-vs-OBB distance computation. More...
 
bool ray_aabb_intersect (const LPoint3f &min, const LPoint3f &max, const LPoint3f &origin, const LVector3f &dir, LPoint3f &coord)
 Ray-AABB intersection test. More...
 
unsigned int ray_capsule_intersect (const LPoint3f &origin, const LVector3f &dir, const PhysxCapsule &capsule)
 Ray-capsule intersection test. More...
 
bool ray_obb_intersect (const PhysxRay &ray, const LPoint3f &center, const LVector3f &extents, const LMatrix3f &rot)
 Boolean ray-OBB intersection test. More...
 
bool ray_plane_intersect (const PhysxRay &ray, const PhysxPlane &plane, LPoint3f &point_on_plane)
 Ray-plane intersection test. More...
 
bool ray_sphere_intersect (const LPoint3f &origin, const LVector3f &dir, float length, const LPoint3f &center, float radius, LPoint3f &hit_pos)
 Ray-sphere intersection test. More...
 
bool ray_tri_intersect (const LPoint3f &orig, const LVector3f &dir, const LPoint3f &vert0, const LPoint3f &vert1, const LPoint3f &vert2, LVector3f &hit, bool cull)
 Ray-triangle intersection test. More...
 
bool segment_aabb_intersect (const LPoint3f &p0, const LPoint3f &p1, const LPoint3f &min, const LPoint3f &max)
 Boolean segment-AABB intersection test. More...
 
bool segment_box_intersect (const LPoint3f &p1, const LPoint3f &p2, const LPoint3f &bbox_min, const LPoint3f &bbox_max, LPoint3f &intercept)
 Segment-AABB intersection test. More...
 
bool segment_obb_intersect (const LPoint3f &p0, const LPoint3f &p1, const LPoint3f &center, const LVector3f &extents, const LMatrix3f &rot)
 Boolean segment-OBB intersection test. More...
 
void set_fpu_exceptions (bool b)
 Set FPU precision. More...
 
void set_fpu_precision24 ()
 Set FPU precision. More...
 
void set_fpu_precision53 ()
 Set FPU precision. More...
 
void set_fpu_precision64 ()
 Set FPU precision. More...
 
void set_fpu_rounding_chop ()
 Set FPU precision. More...
 
void set_fpu_rounding_down ()
 Set FPU rounding mode. More...
 
void set_fpu_rounding_near ()
 Set FPU rounding mode. More...
 
void set_fpu_rounding_up ()
 Set FPU rounding mode. More...
 
bool sweep_box_box (const PhysxBox &box0, const PhysxBox &box1, const LVector3f &dir, float length, LPoint3f &ip, LVector3f &normal)
 Box-vs-box sweep test. More...
 
bool sweep_box_capsule (const PhysxBox &box, const PhysxCapsule &lss, const LVector3f &dir, float length, LVector3f &normal)
 Box-vs-capsule sweep test. More...
 
bool sweep_box_sphere (const PhysxBox &box, const PhysxSphere &sphere, const LVector3f &dir, float length, LVector3f &normal)
 Box-vs-sphere sweep test. More...
 
bool sweep_capsule_capsule (const PhysxCapsule &lss0, const PhysxCapsule &lss1, const LVector3f &dir, float length, LPoint3f &ip, LVector3f &normal)
 Capsule-vs-capsule sweep test. More...
 
bool sweep_sphere_capsule (const PhysxSphere &sphere, const PhysxCapsule &lss, const LVector3f &dir, float length, LPoint3f &ip, LVector3f &normal)
 Sphere-vs-capsule sweep test. More...
 
bool swept_spheres_intersect (const PhysxSphere &sphere0, const LVector3f &velocity0, const PhysxSphere &sphere1, const LVector3f &velocity1)
 Sphere-sphere sweep test. More...
 
bool tri_box_intersect (const LPoint3f &vertex0, const LPoint3f &vertex1, const LPoint3f &vertex2, const LPoint3f &center, const LVector3f &extents)
 Boolean intersection test between a triangle and a box. More...
 

Public Attributes

NxUtilLib * _ptr
 

Detailed Description

Definition at line 35 of file physxUtilLib.h.

Member Function Documentation

◆ box_box_intersect()

bool PhysxUtilLib::box_box_intersect ( const LVector3f extents0,
const LPoint3f center0,
const LMatrix3f rotation0,
const LVector3f extents1,
const LPoint3f center1,
const LMatrix3f rotation1,
bool  full_test 
)

Boolean intersection test between two OBBs.

Uses the separating axis theorem. Disabling 'full_test' only performs 6 axis tests out of 15.

Parameters
[in]extents0
[in]center0
[in]rotation0
[in]extents1
[in]center1
[in]rotation1
[in]full_test

Definition at line 539 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), PhysxManager::point3_to_nxVec3(), tri_box_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by compute_sphere_inertia_tensor().

◆ box_contains_point()

bool PhysxUtilLib::box_contains_point ( const PhysxBox box,
const LPoint3f p 
)

Test if an oriented box contains a point.

Parameters
[in]box
[in]p

Definition at line 155 of file physxUtilLib.cxx.

References create_box(), and PhysxManager::point3_to_nxVec3().

Referenced by int_floor().

◆ compute_box_around_capsule()

PhysxBox PhysxUtilLib::compute_box_around_capsule ( const PhysxCapsule capsule)

Compute a box which encloses a capsule.

Parameters
[in]capsule

Definition at line 237 of file physxUtilLib.cxx.

References compute_distance_squared().

Referenced by is_box_a_inside_box_b().

◆ compute_box_density()

float PhysxUtilLib::compute_box_density ( const LVector3f extents,
float  mass 
)

Computes density of a homogeneous box according to box mass.

Parameters
[in]radius
[in]mass

Definition at line 393 of file physxUtilLib.cxx.

References compute_ellipsoid_mass(), and PhysxManager::vec3_to_nxVec3().

Referenced by compute_box_mass().

◆ compute_box_inertia_tensor()

LVector3f PhysxUtilLib::compute_box_inertia_tensor ( float  mass,
float  xlength,
float  ylength,
float  zlength 
)

Computes diagonalized inertia tensor for a box.

Parameters
[in]mass
[in]xlength
[in]ylength
[in]zlength

Definition at line 499 of file physxUtilLib.cxx.

References compute_sphere_inertia_tensor(), and PhysxManager::nxVec3_to_vec3().

Referenced by compute_cone_density().

◆ compute_box_mass()

float PhysxUtilLib::compute_box_mass ( const LVector3f extents,
float  density 
)

Computes mass of a homogeneous box according to box density.

Parameters
[in]radius
[in]density

Definition at line 378 of file physxUtilLib.cxx.

References compute_box_density(), and PhysxManager::vec3_to_nxVec3().

Referenced by compute_sphere_density().

◆ compute_box_world_edge_normal()

LVector3f PhysxUtilLib::compute_box_world_edge_normal ( const PhysxBox box,
unsigned int  edge_index 
)

Compute and edge normals for an oriented box.

This is an averaged normal, from the two faces sharing the edge. The edge index should be from 0 to 11 (i.e. a box has 12 edges).

Parameters
[in]box
[in]edge_index

Definition at line 189 of file physxUtilLib.cxx.

References compute_capsule_around_box(), PhysxManager::nxVec3_to_vec3(), and LVector3f::zero().

Referenced by create_box().

◆ compute_capsule_around_box()

PhysxCapsule PhysxUtilLib::compute_capsule_around_box ( const PhysxBox box)

Compute a capsule which encloses a box.

Parameters
[in]box

Definition at line 207 of file physxUtilLib.cxx.

References is_box_a_inside_box_b().

Referenced by compute_box_world_edge_normal().

◆ compute_cone_density()

float PhysxUtilLib::compute_cone_density ( float  radius,
float  length,
float  mass 
)

Computes density of a homogeneous cone according to cone mass.

Parameters
[in]radius
[in]mass

Definition at line 483 of file physxUtilLib.cxx.

References compute_box_inertia_tensor().

Referenced by compute_cone_mass().

◆ compute_cone_mass()

float PhysxUtilLib::compute_cone_mass ( float  radius,
float  length,
float  density 
)

Computes mass of a homogeneous cone according to cone density.

Parameters
[in]radius
[in]density

Definition at line 468 of file physxUtilLib.cxx.

References compute_cone_density().

Referenced by compute_cylinder_density().

◆ compute_cylinder_density()

float PhysxUtilLib::compute_cylinder_density ( float  radius,
float  length,
float  mass 
)

Computes density of a homogeneous cylinder according to cylinder mass.

Parameters
[in]radius
[in]mass

Definition at line 453 of file physxUtilLib.cxx.

References compute_cone_mass().

Referenced by compute_cylinder_mass().

◆ compute_cylinder_mass()

float PhysxUtilLib::compute_cylinder_mass ( float  radius,
float  length,
float  density 
)

Computes mass of a homogeneous cylinder according to cylinder density.

Parameters
[in]radius
[in]density

Definition at line 438 of file physxUtilLib.cxx.

References compute_cylinder_density().

Referenced by compute_ellipsoid_density().

◆ compute_distance_squared()

float PhysxUtilLib::compute_distance_squared ( const PhysxRay ray,
const LPoint3f point 
)

Compute the distance squared from a point to a ray.

Parameters
[in]ray
[in]point

Definition at line 254 of file physxUtilLib.cxx.

References compute_square_distance(), and PhysxManager::point3_to_nxVec3().

Referenced by compute_box_around_capsule().

◆ compute_ellipsoid_density()

float PhysxUtilLib::compute_ellipsoid_density ( const LVector3f extents,
float  mass 
)

Computes density of a homogeneous ellipsoid according to ellipsoid mass.

Parameters
[in]radius
[in]mass

Definition at line 423 of file physxUtilLib.cxx.

References compute_cylinder_mass(), and PhysxManager::vec3_to_nxVec3().

Referenced by compute_ellipsoid_mass().

◆ compute_ellipsoid_mass()

float PhysxUtilLib::compute_ellipsoid_mass ( const LVector3f extents,
float  density 
)

Computes mass of a homogeneous ellipsoid according to ellipsoid density.

Parameters
[in]radius
[in]density

Definition at line 408 of file physxUtilLib.cxx.

References compute_ellipsoid_density(), and PhysxManager::vec3_to_nxVec3().

Referenced by compute_box_density().

◆ compute_sphere_density()

float PhysxUtilLib::compute_sphere_density ( float  radius,
float  mass 
)

Computes density of a homogeneous sphere according to sphere mass.

Parameters
[in]radius
[in]mass

Definition at line 363 of file physxUtilLib.cxx.

References compute_box_mass().

Referenced by compute_sphere_mass().

◆ compute_sphere_inertia_tensor()

LVector3f PhysxUtilLib::compute_sphere_inertia_tensor ( float  mass,
float  radius,
bool  hollow 
)

Computes diagonalized inertia tensor for a sphere.

Parameters
[in]mass
[in]radius
[in]hollow

Definition at line 516 of file physxUtilLib.cxx.

References box_box_intersect(), and PhysxManager::nxVec3_to_vec3().

Referenced by compute_box_inertia_tensor().

◆ compute_sphere_mass()

float PhysxUtilLib::compute_sphere_mass ( float  radius,
float  density 
)

Computes mass of a homogeneous sphere according to sphere density.

Parameters
[in]radius
[in]density

Definition at line 348 of file physxUtilLib.cxx.

References compute_sphere_density().

Referenced by find_rotation_matrix().

◆ compute_square_distance()

float PhysxUtilLib::compute_square_distance ( const PhysxSegment seg,
const LPoint3f point 
)

Compute the distance squared from a point to a line segment.

Parameters
[in]seg
[in]point

Definition at line 270 of file physxUtilLib.cxx.

References merge_spheres(), and PhysxManager::point3_to_nxVec3().

Referenced by compute_distance_squared().

◆ create_box()

PhysxBox PhysxUtilLib::create_box ( const PhysxBounds3 aabb,
const LMatrix4f mat 
)

Create an oriented box from an axis aligned box and a transformation.

Parameters
[in]aabb
[in]mat

Definition at line 170 of file physxUtilLib.cxx.

References compute_box_world_edge_normal(), and PhysxManager::mat4_to_nxMat34().

Referenced by box_contains_point().

◆ find_rotation_matrix()

LMatrix3f PhysxUtilLib::find_rotation_matrix ( const LVector3f x,
const LVector3f b 
)

Computes a rotation matrix M so that: M * x = b (x and b are unit vectors).

Parameters
[in]x
[in]b

Definition at line 329 of file physxUtilLib.cxx.

References compute_sphere_mass(), PhysxManager::nxMat33_to_mat3(), and PhysxManager::vec3_to_nxVec3().

Referenced by normal_to_tangents().

◆ int_ceil()

int PhysxUtilLib::int_ceil ( const float &  f)

Convert a floating point number to an integer.

Definition at line 119 of file physxUtilLib.cxx.

References int_chop().

Referenced by set_fpu_rounding_up().

◆ int_chop()

int PhysxUtilLib::int_chop ( const float &  f)

Convert a floating point number to an integer.

Definition at line 130 of file physxUtilLib.cxx.

References int_floor().

Referenced by int_ceil().

◆ int_floor()

int PhysxUtilLib::int_floor ( const float &  f)

Convert a floating point number to an integer.

Definition at line 141 of file physxUtilLib.cxx.

References box_contains_point().

Referenced by int_chop().

◆ is_box_a_inside_box_b()

bool PhysxUtilLib::is_box_a_inside_box_b ( const PhysxBox a,
const PhysxBox b 
)

Test if box A is inside another box B.

Returns TRUE if box A is inside box B.

Parameters
[in]a
[in]b

Definition at line 224 of file physxUtilLib.cxx.

References compute_box_around_capsule().

Referenced by compute_capsule_around_box().

◆ merge_spheres()

PhysxSphere PhysxUtilLib::merge_spheres ( const PhysxSphere sphere0,
const PhysxSphere sphere1 
)

Compute an overall bounding sphere for a pair of spheres.

Parameters
[in]sphere0
[in]sphere1

Definition at line 286 of file physxUtilLib.cxx.

References normal_to_tangents().

Referenced by compute_square_distance().

◆ normal_to_tangents()

void PhysxUtilLib::normal_to_tangents ( const LVector3f n,
LVector3f t1,
LVector3f t2 
)

Get the tangent vectors associated with a normal.

Parameters
[in]n
[out]t1
[out]t2

Definition at line 303 of file physxUtilLib.cxx.

References find_rotation_matrix(), and PhysxManager::vec3_to_nxVec3().

Referenced by merge_spheres().

◆ point_obb_sqr_dist()

float PhysxUtilLib::point_obb_sqr_dist ( const LPoint3f point,
const LPoint3f center,
const LVector3f extents,
const LMatrix3f rot,
LPoint3f params 
)

Point-vs-OBB distance computation.

Returns distance between a point and an OBB.

Parameters
[in]pointThe point
[in]centerOBB center
[in]extentsOBB extents
[in]rotOBB rotation
[out]paramsClosest point on the box, in box space

Definition at line 1053 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), PhysxManager::point3_to_nxVec3(), and PhysxManager::vec3_to_nxVec3().

Referenced by sweep_box_box().

◆ ray_aabb_intersect()

bool PhysxUtilLib::ray_aabb_intersect ( const LPoint3f min,
const LPoint3f max,
const LPoint3f origin,
const LVector3f dir,
LPoint3f coord 
)

Ray-AABB intersection test.

Also computes intersection point.

Parameters
[in]min
[in]max
[in]origin
[in]dir
[out]coord

Definition at line 690 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), segment_obb_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by segment_box_intersect().

◆ ray_capsule_intersect()

unsigned int PhysxUtilLib::ray_capsule_intersect ( const LPoint3f origin,
const LVector3f dir,
const PhysxCapsule capsule 
)

Ray-capsule intersection test.

Returns number of intersection points (0,1 or 2) along the ray.

Parameters
[in]origin
[in]dir
[in]capsule

Definition at line 801 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), swept_spheres_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by ray_obb_intersect().

◆ ray_obb_intersect()

bool PhysxUtilLib::ray_obb_intersect ( const PhysxRay ray,
const LPoint3f center,
const LVector3f extents,
const LMatrix3f rot 
)

Boolean ray-OBB intersection test.

Based on separating axis theorem.

Parameters
[in]ray
[in]center
[in]extents
[in]rot

Definition at line 777 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), PhysxManager::point3_to_nxVec3(), and ray_capsule_intersect().

Referenced by segment_aabb_intersect().

◆ ray_plane_intersect()

bool PhysxUtilLib::ray_plane_intersect ( const PhysxRay ray,
const PhysxPlane plane,
LPoint3f point_on_plane 
)

Ray-plane intersection test.

Parameters
[in]ray
[in]plane
[out]point_on_plane

Definition at line 596 of file physxUtilLib.cxx.

References ray_sphere_intersect().

Referenced by tri_box_intersect().

◆ ray_sphere_intersect()

bool PhysxUtilLib::ray_sphere_intersect ( const LPoint3f origin,
const LVector3f dir,
float  length,
const LPoint3f center,
float  radius,
LPoint3f hit_pos 
)

Ray-sphere intersection test.

Returns true if the ray intersects the sphere, and the impact point if needed.

Parameters
[in]origin
[in]dir
[in]length
[in]center
[in]radius
[out]hit_pos

Definition at line 622 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), segment_box_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by ray_plane_intersect().

◆ ray_tri_intersect()

bool PhysxUtilLib::ray_tri_intersect ( const LPoint3f orig,
const LVector3f dir,
const LPoint3f vert0,
const LPoint3f vert1,
const LPoint3f vert2,
LVector3f hit,
bool  cull 
)

Ray-triangle intersection test.

Returns impact distance (t) as well as barycentric coordinates (u,v) of impact point. The test performs back face culling or not according to 'cull'.

Parameters
[in]orig
[in]dir
[in]vert0
[in]vert1
[in]vert2
[out]hit,withcoordinates (t,u,v)
[in]cull

Definition at line 856 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), sweep_box_capsule(), and PhysxManager::vec3_to_nxVec3().

Referenced by swept_spheres_intersect().

◆ segment_aabb_intersect()

bool PhysxUtilLib::segment_aabb_intersect ( const LPoint3f p0,
const LPoint3f p1,
const LPoint3f min,
const LPoint3f max 
)

Boolean segment-AABB intersection test.

Based on separating axis theorem.

Parameters
[in]p0
[in]p1
[in]min
[in]max

Definition at line 751 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), and ray_obb_intersect().

Referenced by segment_obb_intersect().

◆ segment_box_intersect()

bool PhysxUtilLib::segment_box_intersect ( const LPoint3f p1,
const LPoint3f p2,
const LPoint3f bbox_min,
const LPoint3f bbox_max,
LPoint3f intercept 
)

Segment-AABB intersection test.

Also computes intersection point.

Parameters
[in]p1
[in]p2
[in]bbox_min
[in]bbox_max
[out]intercept

Definition at line 657 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), and ray_aabb_intersect().

Referenced by ray_sphere_intersect().

◆ segment_obb_intersect()

bool PhysxUtilLib::segment_obb_intersect ( const LPoint3f p0,
const LPoint3f p1,
const LPoint3f center,
const LVector3f extents,
const LMatrix3f rot 
)

Boolean segment-OBB intersection test.

Based on separating axis theorem.

Parameters
[in]p0
[in]p1
[in]center
[in]extents
[in]rot

Definition at line 723 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), LMatrix3f::is_nan(), PhysxManager::mat3_to_nxMat33(), PhysxManager::point3_to_nxVec3(), segment_aabb_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by ray_aabb_intersect().

◆ set_fpu_exceptions()

void PhysxUtilLib::set_fpu_exceptions ( bool  b)

Set FPU precision.

Definition at line 31 of file physxUtilLib.cxx.

References set_fpu_precision24().

◆ set_fpu_precision24()

void PhysxUtilLib::set_fpu_precision24 ( )

Set FPU precision.

Definition at line 42 of file physxUtilLib.cxx.

References set_fpu_precision53().

Referenced by set_fpu_exceptions().

◆ set_fpu_precision53()

void PhysxUtilLib::set_fpu_precision53 ( )

Set FPU precision.

Definition at line 53 of file physxUtilLib.cxx.

References set_fpu_precision64().

Referenced by set_fpu_precision24().

◆ set_fpu_precision64()

void PhysxUtilLib::set_fpu_precision64 ( )

Set FPU precision.

Definition at line 64 of file physxUtilLib.cxx.

References set_fpu_rounding_chop().

Referenced by set_fpu_precision53().

◆ set_fpu_rounding_chop()

void PhysxUtilLib::set_fpu_rounding_chop ( )

Set FPU precision.

Definition at line 75 of file physxUtilLib.cxx.

References set_fpu_rounding_down().

Referenced by set_fpu_precision64().

◆ set_fpu_rounding_down()

void PhysxUtilLib::set_fpu_rounding_down ( )

Set FPU rounding mode.

Definition at line 86 of file physxUtilLib.cxx.

References set_fpu_rounding_near().

Referenced by set_fpu_rounding_chop().

◆ set_fpu_rounding_near()

void PhysxUtilLib::set_fpu_rounding_near ( )

Set FPU rounding mode.

Definition at line 97 of file physxUtilLib.cxx.

References set_fpu_rounding_up().

Referenced by set_fpu_rounding_down().

◆ set_fpu_rounding_up()

void PhysxUtilLib::set_fpu_rounding_up ( )

Set FPU rounding mode.

Definition at line 108 of file physxUtilLib.cxx.

References int_ceil().

Referenced by set_fpu_rounding_near().

◆ sweep_box_box()

bool PhysxUtilLib::sweep_box_box ( const PhysxBox box0,
const PhysxBox box1,
const LVector3f dir,
float  length,
LPoint3f ip,
LVector3f normal 
)

Box-vs-box sweep test.

Sweeps a box against a box, returns true if box hit the other box. Also returns contact information.

Parameters
[in]box0
[in]box1
[in]dirUnit-length sweep direction
[in]lengthLength of sweep
[out]ipImpact point
[out]normalNormal at impact point

Definition at line 1022 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), point_obb_sqr_dist(), and PhysxManager::vec3_to_nxVec3().

Referenced by sweep_sphere_capsule().

◆ sweep_box_capsule()

bool PhysxUtilLib::sweep_box_capsule ( const PhysxBox box,
const PhysxCapsule lss,
const LVector3f dir,
float  length,
LVector3f normal 
)

Box-vs-capsule sweep test.

Sweeps a box against a capsule, returns true if box hit the capsule. Also returns contact information.

Parameters
[in]boxBox
[in]lssCapsule
[in]dirUnit-length sweep direction
[in]lengthLength of sweep
[out]normalNormal at impact point

Definition at line 895 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), sweep_box_sphere(), and PhysxManager::vec3_to_nxVec3().

Referenced by ray_tri_intersect().

◆ sweep_box_sphere()

bool PhysxUtilLib::sweep_box_sphere ( const PhysxBox box,
const PhysxSphere sphere,
const LVector3f dir,
float  length,
LVector3f normal 
)

Box-vs-sphere sweep test.

Sweeps a box against a sphere, returns true if box hit the sphere. Also returns contact information.

Parameters
[in]boxBox
[in]sphereSphere
[in]dirUnit-length sweep direction
[in]lengthLength of sweep
[out]normalNormal at impact point

Definition at line 925 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), sweep_capsule_capsule(), and PhysxManager::vec3_to_nxVec3().

Referenced by sweep_box_capsule().

◆ sweep_capsule_capsule()

bool PhysxUtilLib::sweep_capsule_capsule ( const PhysxCapsule lss0,
const PhysxCapsule lss1,
const LVector3f dir,
float  length,
LPoint3f ip,
LVector3f normal 
)

Capsule-vs-capsule sweep test.

Sweeps a capsule against a capsule, returns true if capsule hit the other capsule. Also returns contact information.

Parameters
[in]lss0
[in]lss1
[in]dirUnit-length sweep direction
[in]lengthLength of sweep
[out]ipImpact point
[out]normalNormal at impact point

Definition at line 956 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), sweep_sphere_capsule(), and PhysxManager::vec3_to_nxVec3().

Referenced by sweep_box_sphere().

◆ sweep_sphere_capsule()

bool PhysxUtilLib::sweep_sphere_capsule ( const PhysxSphere sphere,
const PhysxCapsule lss,
const LVector3f dir,
float  length,
LPoint3f ip,
LVector3f normal 
)

Sphere-vs-capsule sweep test.

Sweeps a sphere against a capsule, returns true if sphere hit the capsule. Also returns contact information.

Parameters
[in]sphere
[in]lss
[in]dirUnit-length sweep direction
[in]lengthLength of sweep
[out]ipImpact point
[out]normalNormal at impact point

Definition at line 989 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), sweep_box_box(), and PhysxManager::vec3_to_nxVec3().

Referenced by sweep_capsule_capsule().

◆ swept_spheres_intersect()

bool PhysxUtilLib::swept_spheres_intersect ( const PhysxSphere sphere0,
const LVector3f velocity0,
const PhysxSphere sphere1,
const LVector3f velocity1 
)

Sphere-sphere sweep test.

Returns true if spheres intersect during their linear motion along provided velocity vectors.

Parameters
[in]sphere0
[in]velocity0
[in]sphere1
[in]velocity1

Definition at line 827 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), ray_tri_intersect(), and PhysxManager::vec3_to_nxVec3().

Referenced by ray_capsule_intersect().

◆ tri_box_intersect()

bool PhysxUtilLib::tri_box_intersect ( const LPoint3f vertex0,
const LPoint3f vertex1,
const LPoint3f vertex2,
const LPoint3f center,
const LVector3f extents 
)

Boolean intersection test between a triangle and a box.

Parameters
[in]vertex0
[in]vertex1
[in]vertex2
[in]center
[in]extents

Definition at line 570 of file physxUtilLib.cxx.

References LVecBase3f::is_nan(), PhysxManager::point3_to_nxVec3(), and ray_plane_intersect().

Referenced by box_box_intersect().


The documentation for this class was generated from the following files: