[ Back to Geeks3D.com ]
 GeeXLab
Laboratory for Real Time 3D Programming (prototyping and demos) OpenGL, Lua, Python, GLSL, PhysX and more...Reference Guide Host-API Lua / Python
» Back to Homepage
» Back to Developer's Guide Index
HYP_PhysX Library
NVIDIA PhysX library
Number of functions: 107
HYP_PhysX.StartEngine
Starts the PhysX engine and creates a PhysX scene.
: Lua - Python
gpu_physx [INTEGER]: uses the PhysX GPU if available.
enable_threading [INTEGER]: allows to use multithreaded PhysX.
aysnc_threading [INTEGER]: uses the aysnchronous threading model (when multithreaded PhysX is enabled).
:
HYP_PhysX.StartEngine(1, 1, 0)
HYP_PhysX.StopEngine
Stops the PhysX engine.
: Lua - Python
:
HYP_PhysX.StopEngine()
HYP_PhysX.RunSimulation
Runs one simulation step. Useful in init scripts to position PhysX objects the first time. Do not call it in FRAME scripts.
: Lua - Python
:
HYP_PhysX.SetTimeStep(0.016)
HYP_PhysX.RunSimulation()
HYP_PhysX.ConnectToPVD
Connects GeeXLab to the PhysX Visual Debugger (PVD).
: Lua - Python
hostname [STRING]: PVD's URL. Use localhost if GeeXLab and PVD are on the same machine.
port [INTEGER]: PVD's port. Default port is 5425.
:
HYP_PhysX.ConnectToPVD("localhost", 5425)
HYP_PhysX.AcquireSyncLock
Acquires the lock when multithreaded PhysX is enabled. This function should be called before any function that modifies the PhysX scene such as SetActorGlobalPosition() fro example.
: Lua - Python
:
HYP_PhysX.AcquireSyncLock()
HYP_PhysX.SetActorGlobalPosition(...)
HYP_PhysX.SetActorLinearVelocity(...)
HYP_PhysX.ReleaseSyncLock()
HYP_PhysX.ReleaseSyncLock
Releases the lock previously acquired by AcquireSyncLock().
: Lua - Python
:
HYP_PhysX.AcquireSyncLock()
HYP_PhysX.SetActorGlobalPosition(...)
HYP_PhysX.SetActorLinearVelocity(...)
HYP_PhysX.ReleaseSyncLock()
HYP_PhysX.SetTimingParams
Sets simulation timing parameters.
: Lua - Python
max_time_step [REAL]: Maximum time of a substep
max_iter [INTEGER]: Maximum number of iterations to divide a timestep into
is_timestep_fixed [INTEGER]: Use (1) or not use (0) a fixed time step
:
HYP_PhysX.SetTimingParams(0.016/4, 4, 1)
HYP_PhysX.SetTimeStep
Sets the simulation time step.
: Lua - Python
time_step [REAL]: Simulation time step
:
HYP_PhysX.SetTimeStep(0.016)
HYP_PhysX.SetSkinWidthParam
SetSkinWidthParam specifies by how much shapes can interpenetrate. Two shapes will interpenetrate by the sum of their skin widths. This means that their graphical representations should be adjusted so that they just touch when the shapes are interpenetrating. The default skin width is the NX_SKIN_WIDTH SDK parameter. This is used if the skinWidth is set to -1 (which is the default).
: Lua - Python
skinWidth [REAL]: skin width - Values = [0 ; inf[
:
HYP_PhysX.SetSkinWidthParam(0.5)
HYP_PhysX.SetBounceThreshold
A contact with a relative velocity below this threshold will not bounce.
: Lua - Python
threshold [REAL]: bounce threshold - Values = ]-inf ; 0]
:
HYP_PhysX.SetBounceThreshold(-0.5)
HYP_PhysX.SetDefaultSleepLinVelSquared
The default linear velocity, squared, below which objects start going to sleep. Note: Only makes sense when the NX_BF_ENERGY_SLEEP_TEST is not set.
: Lua - Python
linVel [REAL]: linear velocity - Values = [0 ; inf[
:
HYP_PhysX.SetDefaultSleepLinVelSquared(0.5)
HYP_PhysX.SetDefaultSleepAngVelSquared
The default angular velocity, squared, below which objects start going to sleep. Note: Only makes sense when the NX_BF_ENERGY_SLEEP_TEST is not set.
: Lua - Python
angVel [REAL]: angular velocity - Values = [0 ; inf[
:
HYP_PhysX.SetDefaultSleepAngVelSquared(0.5)
HYP_PhysX.SetSceneGravity
Changes the gravity vector of the scene. By default, the gravity of the scene is set to (0.0, -9.81, 0.0) which corresponds to earth's gravity.
: Lua - Python
x, y, z [REAL]: Gravity vector - Values = ]-inf ; inf[
:
HYP_PhysX.SetSceneGravity(0.0, -9.81, 0.0)
HYP_PhysX.GetSceneGravity
Gets the gravity vector of the scene.
: Lua - Python
x, y, z [REAL]: Gravity vector
:
x, y , z = HYP_PhysX.GetSceneGravity()
HYP_PhysX.SetActorFluidDrainState
Sets the drain state (PhysX fluid).
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: drain state - Values = 0, 1
:
HYP_PhysX.SetActorFluidDrainState(objectId, 1)
HYP_PhysX.SetActorLinearVelocity
Sets the linear velocity of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: velocity vector - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorLinearVelocity(objectId, x, y, z)
HYP_PhysX.GetActorLinearVelocity
Gets the linear velocity of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: velocity vector
:
x, y, z = HYP_PhysX.GetActorLinearVelocity(objectId)
HYP_PhysX.SetActorLinearDamping
Sets the damping factor of the object's linear velocity. This factor corresponds to the various energy losses which decrease the speed.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
damping [REAL]: damping factor - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorLinearDamping(objectId, 0.2)
HYP_PhysX.GetActorLinearDamping
Gets the damping factor of the object's linear velocity. This factor corresponds to the various energy losses which decrease the speed.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
damping [REAL]: damping factor
:
damping = HYP_PhysX.GetActorLinearDamping(objectId)
HYP_PhysX.SetActorAngularVelocity
Sets the angular velocity of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: velocity vector - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorAngularVelocity(objectId, 0.2, 0.0, 0.0)
HYP_PhysX.GetActorAngularVelocity
Gets the angular velocity of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: velocity vector
:
x, y, z = HYP_PhysX.GetActorAngularVelocity(objectId)
HYP_PhysX.SetActorMaxAngularVelocity
Sets the maximum angular velocity permitted for this actor. Because for various internal computations, very quickly rotating actors introduce error into the simulation, which leads to undesired results.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
maxAngVel [REAL]: max velocity - Values = [0 ; inf[
:
HYP_PhysX.SetActorMaxAngularVelocity(objectId, 7.0)
HYP_PhysX.SetActorAngularDamping
Sets the damping factor of the object's angular velocity. This factor corresponds to the various energy losses which decrease the speed.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
damping [REAL]: damping factor - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorAngularDamping(objectId, 0.2)
HYP_PhysX.GetActorAngularDamping
Gets the damping factor of the object's angular velocity. This factor corresponds to the various energy losses which decrease the speed.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
damping [REAL]: damping factor
:
HYP_PhysX.SetActorAngularDamping(objectId, 0.2)
HYP_PhysX.SetActorMass
Sets the mass of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
mass [REAL]: object mass - Values = [0 ; inf[
:
HYP_PhysX.SetActorMass(objectId, 10.2)
HYP_PhysX.GetActorMass
Gets the mass of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
mass [REAL]: object mass
:
mass = HYP_PhysX.GetActorMass(objectId)
HYP_PhysX.SetActorGlobalPosition
Sets the absolute position (world space) of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: object position - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorGlobalPosition(objectId, px, py, pz)
HYP_PhysX.GetActorGlobalPosition
Gets the absolute position (world space) of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: object position
:
x, y, z = HYP_PhysX.GetActorGlobalPosition(objectId)
HYP_PhysX.SetActorGlobalOrientation
Sets the absolute orientation (world space) of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
angle [REAL]: rotation angle in degrees around the axis defined by X, Y and Z. - Values = ]-inf ; inf[
x, y, z [REAL]: rotation axis - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorGlobalOrientation(objectId, 30.0, 1.0, 0.0, 0.0)
HYP_PhysX.SetActorGlobalOrientationEulerAngles
Sets the absolute orientation (world space) of an object using Euler's angles.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
pitch, yaw, roll [REAL]: Euler's angles in degrees. - Values = ]-inf ; inf[
:
HYP_PhysX.SetActorGlobalOrientationEulerAngles(objectId, 30.0, -15.0, 0.0)
HYP_PhysX.MoveActorGlobalPosition
Serves to move kinematically controlled dynamic actors through the game world.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: new position - Values = ]-inf ; inf[
:
HYP_PhysX.MoveActorGlobalPosition(objectId, 0.0, 200.0, 0.0)
HYP_PhysX.MoveActorGlobalOrientation
Serves to move kinematically controlled dynamic actors through the game world.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z, w [REAL]: new orientation quaternion - Values = ]-inf ; inf[
:
HYP_PhysX.MoveActorGlobalOrientation(objectId, x, y, z, w)
HYP_PhysX.RemoveActorFromScene
Removes an actor from the physical engine scene.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
:
HYP_PhysX.RemoveActorFromScene(objectId)
HYP_PhysX.AddBoxActorToScene
Adds an box actor to the physic scene.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
actor_type [INTEGER]: Actor type: static, dynamic or kinematic. - Values = ACTOR_STATIC (1) | ACTOR_DYNAMIC (2) | ACTOR_KINEMATIC(4)
density [REAL]: Volumic density
mass [REAL]: Mass
:
ACTOR_DYNAMIC = 2
HYP_PhysX.AddBoxActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)
HYP_PhysX.AddSphereActorToScene
Adds a sphere actor to the physic scene.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
actor_type [INTEGER]: Actor type: static, dynamic or kinematic. - Values = ACTOR_STATIC (1) | ACTOR_DYNAMIC (2) | ACTOR_KINEMATIC(4)
density [REAL]: Volumic density
mass [REAL]: Mass
:
ACTOR_DYNAMIC = 2
HYP_PhysX.AddSphereActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)
HYP_PhysX.AddSphereActorToScene
Adds a sphere actor to the physic scene.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
actor_type [INTEGER]: Actor type: static, dynamic or kinematic. - Values = ACTOR_STATIC (1) | ACTOR_DYNAMIC (2) | ACTOR_KINEMATIC(4)
density [REAL]: Volumic density
mass [REAL]: Mass
:
ACTOR_DYNAMIC = 2
HYP_PhysX.AddSphereActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)
HYP_PhysX.AddPlaneActorToScene
Adds a plane actor to the physic scene. Transformations like SetActorGlobalPosition or SetActorGlobalOrientation are ignored by the plane actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
actor_type [INTEGER]: Actor type: static, dynamic or kinematic. - Values = ACTOR_STATIC (1) | ACTOR_DYNAMIC (2) | ACTOR_KINEMATIC(4)
density [REAL]: Volumic density
mass [REAL]: Mass
:
ACTOR_STATIC = 1
HYP_PhysX.AddPlaneActorToScene(objectId, ACTOR_STATIC, 20.0, 0.0)
HYP_PhysX.AddMeshActorToScene
Adds a mesh actor to the physic scene.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
actor_type [INTEGER]: Actor type: static, dynamic or kinematic. - Values = ACTOR_STATIC (1) | ACTOR_DYNAMIC (2) | ACTOR_KINEMATIC(4)
density [REAL]: Volumic density
mass [REAL]: Mass
:
ACTOR_DYNAMIC = 2
HYP_PhysX.AddMeshActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)
HYP_PhysX.AddForceToActor
Adds a force (linear movement) to an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: Force vector
:
HYP_PhysX.AddForceToActor(objectId, -2.0, 0.0, 0.0)
HYP_PhysX.AddForceAtPosToActor
Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in global coordinates, to the actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
fx, fy, fz [REAL]: Force vector in world space
px, py, pz [REAL]: position in world space toadd the force at.
:
HYP_PhysX.AddForceAtPosToActor(objectId, -2.0, 0.0, 0.0, 10.0, 10.0, 0.0)
HYP_PhysX.AddTorqueToActor
Applies a torque (rotational movement) to an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [REAL]: torque vector.
:
HYP_PhysX.AddTorqueToActor(objectId, 0.1, 0.25, 0.0)
HYP_PhysX.SetActorSleepLinearVelocity
Changes the object's linear velocity sleeping threshold. When the speed of the object becomes smaller than this threshold, the actor (or object) is not anymore taken into account in the physical engine which results in calculation resources saving. Once it hibernates, an actor can be awaked by the physical engine (when a collision occurs for example) or by calling the HYP_PhysX.WakeUpActor() function.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
linVel [REAL]: Sleep linear velocity.
:
HYP_PhysX.SetActorSleepLinearVelocity(objectId, 0.1)
HYP_PhysX.GetActorSleepLinearVelocity
Gets the object's linear velocity sleeping threshold. When the speed of the object becomes smaller than this threshold, the actor (or object) is not anymore taken into account in the physical engine which results in calculation resources saving. Once it hibernates, an actor can be awaked by the physical engine (when a collision occurs for example) or by calling the HYP_PhysX.WakeUpActor() function.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
linVel [REAL]: Sleep linear velocity.
:
slv = HYP_PhysX.GetActorSleepLinearVelocity(objectId)
HYP_PhysX.SetActorSleepAngularVelocity
Changes the angular velocity sleeping threshold of an object. When the speed becomes smaller than this threshold, the actor (or object) is not taken any more into account in the physical engine what has for principal effect to save resources of calculation. Once put in hibernation, an actor can be awaked by the physical engine (in the event of collision for example) or by call of the function HYP_PhysX.WakeUpActor().
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
angVel [REAL]: Sleep angular velocity.
:
HYP_PhysX.SetActorSleepAngularVelocity(objectId, angVel)
HYP_PhysX.GetActorSleepAngularVelocity
Gets the angular velocity sleeping threshold of an object. When the speed becomes smaller than this threshold, the actor (or object) is not taken any more into account in the physical engine what has for principal effect to save resources of calculation. Once put in hibernation, an actor can be awaked by the physical engine (in the event of collision for example) or by call of the function HYP_PhysX.WakeUpActor().
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
angVel [REAL]: Sleep angular velocity.
:
angVel = HYP_PhysX.GetActorSleepAngularVelocity(objectId)
HYP_PhysX.ForceActorToSleep
Forces an actor to enter into hibernation.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
:
HYP_PhysX.ForceActorToSleep(objectId)
HYP_PhysX.WakeUpActor
Wakes up an actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
:
HYP_PhysX.WakeUpActor(objectId)
HYP_PhysX.IsActorSleeping
Gets the hibernation state of an actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: Hibernation state.
:
state = HYP_PhysX.IsActorSleeping(objectId)
HYP_PhysX.SetActorPairFlags
Sets the contact pair flags for the given pair of actors.
: Lua - Python
objectId01 [INTEGER]: First bbject (or actor) identifier
objectId02 [INTEGER]: Second object (or actor) identifier
:
HYP_PhysX.SetActorPairFlags(objectId01, objectId02)
HYP_PhysX.GetActorCollisionState
Gets the collision state of an actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: Collision state.
:
state = HYP_PhysX.GetActorCollisionState(objectId)
HYP_PhysX.GetActorNumCollisionPoints
Returns the number of contact/collision points for a given actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
n [INTEGER]: Number of contact/collision points.
:
n = HYP_PhysX.GetActorNumCollisionPoints(objectId)
HYP_PhysX.GetActorCollisionPoint
Returns a particular contact/collision point for a given actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
pointIndex [INTEGER]: Contact point index. Range:[0 ; HYP_PhysX.GetActorNumCollisionPoints()-1].
px, py, py [REAL]: Position of the contact point.
nx, ny, ny [REAL]: Normal of the contact point.
:
px, py, pz, nx, ny, nz = HYP_PhysX.GetActorCollisionPoint(objectId, 0)
HYP_PhysX.ResetActorCollisionState
resets contact/collision state for a given actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
:
HYP_PhysX.ResetActorCollisionState(objectId)
HYP_PhysX.SetPhysicsEnginePauseSimultationState
Puts in pause (or to suspend) the physical simulation. This is useful for example to accurately analyze the collision progress.
: Lua - Python
state [INTEGER]: Pause state - Values = 0|1
:
HYP_PhysX.SetPhysicsEnginePauseSimultationState(state)
HYP_PhysX.SetActorKinematicState
Sets an actor from the dynamic state into a kinematic state and vice versa. A kinematic actor can apply forces to dynamic actors. On the other hand, a dynamic actor cannot apply a force to a kinematic actor. A kinematic actor is useful for example to simulate a person who acts with her environment but which does not undergo external forces (kind of First Person Shooter).
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: Kinematic state - Values = 0|1
:
HYP_PhysX.SetActorKinematicState(objectId, 1)
HYP_PhysX.GetActorKinematicState
Gets an actor kinematic state.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: Kinematic state
:
state = HYP_PhysX.GetActorKinematicState(objectId)
HYP_PhysX.SetActorGravityState
Sets gravity state of an actor.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
state [INTEGER]: Gravity state - Values = 0|1
:
HYP_PhysX.SetActorGravityState(objectId, 1)
HYP_PhysX.SetActorInertiaTensor
Specifies the inertia tensor of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [INTEGER]: Inertia tensor - Values = 0|1
:
HYP_PhysX.SetActorInertiaTensor(objectId, x, y, z)
HYP_PhysX.GetActorInertiaTensor
Gets the inertia tensor of an object.
: Lua - Python
objectId [INTEGER]: Object (or actor) identifier
x, y, z [INTEGER]: Inertia tensor
:
x, y, z = HYP_PhysX.GetActorInertiaTensor(objectId)
HYP_PhysX.JointDestroy
Destroys a joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
:
HYP_PhysX.JointDestroy(jointId)
HYP_PhysX.JointCreateFixed
Creates a fixed joint between two actors.
: Lua - Python
objectId01 [INTEGER]: Object (or actor) identifier
objectId02 [INTEGER]: Object (or actor) identifier
jointId [INTEGER]: Joint identifier
:
jointId = HYP_PhysX.JointCreateFixed(objectId01, objectId02)
HYP_PhysX.JointCreateRevolute
Creates a revolute joint between two actors.
: Lua - Python
objectId01 [INTEGER]: Object (or actor) identifier
objectId02 [INTEGER]: Object (or actor) identifier
doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1
jointId [INTEGER]: Joint identifier
:
jointId = HYP_PhysX.JointCreateRevolute(objectId01, objectId02, 1)
HYP_PhysX.JointCreateSpherical
Creates a spherical joint between two actors.
: Lua - Python
objectId01 [INTEGER]: Object (or actor) identifier
objectId02 [INTEGER]: Object (or actor) identifier
doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1
jointId [INTEGER]: Joint identifier
:
jointId = HYP_PhysX.JointCreateSpherical(objectId01, objectId02, 1)
HYP_PhysX.JointCreateCylindrical
Creates a cylindrical joint between two actors.
: Lua - Python
objectId01 [INTEGER]: Object (or actor) identifier
objectId02 [INTEGER]: Object (or actor) identifier
doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1
jointId [INTEGER]: Joint identifier
:
jointId = HYP_PhysX.JointCreateCylindrical(objectId01, objectId02, 1)
HYP_PhysX.JointCreateDistance
Creates a distance joint between two actors.
: Lua - Python
objectId01 [INTEGER]: Object (or actor) identifier
objectId02 [INTEGER]: Object (or actor) identifier
doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1
local_anchor_a1_x, local_anchor_a1_y, local_anchor_a1_z [REAL]: Attachment point of joint in first actor space.
local_anchor_a2_x, local_anchor_a2_y, local_anchor_a2_z [REAL]: Attachment point of joint in second actor space.
max_dist [REAL]: The maximum rest length of the rope or rod between the two anchor points.
min_dist [REAL]: The minimum rest length of the rope or rod between the two anchor points.
jointId [INTEGER]: Joint identifier
:
jointId = HYP_PhysX.JointCreateDistance(objectId01, objectId02, ax1, ay1, az1, ax2, ay2, az2, 10.0, 2.0)
HYP_PhysX.JointSetGlobalAnchor
sets the point where the two actors are attached, specified in world space.
: Lua - Python
jointId [INTEGER]: Joint identifier
x, y, z [REAL]: Anchor position
:
HYP_PhysX.JointSetGlobalAnchor(jointId, x, y, z)
HYP_PhysX.JointSetGlobalAxis
Sets the direction of the joint's primary axis, specified in global coordinates.
: Lua - Python
jointId [INTEGER]: Joint identifier
x, y, z [REAL]: direction of primary axis.
:
HYP_PhysX.JointSetGlobalAxis(jointId, x, y, z)
HYP_PhysX.JointSetBreakableParams
Sets the maximum force magnitude that the joint is able to withstand without breaking.
: Lua - Python
jointId [INTEGER]: Joint identifier
max_force [REAL]: maximum force the joint can withstand without breaking.
max_torque [REAL]: maximum torque the joint can withstand without breaking.
:
HYP_PhysX.JointSetBreakableParams(jointId, max_force, max_torque)
HYP_PhysX.JointIsBroken
Returns the broken state of a joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
state [INTEGER]: If 1, the joint is broken.
:
state = HYP_PhysX.JointIsBroken(jointId)
HYP_PhysX.JointSetLimitPoint
Sets the limit point. The point is specified in the world space. All types of joints may be limited with the same system: You may elect a point attached to one of the two actors to act as the limit point. You may also specify several planes attached to the other actor.
: Lua - Python
jointId [INTEGER]: Joint identifier
x, y, z [REAL]: limit point.
:
HYP_PhysX.JointSetLimitPoint(jointId, x, y, z)
HYP_PhysX.JointAddLimitPlane
Adds a limit plane. Both of the parameters are given in global coordinates. The plane is affixed to the actor that does not have the limit point. The normal of the plane points toward the positive side of the plane, and thus toward the limit point. If the normal points away from the limit point at the time of this call, the limit plane is ignored.
: Lua - Python
jointId [INTEGER]: Joint identifier
nx, ny, nz [REAL]: normal of the limit plane.
px, py, pz [REAL]: point in the limit plane in world space.
restitution [REAL]: Restitution of the limit plane.
:
HYP_PhysX.JointAddLimitPlane(jointId, nx, ny, nz, px, py, pz, restitution)
HYP_PhysX.JointPurgeLimitPlanes
Deletes all limit planes added to the joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
:
HYP_PhysX.JointPurgeLimitPlanes(jointId)
HYP_PhysX.JointSetMotorParams
Describes a motor joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
doMotor [INTEGER]: Enables (1) or disables (0) the joint motor - Values = 0|1
velTarget [REAL]: The relative velocity the motor is trying to achieve.
maxForce [REAL]: The maximum force (or torque) the motor can exert.
freeSpin [INTEGER]: If 1, motor will not brake when it spins faster than velTarget. - Values = 0|1
:
HYP_PhysX.JointSetMotorParams(jointId, 1, 10.2, 2.0, 1)
HYP_PhysX.JointSetSpringParams
Describes a spring joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
doSpring [INTEGER]: Enables (1) or disables (0) the joint spring - Values = 0|1
spring [REAL]: Spring coefficient.
damper [REAL]: Damper coefficient.
targetValue [REAL]: target value (angle/position) of spring where the spring force is zero.
:
HYP_PhysX.JointSetMotorParams(jointId, 1, 10.2, 2.0, 1)
HYP_PhysX.JointSetSphericalParams
Describes a spherical joint.
: Lua - Python
jointId [INTEGER]: Joint identifier
is_swing_limit_enabled [INTEGER]: Enables (1) or disables (0) swing limit. - Values = 0|1
swingLimit_value [REAL]: The angle / position beyond which the limit is active.
is_twist_limit_enabled [INTEGER]: Enables (1) or disables (0) twist limit. - Values = 0|1
twist_limit_low_value [REAL]: Twist low limit.
twist_limit_high_value [REAL]: Twist high limit.
:
HYP_PhysX.JointSetSphericalParams(jointId, 1, 0.2, 0, 0.0, 0.0)
HYP_PhysX.FluidCreate
Creates a fluid.
: Lua - Python
num_particles [INTEGER]: Number max of particles
fluidId [INTEGER]: fluid id.
:
fluidId = HYP_PhysX.FluidCreate(10000)
HYP_PhysX.FluidCreateEx
Creates a fluid.
: Lua - Python
num_particles [INTEGER]: Number max of particles
cpu_fluid [INTEGER]: 1 == forces CPU fluid - 0 == GPU fluid if available otherwise CPU fluid
sph_fluid [INTEGER]: 1 == uses SPH (inter-particle interaction) fluid - 0 == disables SPH
use_gravity [INTEGER]: 1 == uses gravity on fluid particles
kernelRadiusMultiplier [REAL]:
restParticlesPerMeter [REAL]:
motionLimitMultiplier [REAL]:
collisionDistanceMultiplier [REAL]:
packetSizeMultiplier [INTEGER]:
fluidId [INTEGER]: fluid id.
:
fluidId = HYP_PhysX.FluidCreateEx(10000, 0, 1, 1, 2.0, 5.0, 3.0, 0.12, 16)
HYP_PhysX.FluidDestroy
Destroys a fluid.
: Lua - Python
fluidId [INTEGER]: fluid id.
:
HYP_PhysX.FluidDestroy(id)
HYP_PhysX.FluidSetMaterial
Sets the material that will be use during fluid rendering. The material allows to set the textures or GPU program for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
materialId [INTEGER]: material id.
:
HYP_PhysX.FluidSetMaterial(fluidId, materialId)
HYP_PhysX.FluidGetCurNumParticles
Returns the current number of active particles.
: Lua - Python
fluidId [INTEGER]: fluid id.
num_particles [INTEGER]: number of active particles.
:
n = HYP_PhysX.FluidGetCurNumParticles(fluidId)
HYP_PhysX.FluidSetExternalAcceleration
Sets the external acceleration applied to each particle at each time step.
: Lua - Python
fluidId [INTEGER]: fluid id.
x [REAL]: x acc.
y [REAL]: y acc.
z [REAL]: z acc.
:
HYP_PhysX.FluidSetExternalAcceleration(fluidId, x, y, z)
HYP_PhysX.FluidSetStiffness
Sets fluid stiffness.
: Lua - Python
fluidId [INTEGER]: fluid id.
x [REAL]: stiffness.
:
HYP_PhysX.FluidSetStiffness(fluidId, x)
HYP_PhysX.FluidSetViscosity
Sets fluid viscosity.
: Lua - Python
fluidId [INTEGER]: fluid id.
x [REAL]: viscosity.
:
HYP_PhysX.FluidSetViscosity(fluidId, x)
HYP_PhysX.FluidSetSurfaceTension
Sets fluid surface tension.
: Lua - Python
fluidId [INTEGER]: fluid id.
x [REAL]: surface tension.
:
HYP_PhysX.FluidSetSurfaceTension(fluidId, x)
HYP_PhysX.FluidSetDamping
Sets fluid damping.
: Lua - Python
fluidId [INTEGER]: fluid id.
x [REAL]: damping.
:
HYP_PhysX.FluidSetDamping(fluidId, x)
HYP_PhysX.FluidSetShapeRestitution
Sets fluid restitution.
: Lua - Python
fluidId [INTEGER]: fluid id.
s [REAL]: restitution for static shapes.
d [REAL]: restitution for dynamic shapes.
:
HYP_PhysX.FluidSetShapeRestitution(fluidId, s, d)
HYP_PhysX.FluidSetPointSpriteState
Sets the use of point sprite particle for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
state [INTEGER]: state: 0 or 1.
:
HYP_PhysX.FluidSetPointSpriteState(fluidId, s, d)
HYP_PhysX.FluidSetBlendingParams
Sets color belnding params for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
state [INTEGER]: enables or disables color blending
s [INTEGER]: source factor
d [INTEGER]: destination factor
:
HYP_PhysX.FluidSetBlendingParams(fluidId, state, s, d)
HYP_PhysX.FluidSetLightingState
Sets the lighting state for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
state [INTEGER]: enables or disables the lighting
:
HYP_PhysX.FluidSetLightingState(fluidId, state)
HYP_PhysX.FluidSetTexturingState
Sets the texturing state for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
state [INTEGER]: enables or disables the texturing
:
HYP_PhysX.FluidSetTexturingState(fluidId, state)
HYP_PhysX.FluidSetDepthTestParams
Sets the depth test params for fluid rendering.
: Lua - Python
fluidId [INTEGER]: fluid id.
do_depth_testing [INTEGER]: enables or disables the depth test
enable_depth_buffer_writing [INTEGER]: enables or disables the writing in depth buffer
:
HYP_PhysX.FluidSetDepthTestParams(fluidId, do_depth_testing, enable_depth_buffer_writing)
HYP_PhysX.FluidEmitterCreate
Creates an emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
frameShapeActorId [INTEGER]: Id of the fram shape actor - not used if == -1
lifetime [REAL]: particles lifetime
constant_flow_rate [INTEGER]: enables or disables (0 or 1) constant flow rate particle emitter
emitterDimX [REAL]: rectangular emitter width
emitterDimY [REAL]: rectangular emitter height
emitterId [INTEGER]: emitter id.
:
emitterId = HYP_PhysX.FluidEmitterCreate(fluidId, frameShapeActorId, lifetime, constant_flow_rate, emitterDimX, emitterDimY)
HYP_PhysX.FluidEmitterDestroy
Destroys an emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
:
HYP_PhysX.FluidEmitterDestroy(fluidId, emitterId)
HYP_PhysX.FluidEmitterAttachToActor
Attaches an emitter to an actor.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
actorId [INTEGER]: actor id.
:
HYP_PhysX.FluidEmitterAttachToActor(fluidId, emitterId, actorId)
HYP_PhysX.FluidEmitterSetEmissionState
Sets the emission state of an emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
state [INTEGER]: emission state (0 or 1).
:
HYP_PhysX.FluidEmitterSetEmissionState(fluidId, emitterId, state)
HYP_PhysX.FluidEmitterSetFluidVelocityMagnitude
Sets fluid speed.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: speed.
:
HYP_PhysX.FluidEmitterSetFluidVelocityMagnitude(fluidId, emitterId, x)
HYP_PhysX.FluidEmitterSetRandomAngle
Sets emission random angle.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: angle.
:
HYP_PhysX.FluidEmitterSetRandomAngle(fluidId, emitterId, x)
HYP_PhysX.FluidEmitterSetRandomPos
Sets emission random position.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: x position.
y [REAL]: y position.
z [REAL]: z position.
:
HYP_PhysX.FluidEmitterSetRandomPos(fluidId, emitterId, x, y, z)
HYP_PhysX.FluidEmitterSetRate
Sets emitter rate in particle per second.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: rate.
:
HYP_PhysX.FluidEmitterSetRate(fluidId, emitterId, x)
HYP_PhysX.FluidEmitterSetParticleLifetime
Sets particle lifetime.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: lifetime.
:
HYP_PhysX.FluidEmitterSetParticleLifetime(fluidId, emitterId, x)
HYP_PhysX.FluidEmitterSetRepulsionCoefficient
Sets emitter repulsion coefficient.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: coef.
:
HYP_PhysX.FluidEmitterSetRepulsionCoefficient(fluidId, emitterId, x)
HYP_PhysX.FluidEmitterSetGlobalPosition
Sets the global position of the emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: x position.
y [REAL]: y position.
z [REAL]: z position.
:
HYP_PhysX.FluidEmitterSetGlobalPosition(fluidId, emitterId, x, y, z)
HYP_PhysX.FluidEmitterSetGlobalOrientation
Sets the global orientation of the emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
angle [REAL]: angle in degrees.
x [REAL]: x axis.
y [REAL]: y axis.
z [REAL]: z axis.
:
HYP_PhysX.FluidEmitterSetGlobalOrientation(fluidId, emitterId, 30.0, x, y, z)
HYP_PhysX.FluidEmitterSetGlobalOrientationFromEulerAngles
Sets the global orientation of the emitter from Euler's angles.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: pitch.
y [REAL]: yaw.
z [REAL]: roll.
:
HYP_PhysX.FluidEmitterSetGlobalOrientation(fluidId, emitterId, x, y, z)
HYP_PhysX.FluidEmitterSetLocalPosition
Sets the local position of the emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: x position.
y [REAL]: y position.
z [REAL]: z position.
:
HYP_PhysX.FluidEmitterSetLocalPosition(fluidId, emitterId, x, y, z)
HYP_PhysX.FluidEmitterSetLocalOrientation
Sets the local orientation of the emitter.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
angle [REAL]: angle in degrees.
x [REAL]: x axis.
y [REAL]: y axis.
z [REAL]: z axis.
:
HYP_PhysX.FluidEmitterSetLocalOrientation(fluidId, emitterId, 30.0, x, y, z)
HYP_PhysX.FluidEmitterSetLocalOrientationFromEulerAngles
Sets the local orientation of the emitter from Euler's angles.
: Lua - Python
fluidId [INTEGER]: fluid id.
emitterId [INTEGER]: emitter id.
x [REAL]: pitch.
y [REAL]: yaw.
z [REAL]: roll.
:
HYP_PhysX.FluidEmitterSetLocalOrientation(fluidId, emitterId, x, y, z)
|