"No one can be told what GeeXLab is, you have to see it for yourself!"

"Stop Playing Games and Start Making Them! With GeeXLab, your are on your way!"


Quick Links
What is GeeXLab
Download GeeXLab
GeeXLab Requirements
Online Help
Articles and Tutorials
Samples Screenshots
Videos

GeeXLab Changelog

XML Ref. Guide
Scripting Ref. Guide
Code Samples

Purchase GeeXLab
GeeXLab SDK

Shader Library

Follow GeeXLab's News
GeeXLab news, articles, tutorials and demos @ Geeks3D.com
GeeXLab @ Twitter GeeXLab RSS Feed

Subscribe to GeeXLab news by email

[ Back to Geeks3D.com ]

GeeXLab

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


Description
NVIDIA PhysX library

Number of functions: 107

HYP_PhysX.StartEngine

Description
Starts the PhysX engine and creates a PhysX scene.

Languages: Lua - Python

Parameters
  • 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).

    Code sample :

    HYP_PhysX.StartEngine(1, 1, 0)


    HYP_PhysX.StopEngine

    Description
    Stops the PhysX engine.

    Languages: Lua - Python

    Code sample :

    HYP_PhysX.StopEngine()


    HYP_PhysX.RunSimulation

    Description
    Runs one simulation step. Useful in init scripts to position PhysX objects the first time. Do not call it in FRAME scripts.

    Languages: Lua - Python

    Code sample :

    HYP_PhysX.SetTimeStep(0.016)
    HYP_PhysX.RunSimulation()


    HYP_PhysX.ConnectToPVD

    Description
    Connects GeeXLab to the PhysX Visual Debugger (PVD).

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.ConnectToPVD("localhost", 5425)


    HYP_PhysX.AcquireSyncLock

    Description
    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.

    Languages: Lua - Python

    Code sample :

    HYP_PhysX.AcquireSyncLock()
    HYP_PhysX.SetActorGlobalPosition(...)
    HYP_PhysX.SetActorLinearVelocity(...)
    HYP_PhysX.ReleaseSyncLock()


    HYP_PhysX.ReleaseSyncLock

    Description
    Releases the lock previously acquired by AcquireSyncLock().

    Languages: Lua - Python

    Code sample :

    HYP_PhysX.AcquireSyncLock()
    HYP_PhysX.SetActorGlobalPosition(...)
    HYP_PhysX.SetActorLinearVelocity(...)
    HYP_PhysX.ReleaseSyncLock()


    HYP_PhysX.SetTimingParams

    Description
    Sets simulation timing parameters.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_PhysX.SetTimingParams(0.016/4, 4, 1)


    HYP_PhysX.SetTimeStep

    Description
    Sets the simulation time step.

    Languages: Lua - Python

    Parameters
  • time_step [REAL]: Simulation time step

    Code sample :

    HYP_PhysX.SetTimeStep(0.016)


    HYP_PhysX.SetSkinWidthParam

    Description
    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).

    Languages: Lua - Python

    Parameters
  • skinWidth [REAL]: skin width - Values = [0 ; inf[

    Code sample :

    HYP_PhysX.SetSkinWidthParam(0.5)


    HYP_PhysX.SetBounceThreshold

    Description
    A contact with a relative velocity below this threshold will not bounce.

    Languages: Lua - Python

    Parameters
  • threshold [REAL]: bounce threshold - Values = ]-inf ; 0]

    Code sample :

    HYP_PhysX.SetBounceThreshold(-0.5)


    HYP_PhysX.SetDefaultSleepLinVelSquared

    Description
    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.

    Languages: Lua - Python

    Parameters
  • linVel [REAL]: linear velocity - Values = [0 ; inf[

    Code sample :

    HYP_PhysX.SetDefaultSleepLinVelSquared(0.5)


    HYP_PhysX.SetDefaultSleepAngVelSquared

    Description
    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.

    Languages: Lua - Python

    Parameters
  • angVel [REAL]: angular velocity - Values = [0 ; inf[

    Code sample :

    HYP_PhysX.SetDefaultSleepAngVelSquared(0.5)


    HYP_PhysX.SetSceneGravity

    Description
    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.

    Languages: Lua - Python

    Parameters
  • x, y, z [REAL]: Gravity vector - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetSceneGravity(0.0, -9.81, 0.0)


    HYP_PhysX.GetSceneGravity

    Description
    Gets the gravity vector of the scene.

    Languages: Lua - Python

    Return Values
  • x, y, z [REAL]: Gravity vector

    Code sample :

    x, y , z = HYP_PhysX.GetSceneGravity()


    HYP_PhysX.SetActorFluidDrainState

    Description
    Sets the drain state (PhysX fluid).

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • state [INTEGER]: drain state - Values = 0, 1

    Code sample :

    HYP_PhysX.SetActorFluidDrainState(objectId, 1)


    HYP_PhysX.SetActorLinearVelocity

    Description
    Sets the linear velocity of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: velocity vector - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorLinearVelocity(objectId, x, y, z)


    HYP_PhysX.GetActorLinearVelocity

    Description
    Gets the linear velocity of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • x, y, z [REAL]: velocity vector

    Code sample :

    x, y, z = HYP_PhysX.GetActorLinearVelocity(objectId)


    HYP_PhysX.SetActorLinearDamping

    Description
    Sets the damping factor of the object's linear velocity. This factor corresponds to the various energy losses which decrease the speed.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • damping [REAL]: damping factor - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorLinearDamping(objectId, 0.2)


    HYP_PhysX.GetActorLinearDamping

    Description
    Gets the damping factor of the object's linear velocity. This factor corresponds to the various energy losses which decrease the speed.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • damping [REAL]: damping factor

    Code sample :

    damping = HYP_PhysX.GetActorLinearDamping(objectId)


    HYP_PhysX.SetActorAngularVelocity

    Description
    Sets the angular velocity of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: velocity vector - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorAngularVelocity(objectId, 0.2, 0.0, 0.0)


    HYP_PhysX.GetActorAngularVelocity

    Description
    Gets the angular velocity of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • x, y, z [REAL]: velocity vector

    Code sample :

    x, y, z = HYP_PhysX.GetActorAngularVelocity(objectId)


    HYP_PhysX.SetActorMaxAngularVelocity

    Description
    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.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • maxAngVel [REAL]: max velocity - Values = [0 ; inf[

    Code sample :

    HYP_PhysX.SetActorMaxAngularVelocity(objectId, 7.0)


    HYP_PhysX.SetActorAngularDamping

    Description
    Sets the damping factor of the object's angular velocity. This factor corresponds to the various energy losses which decrease the speed.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • damping [REAL]: damping factor - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorAngularDamping(objectId, 0.2)


    HYP_PhysX.GetActorAngularDamping

    Description
    Gets the damping factor of the object's angular velocity. This factor corresponds to the various energy losses which decrease the speed.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • damping [REAL]: damping factor

    Code sample :

    HYP_PhysX.SetActorAngularDamping(objectId, 0.2)


    HYP_PhysX.SetActorMass

    Description
    Sets the mass of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • mass [REAL]: object mass - Values = [0 ; inf[

    Code sample :

    HYP_PhysX.SetActorMass(objectId, 10.2)


    HYP_PhysX.GetActorMass

    Description
    Gets the mass of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • mass [REAL]: object mass

    Code sample :

    mass = HYP_PhysX.GetActorMass(objectId)


    HYP_PhysX.SetActorGlobalPosition

    Description
    Sets the absolute position (world space) of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: object position - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorGlobalPosition(objectId, px, py, pz)


    HYP_PhysX.GetActorGlobalPosition

    Description
    Gets the absolute position (world space) of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • x, y, z [REAL]: object position

    Code sample :

    x, y, z = HYP_PhysX.GetActorGlobalPosition(objectId)


    HYP_PhysX.SetActorGlobalOrientation

    Description
    Sets the absolute orientation (world space) of an object.

    Languages: Lua - Python

    Parameters
  • 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[

    Code sample :

    HYP_PhysX.SetActorGlobalOrientation(objectId, 30.0, 1.0, 0.0, 0.0)


    HYP_PhysX.SetActorGlobalOrientationEulerAngles

    Description
    Sets the absolute orientation (world space) of an object using Euler's angles.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • pitch, yaw, roll [REAL]: Euler's angles in degrees. - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.SetActorGlobalOrientationEulerAngles(objectId, 30.0, -15.0, 0.0)


    HYP_PhysX.MoveActorGlobalPosition

    Description
    Serves to move kinematically controlled dynamic actors through the game world.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: new position - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.MoveActorGlobalPosition(objectId, 0.0, 200.0, 0.0)


    HYP_PhysX.MoveActorGlobalOrientation

    Description
    Serves to move kinematically controlled dynamic actors through the game world.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z, w [REAL]: new orientation quaternion - Values = ]-inf ; inf[

    Code sample :

    HYP_PhysX.MoveActorGlobalOrientation(objectId, x, y, z, w)


    HYP_PhysX.RemoveActorFromScene

    Description
    Removes an actor from the physical engine scene.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Code sample :

    HYP_PhysX.RemoveActorFromScene(objectId)


    HYP_PhysX.AddBoxActorToScene

    Description
    Adds an box actor to the physic scene.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    ACTOR_DYNAMIC = 2
    HYP_PhysX.AddBoxActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)


    HYP_PhysX.AddSphereActorToScene

    Description
    Adds a sphere actor to the physic scene.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    ACTOR_DYNAMIC = 2
    HYP_PhysX.AddSphereActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)


    HYP_PhysX.AddSphereActorToScene

    Description
    Adds a sphere actor to the physic scene.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    ACTOR_DYNAMIC = 2
    HYP_PhysX.AddSphereActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)


    HYP_PhysX.AddPlaneActorToScene

    Description
    Adds a plane actor to the physic scene. Transformations like SetActorGlobalPosition or SetActorGlobalOrientation are ignored by the plane actor.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    ACTOR_STATIC = 1
    HYP_PhysX.AddPlaneActorToScene(objectId, ACTOR_STATIC, 20.0, 0.0)


    HYP_PhysX.AddMeshActorToScene

    Description
    Adds a mesh actor to the physic scene.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    ACTOR_DYNAMIC = 2
    HYP_PhysX.AddMeshActorToScene(objectId, ACTOR_DYNAMIC, 10.0, 0.0)


    HYP_PhysX.AddForceToActor

    Description
    Adds a force (linear movement) to an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: Force vector

    Code sample :

    HYP_PhysX.AddForceToActor(objectId, -2.0, 0.0, 0.0)


    HYP_PhysX.AddForceAtPosToActor

    Description
    Applies a force (or impulse) defined in the global coordinate frame, acting at a particular point in global coordinates, to the actor.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.AddForceAtPosToActor(objectId, -2.0, 0.0, 0.0, 10.0, 10.0, 0.0)


    HYP_PhysX.AddTorqueToActor

    Description
    Applies a torque (rotational movement) to an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [REAL]: torque vector.

    Code sample :

    HYP_PhysX.AddTorqueToActor(objectId, 0.1, 0.25, 0.0)


    HYP_PhysX.SetActorSleepLinearVelocity

    Description
    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.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • linVel [REAL]: Sleep linear velocity.

    Code sample :

    HYP_PhysX.SetActorSleepLinearVelocity(objectId, 0.1)


    HYP_PhysX.GetActorSleepLinearVelocity

    Description
    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.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • linVel [REAL]: Sleep linear velocity.

    Code sample :

    slv = HYP_PhysX.GetActorSleepLinearVelocity(objectId)


    HYP_PhysX.SetActorSleepAngularVelocity

    Description
    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().

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • angVel [REAL]: Sleep angular velocity.

    Code sample :

    HYP_PhysX.SetActorSleepAngularVelocity(objectId, angVel)


    HYP_PhysX.GetActorSleepAngularVelocity

    Description
    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().

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • angVel [REAL]: Sleep angular velocity.

    Code sample :

    angVel = HYP_PhysX.GetActorSleepAngularVelocity(objectId)


    HYP_PhysX.ForceActorToSleep

    Description
    Forces an actor to enter into hibernation.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Code sample :

    HYP_PhysX.ForceActorToSleep(objectId)


    HYP_PhysX.WakeUpActor

    Description
    Wakes up an actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Code sample :

    HYP_PhysX.WakeUpActor(objectId)


    HYP_PhysX.IsActorSleeping

    Description
    Gets the hibernation state of an actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • state [INTEGER]: Hibernation state.

    Code sample :

    state = HYP_PhysX.IsActorSleeping(objectId)


    HYP_PhysX.SetActorPairFlags

    Description
    Sets the contact pair flags for the given pair of actors.

    Languages: Lua - Python

    Parameters
  • objectId01 [INTEGER]: First bbject (or actor) identifier
  • objectId02 [INTEGER]: Second object (or actor) identifier

    Code sample :

    HYP_PhysX.SetActorPairFlags(objectId01, objectId02)


    HYP_PhysX.GetActorCollisionState

    Description
    Gets the collision state of an actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • state [INTEGER]: Collision state.

    Code sample :

    state = HYP_PhysX.GetActorCollisionState(objectId)


    HYP_PhysX.GetActorNumCollisionPoints

    Description
    Returns the number of contact/collision points for a given actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • n [INTEGER]: Number of contact/collision points.

    Code sample :

    n = HYP_PhysX.GetActorNumCollisionPoints(objectId)


    HYP_PhysX.GetActorCollisionPoint

    Description
    Returns a particular contact/collision point for a given actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • pointIndex [INTEGER]: Contact point index. Range:[0 ; HYP_PhysX.GetActorNumCollisionPoints()-1].

    Return Values
  • px, py, py [REAL]: Position of the contact point.
  • nx, ny, ny [REAL]: Normal of the contact point.

    Code sample :

    px, py, pz, nx, ny, nz = HYP_PhysX.GetActorCollisionPoint(objectId, 0)


    HYP_PhysX.ResetActorCollisionState

    Description
    resets contact/collision state for a given actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Code sample :

    HYP_PhysX.ResetActorCollisionState(objectId)


    HYP_PhysX.SetPhysicsEnginePauseSimultationState

    Description
    Puts in pause (or to suspend) the physical simulation. This is useful for example to accurately analyze the collision progress.

    Languages: Lua - Python

    Parameters
  • state [INTEGER]: Pause state - Values = 0|1

    Code sample :

    HYP_PhysX.SetPhysicsEnginePauseSimultationState(state)


    HYP_PhysX.SetActorKinematicState

    Description
    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).

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • state [INTEGER]: Kinematic state - Values = 0|1

    Code sample :

    HYP_PhysX.SetActorKinematicState(objectId, 1)


    HYP_PhysX.GetActorKinematicState

    Description
    Gets an actor kinematic state.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • state [INTEGER]: Kinematic state

    Code sample :

    state = HYP_PhysX.GetActorKinematicState(objectId)


    HYP_PhysX.SetActorGravityState

    Description
    Sets gravity state of an actor.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • state [INTEGER]: Gravity state - Values = 0|1

    Code sample :

    HYP_PhysX.SetActorGravityState(objectId, 1)


    HYP_PhysX.SetActorInertiaTensor

    Description
    Specifies the inertia tensor of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier
  • x, y, z [INTEGER]: Inertia tensor - Values = 0|1

    Code sample :

    HYP_PhysX.SetActorInertiaTensor(objectId, x, y, z)


    HYP_PhysX.GetActorInertiaTensor

    Description
    Gets the inertia tensor of an object.

    Languages: Lua - Python

    Parameters
  • objectId [INTEGER]: Object (or actor) identifier

    Return Values
  • x, y, z [INTEGER]: Inertia tensor

    Code sample :

    x, y, z = HYP_PhysX.GetActorInertiaTensor(objectId)


    HYP_PhysX.JointDestroy

    Description
    Destroys a joint.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier

    Code sample :

    HYP_PhysX.JointDestroy(jointId)


    HYP_PhysX.JointCreateFixed

    Description
    Creates a fixed joint between two actors.

    Languages: Lua - Python

    Parameters
  • objectId01 [INTEGER]: Object (or actor) identifier
  • objectId02 [INTEGER]: Object (or actor) identifier

    Return Values
  • jointId [INTEGER]: Joint identifier

    Code sample :

    jointId = HYP_PhysX.JointCreateFixed(objectId01, objectId02)


    HYP_PhysX.JointCreateRevolute

    Description
    Creates a revolute joint between two actors.

    Languages: Lua - Python

    Parameters
  • objectId01 [INTEGER]: Object (or actor) identifier
  • objectId02 [INTEGER]: Object (or actor) identifier
  • doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1

    Return Values
  • jointId [INTEGER]: Joint identifier

    Code sample :

    jointId = HYP_PhysX.JointCreateRevolute(objectId01, objectId02, 1)


    HYP_PhysX.JointCreateSpherical

    Description
    Creates a spherical joint between two actors.

    Languages: Lua - Python

    Parameters
  • objectId01 [INTEGER]: Object (or actor) identifier
  • objectId02 [INTEGER]: Object (or actor) identifier
  • doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1

    Return Values
  • jointId [INTEGER]: Joint identifier

    Code sample :

    jointId = HYP_PhysX.JointCreateSpherical(objectId01, objectId02, 1)


    HYP_PhysX.JointCreateCylindrical

    Description
    Creates a cylindrical joint between two actors.

    Languages: Lua - Python

    Parameters
  • objectId01 [INTEGER]: Object (or actor) identifier
  • objectId02 [INTEGER]: Object (or actor) identifier
  • doCollision [INTEGER]: enables collision between actors (0 or 1). - Values = 0|1

    Return Values
  • jointId [INTEGER]: Joint identifier

    Code sample :

    jointId = HYP_PhysX.JointCreateCylindrical(objectId01, objectId02, 1)


    HYP_PhysX.JointCreateDistance

    Description
    Creates a distance joint between two actors.

    Languages: Lua - Python

    Parameters
  • 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.

    Return Values
  • jointId [INTEGER]: Joint identifier

    Code sample :

    jointId = HYP_PhysX.JointCreateDistance(objectId01, objectId02, ax1, ay1, az1, ax2, ay2, az2, 10.0, 2.0)


    HYP_PhysX.JointSetGlobalAnchor

    Description
    sets the point where the two actors are attached, specified in world space.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier
  • x, y, z [REAL]: Anchor position

    Code sample :

    HYP_PhysX.JointSetGlobalAnchor(jointId, x, y, z)


    HYP_PhysX.JointSetGlobalAxis

    Description
    Sets the direction of the joint's primary axis, specified in global coordinates.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier
  • x, y, z [REAL]: direction of primary axis.

    Code sample :

    HYP_PhysX.JointSetGlobalAxis(jointId, x, y, z)


    HYP_PhysX.JointSetBreakableParams

    Description
    Sets the maximum force magnitude that the joint is able to withstand without breaking.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.JointSetBreakableParams(jointId, max_force, max_torque)


    HYP_PhysX.JointIsBroken

    Description
    Returns the broken state of a joint.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier

    Return Values
  • state [INTEGER]: If 1, the joint is broken.

    Code sample :

    state = HYP_PhysX.JointIsBroken(jointId)


    HYP_PhysX.JointSetLimitPoint

    Description
    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.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier
  • x, y, z [REAL]: limit point.

    Code sample :

    HYP_PhysX.JointSetLimitPoint(jointId, x, y, z)


    HYP_PhysX.JointAddLimitPlane

    Description
    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.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.JointAddLimitPlane(jointId, nx, ny, nz, px, py, pz, restitution)


    HYP_PhysX.JointPurgeLimitPlanes

    Description
    Deletes all limit planes added to the joint.

    Languages: Lua - Python

    Parameters
  • jointId [INTEGER]: Joint identifier

    Code sample :

    HYP_PhysX.JointPurgeLimitPlanes(jointId)


    HYP_PhysX.JointSetMotorParams

    Description
    Describes a motor joint.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_PhysX.JointSetMotorParams(jointId, 1, 10.2, 2.0, 1)


    HYP_PhysX.JointSetSpringParams

    Description
    Describes a spring joint.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.JointSetMotorParams(jointId, 1, 10.2, 2.0, 1)


    HYP_PhysX.JointSetSphericalParams

    Description
    Describes a spherical joint.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.JointSetSphericalParams(jointId, 1, 0.2, 0, 0.0, 0.0)


    HYP_PhysX.FluidCreate

    Description
    Creates a fluid.

    Languages: Lua - Python

    Parameters
  • num_particles [INTEGER]: Number max of particles

    Return Values
  • fluidId [INTEGER]: fluid id.

    Code sample :

    fluidId = HYP_PhysX.FluidCreate(10000)


    HYP_PhysX.FluidCreateEx

    Description
    Creates a fluid.

    Languages: Lua - Python

    Parameters
  • 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]:

    Return Values
  • fluidId [INTEGER]: fluid id.

    Code sample :

    fluidId = HYP_PhysX.FluidCreateEx(10000, 0, 1, 1, 2.0, 5.0, 3.0, 0.12, 16)


    HYP_PhysX.FluidDestroy

    Description
    Destroys a fluid.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.

    Code sample :

    HYP_PhysX.FluidDestroy(id)


    HYP_PhysX.FluidSetMaterial

    Description
    Sets the material that will be use during fluid rendering. The material allows to set the textures or GPU program for fluid rendering.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • materialId [INTEGER]: material id.

    Code sample :

    HYP_PhysX.FluidSetMaterial(fluidId, materialId)


    HYP_PhysX.FluidGetCurNumParticles

    Description
    Returns the current number of active particles.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.

    Return Values
  • num_particles [INTEGER]: number of active particles.

    Code sample :

    n = HYP_PhysX.FluidGetCurNumParticles(fluidId)


    HYP_PhysX.FluidSetExternalAcceleration

    Description
    Sets the external acceleration applied to each particle at each time step.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • x [REAL]: x acc.
  • y [REAL]: y acc.
  • z [REAL]: z acc.

    Code sample :

    HYP_PhysX.FluidSetExternalAcceleration(fluidId, x, y, z)


    HYP_PhysX.FluidSetStiffness

    Description
    Sets fluid stiffness.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • x [REAL]: stiffness.

    Code sample :

    HYP_PhysX.FluidSetStiffness(fluidId, x)


    HYP_PhysX.FluidSetViscosity

    Description
    Sets fluid viscosity.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • x [REAL]: viscosity.

    Code sample :

    HYP_PhysX.FluidSetViscosity(fluidId, x)


    HYP_PhysX.FluidSetSurfaceTension

    Description
    Sets fluid surface tension.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • x [REAL]: surface tension.

    Code sample :

    HYP_PhysX.FluidSetSurfaceTension(fluidId, x)


    HYP_PhysX.FluidSetDamping

    Description
    Sets fluid damping.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • x [REAL]: damping.

    Code sample :

    HYP_PhysX.FluidSetDamping(fluidId, x)


    HYP_PhysX.FluidSetShapeRestitution

    Description
    Sets fluid restitution.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • s [REAL]: restitution for static shapes.
  • d [REAL]: restitution for dynamic shapes.

    Code sample :

    HYP_PhysX.FluidSetShapeRestitution(fluidId, s, d)


    HYP_PhysX.FluidSetPointSpriteState

    Description
    Sets the use of point sprite particle for fluid rendering.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • state [INTEGER]: state: 0 or 1.

    Code sample :

    HYP_PhysX.FluidSetPointSpriteState(fluidId, s, d)


    HYP_PhysX.FluidSetBlendingParams

    Description
    Sets color belnding params for fluid rendering.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • state [INTEGER]: enables or disables color blending
  • s [INTEGER]: source factor
  • d [INTEGER]: destination factor

    Code sample :

    HYP_PhysX.FluidSetBlendingParams(fluidId, state, s, d)


    HYP_PhysX.FluidSetLightingState

    Description
    Sets the lighting state for fluid rendering.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • state [INTEGER]: enables or disables the lighting

    Code sample :

    HYP_PhysX.FluidSetLightingState(fluidId, state)


    HYP_PhysX.FluidSetTexturingState

    Description
    Sets the texturing state for fluid rendering.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • state [INTEGER]: enables or disables the texturing

    Code sample :

    HYP_PhysX.FluidSetTexturingState(fluidId, state)


    HYP_PhysX.FluidSetDepthTestParams

    Description
    Sets the depth test params for fluid rendering.

    Languages: Lua - Python

    Parameters
  • 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

    Code sample :

    HYP_PhysX.FluidSetDepthTestParams(fluidId, do_depth_testing, enable_depth_buffer_writing)


    HYP_PhysX.FluidEmitterCreate

    Description
    Creates an emitter.

    Languages: Lua - Python

    Parameters
  • 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

    Return Values
  • emitterId [INTEGER]: emitter id.

    Code sample :

    emitterId = HYP_PhysX.FluidEmitterCreate(fluidId, frameShapeActorId, lifetime, constant_flow_rate, emitterDimX, emitterDimY)


    HYP_PhysX.FluidEmitterDestroy

    Description
    Destroys an emitter.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.

    Code sample :

    HYP_PhysX.FluidEmitterDestroy(fluidId, emitterId)


    HYP_PhysX.FluidEmitterAttachToActor

    Description
    Attaches an emitter to an actor.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • actorId [INTEGER]: actor id.

    Code sample :

    HYP_PhysX.FluidEmitterAttachToActor(fluidId, emitterId, actorId)


    HYP_PhysX.FluidEmitterSetEmissionState

    Description
    Sets the emission state of an emitter.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • state [INTEGER]: emission state (0 or 1).

    Code sample :

    HYP_PhysX.FluidEmitterSetEmissionState(fluidId, emitterId, state)


    HYP_PhysX.FluidEmitterSetFluidVelocityMagnitude

    Description
    Sets fluid speed.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: speed.

    Code sample :

    HYP_PhysX.FluidEmitterSetFluidVelocityMagnitude(fluidId, emitterId, x)


    HYP_PhysX.FluidEmitterSetRandomAngle

    Description
    Sets emission random angle.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: angle.

    Code sample :

    HYP_PhysX.FluidEmitterSetRandomAngle(fluidId, emitterId, x)


    HYP_PhysX.FluidEmitterSetRandomPos

    Description
    Sets emission random position.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: x position.
  • y [REAL]: y position.
  • z [REAL]: z position.

    Code sample :

    HYP_PhysX.FluidEmitterSetRandomPos(fluidId, emitterId, x, y, z)


    HYP_PhysX.FluidEmitterSetRate

    Description
    Sets emitter rate in particle per second.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: rate.

    Code sample :

    HYP_PhysX.FluidEmitterSetRate(fluidId, emitterId, x)


    HYP_PhysX.FluidEmitterSetParticleLifetime

    Description
    Sets particle lifetime.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: lifetime.

    Code sample :

    HYP_PhysX.FluidEmitterSetParticleLifetime(fluidId, emitterId, x)


    HYP_PhysX.FluidEmitterSetRepulsionCoefficient

    Description
    Sets emitter repulsion coefficient.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: coef.

    Code sample :

    HYP_PhysX.FluidEmitterSetRepulsionCoefficient(fluidId, emitterId, x)


    HYP_PhysX.FluidEmitterSetGlobalPosition

    Description
    Sets the global position of the emitter.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: x position.
  • y [REAL]: y position.
  • z [REAL]: z position.

    Code sample :

    HYP_PhysX.FluidEmitterSetGlobalPosition(fluidId, emitterId, x, y, z)


    HYP_PhysX.FluidEmitterSetGlobalOrientation

    Description
    Sets the global orientation of the emitter.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.FluidEmitterSetGlobalOrientation(fluidId, emitterId, 30.0, x, y, z)


    HYP_PhysX.FluidEmitterSetGlobalOrientationFromEulerAngles

    Description
    Sets the global orientation of the emitter from Euler's angles.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: pitch.
  • y [REAL]: yaw.
  • z [REAL]: roll.

    Code sample :

    HYP_PhysX.FluidEmitterSetGlobalOrientation(fluidId, emitterId, x, y, z)


    HYP_PhysX.FluidEmitterSetLocalPosition

    Description
    Sets the local position of the emitter.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: x position.
  • y [REAL]: y position.
  • z [REAL]: z position.

    Code sample :

    HYP_PhysX.FluidEmitterSetLocalPosition(fluidId, emitterId, x, y, z)


    HYP_PhysX.FluidEmitterSetLocalOrientation

    Description
    Sets the local orientation of the emitter.

    Languages: Lua - Python

    Parameters
  • 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.

    Code sample :

    HYP_PhysX.FluidEmitterSetLocalOrientation(fluidId, emitterId, 30.0, x, y, z)


    HYP_PhysX.FluidEmitterSetLocalOrientationFromEulerAngles

    Description
    Sets the local orientation of the emitter from Euler's angles.

    Languages: Lua - Python

    Parameters
  • fluidId [INTEGER]: fluid id.
  • emitterId [INTEGER]: emitter id.
  • x [REAL]: pitch.
  • y [REAL]: yaw.
  • z [REAL]: roll.

    Code sample :

    HYP_PhysX.FluidEmitterSetLocalOrientation(fluidId, emitterId, x, y, z)




  • Random Projects

    Dream Vision Effect
    Dream Vision Effect

    Night Vision PostFX
    Night Vision PostFX

    PyOpenGL_LAB
    PyOpenGL_LAB


    Random Code Samples

    2D Bitmap fonts
    2D Bitmap fonts

    Point Emitter
    Point Emitter

    W4K Format Loading
    W4K Format Loading



    (C)2009-2010 Geeks3D.com