< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_physx3 library

Description

gh_physx3 is the module that manages NVIDIA PhysX 3 engine. Thanks to gh_physx3, you will be able to create rigid bodies and do collisions, create particles and fluids, creates clothes and joints.


Number of functions: 76

  1. gh_physx3.actor_add_force (Lua - Python)
  2. gh_physx3.actor_add_force_at_position (Lua - Python)
  3. gh_physx3.actor_apply_transform (Lua - Python)
  4. gh_physx3.actor_get_position (Lua - Python)
  5. gh_physx3.actor_get_orientation (Lua - Python)
  6. gh_physx3.actor_get_sleep_threshold (Lua - Python)
  7. gh_physx3.actor_is_sleeping (Lua - Python)
  8. gh_physx3.actor_kill (Lua - Python)
  9. gh_physx3.actor_put_to_sleep (Lua - Python)
  10. gh_physx3.actor_set_angular_damping (Lua - Python)
  11. gh_physx3.actor_set_angular_velocity (Lua - Python)
  12. gh_physx3.actor_get_angular_velocity (Lua - Python)
  13. gh_physx3.actor_get_angular_speed2 (Lua - Python)
  14. gh_physx3.actor_set_euler_angles (Lua - Python)
  15. gh_physx3.actor_set_gravity_state (Lua - Python)
  16. gh_physx3.actor_set_kinematic_state (Lua - Python)
  17. gh_physx3.actor_set_kinematic_target (Lua - Python)
  18. gh_physx3.actor_set_linear_damping (Lua - Python)
  19. gh_physx3.actor_set_linear_velocity (Lua - Python)
  20. gh_physx3.actor_get_linear_velocity (Lua - Python)
  21. gh_physx3.actor_get_linear_speed2 (Lua - Python)
  22. gh_physx3.actor_set_orientation (Lua - Python)
  23. gh_physx3.actor_set_position (Lua - Python)
  24. gh_physx3.actor_set_sleep_threshold (Lua - Python)
  25. gh_physx3.actor_wake_up (Lua - Python)
  26. gh_physx3.actor_clear_forces (Lua - Python)
  27. gh_physx3.cloth_create_from_mesh (Lua - Python)
  28. gh_physx3.cloth_is_running_on_gpu (Lua - Python)
  29. gh_physx3.cloth_set_external_acceleration (Lua - Python)
  30. gh_physx3.cloth_set_gpu_state (Lua - Python)
  31. gh_physx3.cloth_set_stiffness (Lua - Python)
  32. gh_physx3.cloth_update_mesh_vertex_data (Lua - Python)
  33. gh_physx3.cloth_update_particles_from_mesh_particles (Lua - Python)
  34. gh_physx3.create_actor_box (Lua - Python)
  35. gh_physx3.create_actor_capsule (Lua - Python)
  36. gh_physx3.create_actor_mesh (Lua - Python)
  37. gh_physx3.create_actor_mesh_v2 (Lua - Python)
  38. gh_physx3.create_actor_plane (Lua - Python)
  39. gh_physx3.create_actor_sphere (Lua - Python)
  40. gh_physx3.create_material (Lua - Python)
  41. gh_physx3.update_material (Lua - Python)
  42. gh_physx3.kill_material (Lua - Python)
  43. gh_physx3.actor_set_material (Lua - Python)
  44. gh_physx3.actor_update_mass (Lua - Python)
  45. gh_physx3.create_scene (Lua - Python)
  46. gh_physx3.create_scene_broadphase_sap (Lua - Python)
  47. gh_physx3.create_scene_broadphase_mbp (Lua - Python)
  48. gh_physx3.create_scene_broadphase_gpu (Lua - Python)
  49. gh_physx3.actor_set_3d_object (Lua - Python)
  50. gh_physx3.scene_sync_3d_objects (Lua - Python)
  51. gh_physx3.gpu_get_clock_frequency_khz (Lua - Python)
  52. gh_physx3.gpu_get_name (Lua - Python)
  53. gh_physx3.gpu_get_num_multiprocessors (Lua - Python)
  54. gh_physx3.gpu_get_total_memory_size_mb (Lua - Python)
  55. gh_physx3.gpu_is_supported (Lua - Python)
  56. gh_physx3.joint_create (Lua - Python)
  57. gh_physx3.joint_distance_set_distances (Lua - Python)
  58. gh_physx3.joint_distance_set_spring (Lua - Python)
  59. gh_physx3.joint_kill (Lua - Python)
  60. gh_physx3.joint_prismatic_set_limits (Lua - Python)
  61. gh_physx3.joint_revolute_set_rotational_limits (Lua - Python)
  62. gh_physx3.joint_revolute_set_angular_limits (Lua - Python)
  63. gh_physx3.joint_set_break_force (Lua - Python)
  64. gh_physx3.joint_set_motor_params (Lua - Python)
  65. gh_physx3.joint_spherical_set_limit_cone (Lua - Python)
  66. gh_physx3.particle_system_create (Lua - Python)
  67. gh_physx3.particle_system_create_fluid (Lua - Python)
  68. gh_physx3.particle_system_from_gxc_ps (Lua - Python)
  69. gh_physx3.particle_system_position_from_vertex_pool (Lua - Python)
  70. gh_physx3.particle_system_position_to_vertex_pool (Lua - Python)
  71. gh_physx3.particle_system_to_gxc_ps (Lua - Python)
  72. gh_physx3.run_simulation (Lua - Python)
  73. gh_physx3.set_simulation_scales (Lua - Python)
  74. gh_physx3.set_scene_gravity (Lua - Python)
  75. gh_physx3.start (Lua - Python)
  76. gh_physx3.stop (Lua - Python)



actor_add_force

Description

adds a force to an actor.


Syntax

gh_physx3.actor_add_force(
 px_actor,
 fx, fy, fz
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_add_force(px_actor, fx, fy, fz)
            


actor_add_force_at_position

Description

adds a force to an actor at a particular position.


Syntax

gh_physx3.actor_add_force_at_position(
 px_actor,
 fx, fy, fz,
 px, py, pz
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_add_force_at_position(px_actor, fx, fy, fz, px, py, pz)
            


actor_apply_transform

Description

applies the transformation (position + orientation) of an PhysX actor to a regular 3D object (a mesh for example).


Syntax

gh_physx3.actor_apply_transform(
 px_actor,
 object
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_apply_transform(px_actor, object)
            


actor_get_position

Description

gets the global position of an actor.


Syntax

x, y, z = gh_physx3.actor_get_position(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
x, y, z = gh_physx3.actor_get_position(px_actor)
            


actor_get_orientation

Description

gets the orientation of an actor (a quaternion).


Syntax

x, y, z, w = gh_physx3.actor_get_orientation(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
x, y, z, w = gh_physx3.actor_get_orientation(px_actor)
            


actor_get_sleep_threshold

Description

gets the sleep threshold.


Syntax

thres = gh_physx3.actor_get_sleep_threshold(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
t = gh_physx3.actor_get_sleep_threshold(px_actor)
            


actor_is_sleeping

Description

gets the sleeping state of an actor.


Syntax

state = gh_physx3.actor_is_sleeping(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
is_sleeping = gh_physx3.actor_is_sleeping(px_actor)
            


actor_kill

Description

destroys an actor.


Syntax

gh_physx3.actor_kill(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_kill(px_actor)
            


actor_put_to_sleep

Description

forces an actor to sleep.


Syntax

gh_physx3.actor_put_to_sleep(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_put_to_sleep(px_actor)
            


actor_set_angular_damping

Description

sets the angular damping of an actor.


Syntax

gh_physx3.actor_set_angular_damping(
 px_actor,
 damping
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_angular_damping(px_actor, 0.2)
            


actor_set_angular_velocity

Description

sets the angular velocity of an actor.


Syntax

gh_physx3.actor_set_angular_velocity(
 px_actor,
 vx, vy, vz
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_angular_velocity(px_actor, 0.8, 12, 1.6)
            


actor_get_angular_velocity

Description

Gets the angular velocity of an actor.


Syntax

x, y, z = gh_physx3.actor_get_angular_velocity(
 aid
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
x, y, z = gh_physx3.actor_get_angular_velocity(aid)
            


actor_get_angular_speed2

Description

Gets the squared angular speed of an actor.


Syntax

s = gh_physx3.actor_get_angular_speed2(
 aid
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
s = gh_physx3.actor_get_angular_speed2(aid)
            


actor_set_euler_angles

Description

sets the orientation of an actor using Euler's angles.


Syntax

gh_physx3.actor_set_euler_angles(
 px_actor,
 pitch, yaw, roll
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_euler_angles(px_actor, 90, 0, 0)
            


actor_set_gravity_state

Description

sets the gravity state of an actor.


Syntax

gh_physx3.actor_set_gravity_state(
 px_actor,
 state
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_gravity_state(px_actor, 1)
            


actor_set_kinematic_state

Description

sets the kinematic state of an actor.


Syntax

gh_physx3.actor_set_kinematic_state(
 px_actor,
 state
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_kinematic_state(px_actor, 1)
            


actor_set_kinematic_target

Description

moves kinematically controlled dynamic actors through the 3d world.


Syntax

gh_physx3.actor_set_kinematic_target(
 px_actor,
 px, py, pz,
 pitch, yaw, roll
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_kinematic_target(px_actor, px, py, pz, pitch, yaw, roll)
            


actor_set_linear_damping

Description

sets the linear damping of an actor.


Syntax

gh_physx3.actor_set_linear_damping(
 px_actor,
 damping
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_linear_damping(px_actor, 0.2)
            


actor_set_linear_velocity

Description

sets the linear velocity of an actor.


Syntax

gh_physx3.actor_set_linear_velocity(
 px_actor,
 vx, vy, vz
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_linear_velocity(px_actor, 10, 10, 10)
            


actor_get_linear_velocity

Description

Gets the linear velocity of an actor.


Syntax

x, y, z = gh_physx3.actor_get_linear_velocity(
 aid
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
x, y, z = ggh_physx3.actor_get_linear_velocity(aid)
            


actor_get_linear_speed2

Description

Gets the squared linear speed of an actor.


Syntax

s = gh_physx3.actor_get_linear_speed2(
 aid
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
s = gh_physx3.actor_get_linear_speed2(aid)
            


actor_set_orientation

Description

sets the orientation of an actor (a quaternion).


Syntax

gh_physx3.actor_set_orientation(
 px_actor,
 x, y, z, w
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_orientation(px_actor, x, y, z, w)
            


actor_set_position

Description

sets the global position of an actor.


Syntax

gh_physx3.actor_set_position(
 px_actor,
 x, y, z
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_position(px_actor, x, y, z)
            


actor_set_sleep_threshold

Description

sets the sleep threshold.


Syntax

gh_physx3.actor_set_sleep_threshold(
 px_actor,
 thres
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_sleep_threshold(px_actor, 0.2)
            


actor_wake_up

Description

wakes up an actor.


Syntax

gh_physx3.actor_wake_up(
 px_actor,
 sleep_counter
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_wake_up(px_actor, 1)
            


actor_clear_forces

Description

Clears (resets) all forces that act on an actor.


Syntax

gh_physx3.actor_clear_forces(
 aid
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_clear_forces(aid)
            


cloth_create_from_mesh

Description

creates a PhysX cloth from a mesh.


Syntax

px_actor = gh_physx3.cloth_create_from_mesh(
 px_scene,
 mesh,
 gpu_cloth,
 x, y, z,
 pitch, yaw, roll,
 gx, gy, gz
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor = gh_physx3.cloth_create_from_mesh(px_scene, mesh, gpu_cloth, x, y, z, pitch. yaw, roll, gravity_x, gravity_y, gravity_z)
            


cloth_is_running_on_gpu

Description

gets the GPU state of a cloth actor.


Syntax

state = gh_physx3.cloth_is_running_on_gpu(
 px_actor
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
state = gh_physx3.cloth_is_running_on_gpu(px_actor)
            


cloth_set_external_acceleration

Description

sets the external acceleration to a PhysX cloth actor.


Syntax

gh_physx3.cloth_set_external_acceleration(
 px_actor,
 x, y, z
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.cloth_set_external_acceleration(px_actor, x, y, z)
            


cloth_set_gpu_state

Description

sets the GPU state of a cloth actor.


Syntax

gh_physx3.cloth_set_gpu_state(
 px_actor,
 state
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.cloth_set_gpu_state(px_actor, state)
            


cloth_set_stiffness

Description

sets the cloth stiffness.


Syntax

gh_physx3.cloth_set_stiffness(
 px_actor,
 stiffness
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.cloth_set_stiffness(px_actor, stiffness)
            


cloth_update_mesh_vertex_data

Description

updates a mesh data (positions + normals ) from a PhysX cloth actor.


Syntax

gh_physx3.cloth_update_mesh_vertex_data(
 px_actor,
 mesh,
 update_position,
 update_normals
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.cloth_update_mesh_vertex_data(px_actor, mesh, 1, 0)
            


cloth_update_particles_from_mesh_particles

Description

updates a PhysX cloth actor from a mesh.


Syntax

gh_physx3.cloth_update_particles_from_mesh_particles(
 px_actor,
 mesh
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.cloth_update_particles_from_mesh_particles(px_actor, mesh)
            


create_actor_box

Description

creates a box actor.


Syntax

px_actor = gh_physx3.create_actor_box(
 px_scene,
 w, h, d,
 px, py, pz,
 density,
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor_box = gh_physx3.create_actor_box(px_scene, 4, 4, 4, 0, 0, 0, density, px_material)
            


create_actor_capsule

Description

creates a capsule actor.


Syntax

px_actor = gh_physx3.create_actor_capsule(
 px_scene,
 radius,
 half_height,
 px, py, pz,
 density,
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor_capsule = gh_physx3.create_actor_capsule(px_scene, radius, half_height, 0, 0, 0, density, px_material)
            


create_actor_mesh

Description

creates an actor from a mesh.


Syntax

px_actor = gh_physx3.create_actor_mesh(
 px_scene,
 mesh_id,
 px, py, pz,
 density,
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor_mesh = gh_physx3.create_actor_mesh(px_scene, mesh, 0, 0, 0, density, px_material)
            


create_actor_mesh_v2

Description

creates an actor from a mesh. You can specify if the mesh is convex or not. Only vertices of a convex mesh are used by PhysX. To be GPU friendly, the number of vertices must not exceed 64.


Syntax

px_actor = gh_physx3.create_actor_mesh_v2(
 px_scene,
 mesh_id,
 px, py, pz,
 density,
 material,
 convex
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
convex = 1            
px_actor_mesh = gh_physx3.create_actor_mesh_v2(px_scene, mesh, 0, 0, 0, density, px_material, convex)
            


create_actor_plane

Description

creates a plane actor.


Syntax

px_actor = gh_physx3.create_actor_plane(
 px_scene,
 nx, ny, nz, d,
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor_plane = gh_physx3.create_actor_plane(px_scene, 0, 1, 0, 0, px_material)
            


create_actor_sphere

Description

creates a sphere actor.


Syntax

px_actor = gh_physx3.create_actor_sphere(
 px_scene,
 radius,
 px, py, pz,
 density,
 material
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_actor_plane = gh_physx3.create_actor_sphere(px_scene, 10, 0, 0, 0, density, px_material)
            


create_material

Description

creates a physx material.


Syntax

px_material = gh_physx3.create_material(
 static_friction,
 dynamic_friction,
 resilience
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_material = gh_physx3.create_material(0.5, 0.5, 0.5)
            


update_material

Description

updates the properties of a material


Syntax

gh_physx3.update_material(
 mid,
 static_friction,
 dynamic_friction,
 resilience
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
static_friction = 0.5
dynamic_friction = 0.5
resilience = 0.9
gh_physx3.update_material(mid, static_friction, dynamic_friction, resilience)
            


kill_material

Description

destroys a material


Syntax

gh_physx3.kill_material(
 mid
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.kill_material(mid)
            


actor_set_material

Description

sets a material to an actor


Syntax

gh_physx3.actor_set_material(
 aid,
 mid
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_material(aid, mid)
            


actor_update_mass

Description

update the mass of an actor from the density


Syntax

gh_physx3.actor_update_mass(
 aid,
 density
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_update_mass(aid, density)
            


create_scene

Description

creates a physx scene - DEPRECATED


Syntax

px_scene = gh_physx3.create_scene(
 gpu_physx,
 bounce_threshold_velocity
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
bounce_threshold_velocity = 0.2
px_scene = gh_physx3.create_scene(1, bounce_threshold_velocity)
            


create_scene_broadphase_sap

Description

creates a CPU physx scene with SAP (Sweep and Prune) broadphase algorithm.


Syntax

px_scene = gh_physx3.create_scene_broadphase_sap(
 bounce_threshold_velocity,
 enable_ccd,
 enable_contact_reporting,
 enable_stabilization
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
bounce_threshold_velocity = 0.2
enable_ccd = 1
enable_contact_reporting = 0
enable_stabilization = 1
px_scene = gh_physx3.create_scene_broadphase_sap(bounce_threshold_velocity, enable_ccd, enable_contact_reporting, enable_stabilization)
            


create_scene_broadphase_mbp

Description

creates a CPU physx scene with MBP (Multi-Box Pruning) broadphase algorithm.


Syntax

px_scene = gh_physx3.create_scene_broadphase_mbp(
 bounce_threshold_velocity,
 enable_ccd,
 enable_contact_reporting,
 enable_stabilization,
 minX, minY, minZ,
 maxX, maxY, maxZ
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
bounce_threshold_velocity = 0.2
enable_ccd = 1
enable_contact_reporting = 0
enable_stabilization = 1

minX = -100
minY = 0
minZ = -100

maxX = 100, 
maxY = 100
maxZ = 100
px_scene = gh_physx3.create_scene_broadphase_mbp(bounce_threshold_velocity, enable_ccd, enable_contact_reporting, enable_stabilization, minX, minY, minZ, maxX, maxY, maxZ)
            


create_scene_broadphase_gpu

Description

creates a GPU physx scene.


Syntax

px_scene = gh_physx3.create_scene_broadphase_gpu(
 bounce_threshold_velocity,
 enable_ccd,
 enable_contact_reporting,
 enable_stabilization
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
bounce_threshold_velocity = 0.2
enable_ccd = 1
enable_contact_reporting = 0
enable_stabilization = 1
px_scene = gh_physx3.create_scene_broadphase_gpu(bounce_threshold_velocity, enable_ccd, enable_contact_reporting, enable_stabilization)
            


actor_set_3d_object

Description

Allows to associate a physics actor and a 3D object. Useful for the scene_sync_3d_objects() function.


Syntax

gh_physx3.actor_set_3d_object(
 aid,
 oid
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.actor_set_3d_object(aid, oid)
            


scene_sync_3d_objects

Description

Synchronizes physics and graphics objects. A physcis actor is associated to a 3D object using the actor_set_3d_object() function


Syntax

gh_physx3.scene_sync_3d_objects(
 sid
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.scene_sync_3d_objects(sid)
            


gpu_get_clock_frequency_khz

Description

gets the clock speed of the PhysX GPU.


Syntax

clock = gh_physx3.gpu_get_clock_frequency_khz()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
clock = gh_physx3.gpu_get_clock_frequency_khz()
            


gpu_get_name

Description

gets the name of the PhysX GPU.


Syntax

name = gh_physx3.gpu_get_name()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
gpu_name = gh_physx3.gpu_get_name()
            


gpu_get_num_multiprocessors

Description

gets the number of SMs of the PhysX GPU.


Syntax

sm = gh_physx3.gpu_get_num_multiprocessors()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
gpu_sm = gh_physx3.gpu_get_num_multiprocessors()
            


gpu_get_total_memory_size_mb

Description

gets the size of the PhysX GPU memory.


Syntax

size = gh_physx3.gpu_get_total_memory_size_mb()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
size = gh_physx3.gpu_get_total_memory_size_mb()
            


gpu_is_supported

Description

checks for PhysX GPU support (Windows only).


Syntax

ret = gh_physx3.gpu_is_supported()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
gpu_physx = gh_physx3.gpu_is_supported()
            


joint_create

Description

creates a PhysX joint between two PhysX actors.


Syntax

px_joint = gh_physx3.joint_create(
 px_scene,
 joint_type,
 px_actor1,
 x1, y1, z1,
 pitch1, yaw1, roll1,
 px_actor2,
 x2, y2, z2,
 pitch2, yaw2, roll2
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_joint = gh_physx3.joint_create(px_scene, joint_type, px_actor1, x1, y1, z1, pitch1, yaw1, roll1, px_actor2, x2, y2, z2, pitch2, yaw2, roll2)
            


joint_distance_set_distances

Description

Sets distance joint distance range.


Syntax

gh_physx3.joint_distance_set_distances(
 px_joint,
 min_distance, max_distance
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_distance_set_distances(px_joint, min_distance, max_distance)
            


joint_distance_set_spring

Description

Sets distance joint spring parameters.


Syntax

gh_physx3.joint_distance_set_spring(
 px_joint,
 spring_coef, damping_coef
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_distance_set_spring(px_joint, spring_coef, damping_coef)
            


joint_kill

Description

kills a PhysX joint.


Syntax

gh_physx3.joint_kill(
 px_joint
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_kill(px_joint)
            


joint_prismatic_set_limits

Description

Sets prismatic joint parameters.


Syntax

gh_physx3.joint_prismatic_set_limits(
 px_joint,
 lower_limit, upper_limit,
 limit_contact_distance
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_prismatic_set_limits(px_joint, lower_limit, upper_limit, limit_contact_distance)
            


joint_revolute_set_rotational_limits

Description

Sets revolute joint parameters.


Syntax

gh_physx3.joint_revolute_set_rotational_limits(
 px_joint,
 lower_limit, upper_limit,
 limit_contact_distance
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_revolute_set_rotational_limits(px_joint, lower_limit, upper_limit, limit_contact_distance)
            


joint_revolute_set_angular_limits

Description

Sets revolute joint angular limits.


Syntax

gh_physx3.joint_revolute_set_angular_limits(
 px_joint,
 lower_limit, upper_limit,
 limit_contact_distance,
 damping,
 stiffness,
 restitution,
 bounce_threshold
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_revolute_set_angular_limits(px_joint, lower_limit, upper_limit, limit_contact_distance, damping, stiffness, restitution, bounce_threshold)
            


joint_set_break_force

Description

set the breaking force of a PhysX joint.


Syntax

gh_physx3.joint_set_break_force(
 px_joint,
 force, torque
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_set_break_force(px_joint, force, torque)
            


joint_set_motor_params

Description

Sets motor parameters of a revolute joint.


Syntax

gh_physx3.joint_set_motor_params(
 px_joint,
 velocity, max_force,
 drive_enabled, free_spin_enabled
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_set_motor_params(px_joint, velocity, max_force, drive_enabled, free_spin_enabled)
            


joint_spherical_set_limit_cone

Description

Sets parameters of a spherical joint.


Syntax

gh_physx3.joint_spherical_set_limit_cone(
 px_joint,
 y_limit_angle, z_limit_angle, limit_contact_distance
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.joint_spherical_set_limit_cone(px_joint, y_limit_angle, z_limit_angle, limit_contact_distance)
            


particle_system_create

Description

creates a particle system. A PhysX particle system must run with a regular gxl3d particle system.


Syntax

px_ps = gh_physx3.particle_system_create(
 px_scene,
 max_particles,
 run_on_gpu,
 init_particles
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_ps = gh_physx3.particle_system_create(px_scene, max_particles, run_on_gpu, 0)
            


particle_system_create_fluid

Description

creates a PhysX fluid (particle system). A PhysX particle system must run with a regular gxl3d particle system.


Syntax

px_ps = gh_physx3.particle_system_create_fluid(
 px_scene,
 max_particles,
 particle_size,
 viscosity,
 stiffness,
 run_on_gpu,
 init_particles
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
px_ps = gh_physx3.particle_system_create_fluid(px_scene, max_particles, particle_size, viscosity, stiffness, run_on_gpu, 0)
            


particle_system_from_gxc_ps

Description

updates a PhysX particle system from a gxc particle system (gxc is the core 3D lib used by GeeXLab).


Syntax

gh_physx3.particle_system_from_gxc_ps(
 px_ps,
 ps
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.particle_system_from_gxc_ps(px_ps, ps)
            


particle_system_position_from_vertex_pool

Description

updates the positions of a PhysX particle system from a gxl3d vertex pool.


Syntax

gh_physx3.particle_system_position_from_vertex_pool(
 px_ps,
 vp
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.particle_system_position_from_vertex_pool(px_ps, vp)
            


particle_system_position_to_vertex_pool

Description

updates the positions of a gxl3d vertex pool from a PhysX particle system.


Syntax

gh_physx3.particle_system_position_to_vertex_pool(
 px_ps,
 vp
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.particle_system_position_to_vertex_pool(px_ps, vp)
            


particle_system_to_gxc_ps

Description

updates a gxc particle system from a PhysX particle system (gxc is the core 3D lib used by GeeXLab).


Syntax

gh_physx3.particle_system_to_gxc_ps(
 px_ps,
 ps
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.particle_system_to_gxc_ps(px_ps, ps)
            


run_simulation

Description

runs a simulation.


Syntax

ret = gh_physx3.run_simulation(
 px_scene,
 dt,
 time_step
)

Languages

Lua - Python


Parameters


Return Values


Code sample

    
ret = gh_physx3.run_simulation(px_scene_id, dt, time_step)
            


set_simulation_scales

Description

Sets the various scales to get realistic physics simulations (to avoid the famous Moon effect)


Syntax

gh_physx3.set_simulation_scales(
 size,
 mass,
 speed
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.set_simulation_scales(1, 1000, 10)
            


set_scene_gravity

Description

sets the scene gravity vector.


Syntax

gh_physx3.set_scene_gravity(
 px_scene,
 x, y, z
)

Languages

Lua - Python


Parameters


Return Values

This function has no return value(s).


Code sample

    
gh_physx3.set_scene_gravity(px_scene, 0, -9.81, 0)
            


start

Description

starts the PhysX engine.


Syntax

ret = gh_physx3.start()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
ret = gh_physx3.start()
            


stop

Description

stops the PhysX engine.


Syntax

ret = gh_physx3.stop()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample

    
ret = gh_physx3.stop()
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter