< 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: 84

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



actor_add_force

Description

Adds a force to an actor.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_add_force(actor_id, 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(
 actor_id,
 fx, fy, fz,
 px, py, pz
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_add_force_at_position(actor_id, 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(
 actor_id,
 obj_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_apply_transform(actor_id, object)
			


actor_get_transform_mat16

Description

Returns the transformation matrix of a physics actor.


Syntax

m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = gh_physx3.actor_get_transform_mat16(
 actor_id
)

Languages


Parameters


Return Values


Code sample


m0,m1,m2,m3,m4,m5,m6,m7,m8,m9,m10,m11,m12,m13,m14,m15 = gh_physx3.actor_get_transform_mat16(actor_id)
			


actor_get_transform_pos_qrot

Description

Returns the position and orientation (quaternion) of a physics actor.


Syntax

px, py, pz, qx, qy, qz, qw = gh_physx3.actor_get_transform_pos_qrot(
 actor_id
)

Languages


Parameters


Return Values


Code sample


px, py, pz, qx, qy, qz, qw = gh_physx3.actor_get_transform_pos_qrot(actor_id)
			


actor_clear_forces

Description

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


Syntax

gh_physx3.actor_clear_forces(
 actor_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_clear_forces(actor_id)
			


actor_get_angular_speed2

Description

Gets the squared angular speed of an actor.


Syntax

s = gh_physx3.actor_get_angular_speed2(
 actor_id
)

Languages


Parameters


Return Values


Code sample


s = gh_physx3.actor_get_angular_speed2(actor_id)
			


actor_get_angular_velocity

Description

Gets the angular velocity of an actor.


Syntax

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

Languages


Parameters


Return Values


Code sample


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


actor_get_linear_speed2

Description

Gets the squared linear speed of an actor.


Syntax

s = gh_physx3.actor_get_linear_speed2(
 actor_id
)

Languages


Parameters


Return Values


Code sample


s = gh_physx3.actor_get_linear_speed2(actor_id)
			


actor_get_linear_velocity

Description

Gets the linear velocity of an actor.


Syntax

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

Languages


Parameters


Return Values


Code sample


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


actor_get_orientation

Description

Gets the orientation of an actor (a quaternion).


Syntax

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

Languages


Parameters


Return Values


Code sample


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


actor_get_position

Description

Gets the global position of an actor.


Syntax

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

Languages


Parameters


Return Values


Code sample


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


actor_get_sleep_threshold

Description

Gets the sleep threshold.


Syntax

thres = gh_physx3.actor_get_sleep_threshold(
 actor_id
)

Languages


Parameters


Return Values


Code sample


t = gh_physx3.actor_get_sleep_threshold(actor_id)
			


actor_is_sleeping

Description

Gets the sleeping state of an actor.


Syntax

state = gh_physx3.actor_is_sleeping(
 actor_id
)

Languages


Parameters


Return Values


Code sample


is_sleeping = gh_physx3.actor_is_sleeping(actor_id)
			


actor_kill

Description

Destroys an actor.


Syntax

gh_physx3.actor_kill(
 actor_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_kill(actor_id)
			


actor_put_to_sleep

Description

Forces an actor to sleep.


Syntax

gh_physx3.actor_put_to_sleep(
 actor_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_put_to_sleep(actor_id)
			


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(
 actor_id,
 o3d_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_3d_object(actor_id, oid)
			


actor_set_angular_damping

Description

Sets the angular damping of an actor.


Syntax

gh_physx3.actor_set_angular_damping(
 actor_id,
 damping
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_angular_damping(actor_id, 0.2)
			


actor_set_angular_velocity

Description

Sets the angular velocity of an actor.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


actor_set_euler_angles

Description

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


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


actor_set_gravity_state

Description

Sets the gravity state of an actor.


Syntax

gh_physx3.actor_set_gravity_state(
 actor_id,
 state
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_gravity_state(actor_id, 1)
			


actor_set_kinematic_state

Description

Sets the kinematic state of an actor.


Syntax

gh_physx3.actor_set_kinematic_state(
 actor_id,
 state
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_kinematic_state(actor_id, 1)
			


actor_set_kinematic_target

Description

Moves kinematically controlled dynamic actors through the 3d world.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_kinematic_target(actor_id, 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(
 actor_id,
 damping
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_linear_damping(actor_id, 0.2)
			


actor_set_linear_velocity

Description

Sets the linear velocity of an actor.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_linear_velocity(actor_id, 10, 10, 10)
			


actor_set_material

Description

Sets a material to an actor.


Syntax

gh_physx3.actor_set_material(
 actor_id,
 mat_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_material(actor_id, mat_id)
			


actor_set_orientation

Description

Sets the orientation of an actor (a quaternion).


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


actor_set_position

Description

Sets the global position of an actor.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


actor_set_sleep_threshold

Description

Sets the sleep threshold.


Syntax

gh_physx3.actor_set_sleep_threshold(
 actor_id,
 thres
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_set_sleep_threshold(actor_id, 0.2)
			


actor_set_solver_iterations

Description

Sets the number of solver iterations for an actor.


Syntax

gh_physx3.actor_set_solver_iterations(
 actor_id,
 position_iterations,
 velocity_iterations
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


position_iterations = 4
velocity_iterations = 1

gh_physx3.actor_set_solver_iterations(actor_id, position_iterations, velocity_iterations)
			


actor_update_mass

Description

Update the mass of an actor from the density.


Syntax

gh_physx3.actor_update_mass(
 actor_id,
 density
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_update_mass(actor_id, density)
			


actor_wake_up

Description

Wakes up an actor.


Syntax

gh_physx3.actor_wake_up(
 actor_id,
 sleep_counter
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.actor_wake_up(actor_id, 1)
			


check_results

Description

Checks if results of a simulation step are available.


Syntax

ret = gh_physx3.check_results(
 scene_id
)

Languages


Parameters


Return Values


Code sample


if (can_run_sim) then
    gh_physx3.run_simulation_step(scene_id, time_step)
    can_run_sim = false
end

if (gh_physx3.check_results(scene_id) == 1) then
    gh_physx3.fetch_results(scene_id)
    can_run_sim = true
end
			


cloth_create_from_mesh

Description

Creates a PhysX cloth from a mesh.


Syntax

actor_id = gh_physx3.cloth_create_from_mesh(
 scene_id,
 mesh_id,
 gpu_cloth,
 x, y, z,
 pitch, yaw, roll,
 gx, gy, gz
)

Languages


Parameters


Return Values


Code sample


actor_id = gh_physx3.cloth_create_from_mesh(scene_id, mesh_id, 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(
 actor_id
)

Languages


Parameters


Return Values


Code sample


state = gh_physx3.cloth_is_running_on_gpu(actor_id)
			


cloth_set_external_acceleration

Description

Sets the external acceleration to a PhysX cloth actor.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


cloth_set_gpu_state

Description

Sets the GPU state of a cloth actor.


Syntax

gh_physx3.cloth_set_gpu_state(
 actor_id,
 state
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.cloth_set_gpu_state(actor_id, state)
			


cloth_set_stiffness

Description

Sets the cloth stiffness.


Syntax

gh_physx3.cloth_set_stiffness(
 actor_id,
 stiffness
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.cloth_set_stiffness(actor_id, 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(
 actor_id,
 mesh_id,
 update_position,
 update_normals
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.cloth_update_mesh_vertex_data(actor_id, mesh_id, 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(
 actor_id,
 mesh_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.cloth_update_particles_from_mesh_particles(actor_id, mesh_id)
			


create_actor_box

Description

Creates a box actor.


Syntax

actor_id = gh_physx3.create_actor_box(
 scene_id,
 w, h, d,
 px, py, pz,
 density,
 mat_id
)

Languages


Parameters


Return Values


Code sample


actor_id_box = gh_physx3.create_actor_box(scene_id, 4, 4, 4, 0, 0, 0, density, mat_id)
			


create_actor_capsule

Description

Creates a capsule actor.


Syntax

actor_id = gh_physx3.create_actor_capsule(
 scene_id,
 radius,
 half_height,
 px, py, pz,
 density,
 mat_id
)

Languages


Parameters


Return Values


Code sample


actor_id_capsule = gh_physx3.create_actor_capsule(scene_id, radius, half_height, 0, 0, 0, density, mat_id)
			


create_actor_mesh

Description

Creates an actor from a mesh.


Syntax

actor_id = gh_physx3.create_actor_mesh(
 scene_id,
 mesh_id,
 px, py, pz,
 density,
 mat_id
)

Languages


Parameters


Return Values


Code sample


actor_id_mesh = gh_physx3.create_actor_mesh(scene_id, mesh_id, 0, 0, 0, density, mat_id)
			


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

actor_id = gh_physx3.create_actor_mesh_v2(
 scene_id,
 mesh_id,
 px, py, pz,
 density,
 mat_id,
 convex
)

Languages


Parameters


Return Values


Code sample


convex = 1
actor_id_mesh = gh_physx3.create_actor_mesh_v2(scene_id, mesh_id, 0, 0, 0, density, mat_id, convex)
			


create_actor_plane

Description

Creates a plane actor.


Syntax

actor_id = gh_physx3.create_actor_plane(
 scene_id,
 nx, ny, nz, d,
 mat_id
)

Languages


Parameters


Return Values


Code sample


actor_id_plane = gh_physx3.create_actor_plane(scene_id, 0, 1, 0, 0, mat_id)
			


create_actor_sphere

Description

Creates a sphere actor.


Syntax

actor_id = gh_physx3.create_actor_sphere(
 scene_id,
 radius,
 px, py, pz,
 density,
 mat_id
)

Languages


Parameters


Return Values


Code sample


actor_id_plane = gh_physx3.create_actor_sphere(scene_id, 10, 0, 0, 0, density, mat_id)
			


create_material

Description

Creates a PhysX material.


Syntax

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

Languages


Parameters


Return Values


Code sample


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


create_scene

Description

Creates a PhysX scene - DEPRECATED


Syntax

scene_id = gh_physx3.create_scene(
 gpu_physx,
 bounce_threshold_velocity
)

Languages


Parameters


Return Values


Code sample


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


create_scene_broadphase_gpu

Description

Creates a GPU PhysX scene.


Syntax

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

Languages


Parameters


Return Values


Code sample


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

scene_id = gh_physx3.create_scene_broadphase_gpu(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

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

Languages


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

scene_id = 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_sap

Description

Creates a CPU PhysX scene with SAP (Multi-Box Pruning) broadphase algorithm.


Syntax

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

Languages


Parameters


Return Values


Code sample


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

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


fetch_results

Description

Fetches the results of a simulation step.


Syntax

ret = gh_physx3.fetch_results(
 scene_id
)

Languages


Parameters


Return Values


Code sample


ret = gh_physx3.run_simulation_step(scene_id, time_step)
gh_physx3.fetch_results(scene_id)
			


gpu_get_clock_frequency_khz

Description

Gets the clock speed of the PhysX GPU.


Syntax

clock = gh_physx3.gpu_get_clock_frequency_khz()

Languages


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


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

num_sm = gh_physx3.gpu_get_num_multiprocessors()

Languages


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


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


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

joint_id = gh_physx3.joint_create(
 scene_id,
 joint_type,
 actor_id1,
 x1, y1, z1,
 pitch1, yaw1, roll1,
 actor_id2,
 x2, y2, z2,
 pitch2, yaw2, roll2
)

Languages


Parameters


Return Values


Code sample


joint_id = gh_physx3.joint_create(scene_id, joint_type, actor_id1, x1, y1, z1, pitch1, yaw1, roll1, actor_id2, x2, y2, z2, pitch2, yaw2, roll2)
			


joint_distance_set_distances

Description

Sets distance joint distance range.


Syntax

gh_physx3.joint_distance_set_distances(
 joint_id,
 min_distance, max_distance
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.joint_distance_set_distances(joint_id, min_distance, max_distance)
			


joint_distance_set_spring

Description

Sets distance joint spring parameters.


Syntax

gh_physx3.joint_distance_set_spring(
 joint_id,
 spring_coef, damping_coef
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.joint_distance_set_spring(joint_id, spring_coef, damping_coef)
			


joint_kill

Description

Kills a PhysX joint.


Syntax

gh_physx3.joint_kill(
 joint_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.joint_kill(joint_id)
			


joint_prismatic_set_limits

Description

Sets prismatic joint parameters.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.joint_prismatic_set_limits(joint_id, 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(
 joint_id,
 lower_limit, upper_limit,
 limit_contact_distance,
 damping,
 stiffness,
 restitution,
 bounce_threshold
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


joint_revolute_set_rotational_limits

Description

Sets revolute joint parameters.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


joint_set_break_force

Description

Set the breaking force of a PhysX joint.


Syntax

gh_physx3.joint_set_break_force(
 joint_id,
 force, torque
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.joint_set_break_force(joint_id, force, torque)
			


joint_set_motor_params

Description

Sets motor parameters of a revolute joint.


Syntax

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

Languages


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(
 joint_id,
 y_limit_angle, z_limit_angle, limit_contact_distance
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


kill_material

Description

Destroys a material.


Syntax

gh_physx3.kill_material(
 mat_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.kill_material(mat_id)
			


particle_system_create

Description

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


Syntax

px_ps_id = gh_physx3.particle_system_create(
 scene_id,
 max_particles,
 run_on_gpu,
 init_particles
)

Languages


Parameters


Return Values


Code sample


px_ps_id = gh_physx3.particle_system_create(scene_id, 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_id = gh_physx3.particle_system_create_fluid(
 scene_id,
 max_particles,
 particle_size,
 viscosity,
 stiffness,
 run_on_gpu,
 init_particles
)

Languages


Parameters


Return Values


Code sample


px_ps_id = gh_physx3.particle_system_create_fluid(scene_id, 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_id,
 gxc_ps_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.particle_system_from_gxc_ps(px_ps_id, gxc_ps_id)
			


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_id,
 vp_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.particle_system_position_from_vertex_pool(px_ps_id, vp_id)
			


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_id,
 vp_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.particle_system_position_to_vertex_pool(px_ps_id, vp_id)
			


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_id,
 gxc_ps_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.particle_system_to_gxc_ps(px_ps_id, gxc_ps_id)
			


run_simulation

Description

Runs a simulation.


Syntax

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

Languages


Parameters


Return Values


Code sample


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


run_simulation_step

Description

Runs a simulation step.


Syntax

ret = gh_physx3.run_simulation_step(
 scene_id,
 time_step
)

Languages


Parameters


Return Values


Code sample


ret = gh_physx3.run_simulation_step(scene_id, time_step)
			


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(
 scene_id
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.scene_sync_3d_objects(sid)
			


set_max_depenetration_velocity

Description

Sets the max depenetration velocity. This a global value applied to each new actor.


Syntax

gh_physx3.set_max_depenetration_velocity(
 velocity
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


velocity = 3.0

gh_physx3.set_max_depenetration_velocity(velocity)
...
actor_id_box = gh_physx3.create_actor_box(scene_id, 4, 4, 4, 0, 0, 0, density, mat_id)
			


set_scene_gravity

Description

Sets the scene gravity vector.


Syntax

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

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


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


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


Parameters


Return Values

This function has no return value(s).


Code sample


gh_physx3.set_simulation_scales(1, 1000, 10)
			


set_solver_iteration_counts

Description

Sets the number of solver iterations. This a global value applied to each new actor.


Syntax

gh_physx3.set_solver_iteration_counts(
 position_iterations,
 velocity_iterations
)

Languages


Parameters


Return Values

This function has no return value(s).


Code sample


position_iterations = 4
velocity_iterations = 1

gh_physx3.set_solver_iteration_counts(position_iterations, velocity_iterations)
...
actor_id_box = gh_physx3.create_actor_box(scene_id, 4, 4, 4, 0, 0, 0, density, mat_id)
			


start

Description

Starts the PhysX engine.


Syntax

ret = gh_physx3.start()

Languages


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


Parameters

This function has no input parameter(s).


Return Values


Code sample


ret = gh_physx3.stop()
			


update_material

Description

Updates the properties of a material.


Syntax

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

Languages


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(mat_id, static_friction, dynamic_friction, resilience)
			






GeeXLab Rootard Guide | Downloads | Contact | Newsletter