Project

General

Profile

Scol standard library package  0.3.1
Common and usefull functions for all Scol applications
The library : 3d physics API

Functions

 b3d_physicsDebug (strSession, state)
 Show / Hide the debug physics lines.
 b3d_physicsEnable (strSession, state)
 Enable / Disable the physics world.
 b3d_physicsGetArchi (strSession)
 Get the platform architecture.
 b3d_physicsGetFps (strSession)
 Get the fps model.
 b3d_physicsGetFriction (strSession)
 Get the friction model.
 b3d_physicsGetGravity (strSession)
 Get the world gravity.
 b3d_physicsGetSize (strSession)
 Get the world size.
 b3d_physicsGetSolver (strSession)
 Get the solver model.
 b3d_physicsInitBodies (strSession)
 Set the current PRS as initial PRS to all bodies.
 b3d_physicsIsDebug (strSession, state)
 Return if the debug physics lines is shown / hidden.
 b3d_physicsIsEnabled (strSession)
 Return if the physics world is enabled / disabled.
 b3d_physicsReset (strSession)
 Reset the physics world and all bodies states.
 b3d_physicsSetArchi (strSession, mode)
 Set the platform architecture.
 b3d_physicsSetDefault (strSession)
 Set the physics with the default values.
 b3d_physicsSetFps (strSession, value)
 Set the fps model.
 b3d_physicsSetFriction (strSession, mode)
 Set the friction model.
 b3d_physicsSetGravity (strSession, vector)
 Set the world gravity.
 b3d_physicsSetGravityEarth (strSession)
 Set the world gravity as on Earth (x = 0, y = 9.81, z = 0).
 b3d_physicsSetSize (strSession, vector)
 Set the world size.
 b3d_physicsSetSolver (strSession, mode)
 Set the solver model.

Detailed Description

Function Documentation

b3d_physicsSetArchi ( strSession  ,
mode   
)

Set the platform architecture.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: the chosen mode :
  • SO3_PA_DEFAULT
  • SO3_PA_MEDIUM
  • SO3_PA_BEST
Returns
I : 0 if success or 1 if error
b3d_physicsGetArchi ( strSession  )

Get the platform architecture.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : this architecture or nil if error
b3d_physicsSetSolver ( strSession  ,
mode   
)

Set the solver model.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: the chosen mode :
  • SO3_SM_EXACT
  • SO3_SM_ADAPTATIVE
Returns
I : 0 if success or 1 if error
b3d_physicsGetSolver ( strSession  )

Get the solver model.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : the solver if success or nil if error
b3d_physicsSetFriction ( strSession  ,
mode   
)

Set the friction model.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: the chosen mode :
  • SO3_SM_EXACT
  • SO3_SM_ADAPTATIVE
Returns
I : 0 if success or 1 if error
b3d_physicsGetFriction ( strSession  )

Get the friction model.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : this friction if success or nil if error
b3d_physicsSetSize ( strSession  ,
vector   
)

Set the world size.

Prototype : fun [LIB3D_Session [F F F]] I

Parameters
LIB3D_Session: a session object
[FF F] : the 3d three compnents (x, y, z) If a component is nil, its value will be 1000 (default value)
Returns
I : 0 if success or 1 if error
b3d_physicsGetSize ( strSession  )

Get the world size.

Prototype : fun [LIB3D_Session] [F F F]

Parameters
LIB3D_Session: a session object
Returns
[F F F] : the 3d three compnents (x, y, z) if success or nil if error
b3d_physicsSetFps ( strSession  ,
value   
)

Set the fps model.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: the fps (60 by default, if this value is nil)
Returns
I : 0 if success or 1 if error
b3d_physicsGetFps ( strSession  )

Get the fps model.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : the FPS if success or nil if error
b3d_physicsSetGravity ( strSession  ,
vector   
)

Set the world gravity.

Prototype : fun [LIB3D_Session [F F F]] I

Parameters
LIB3D_Session: a session object
[FF F] : the graivity in the three directions (x, y, z) If a component is nil, its value will be 0 (default value)
Returns
I : 0 if success or 1 if error
b3d_physicsSetGravityEarth ( strSession  )

Set the world gravity as on Earth (x = 0, y = 9.81, z = 0).

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : 0 if success or 1 if error
b3d_physicsGetGravity ( strSession  )

Get the world gravity.

Prototype : fun [LIB3D_Session] [F F F]

Parameters
LIB3D_Session: a session object
Returns
[F F F] : the graivity in the three directions (x, y, z) if success or nil if error
b3d_physicsSetDefault ( strSession  )

Set the physics with the default values.

  • Archi plateforme = SO3_PA_DEFAULT
  • Solver = SO3_SM_ADAPTATIVE
  • Friction = SO3_SM_ADAPTATIVE
  • Size = [1000.0 1000.0 1000.0]
  • Fps = 60
  • Gravity = [0.0 0.0 0.0]

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : 0 if success or another positive value if error, nil if the given session object is nil
b3d_physicsEnable ( strSession  ,
state   
)

Enable / Disable the physics world.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: 1 to enable, 0 to disable
Returns
I : 0 if success or 1 if error
b3d_physicsIsEnabled ( strSession  )

Return if the physics world is enabled / disabled.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : 0 if disable, 1 if enabled or nil if error
b3d_physicsReset ( strSession  )

Reset the physics world and all bodies states.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : 0 if success or 1 if error
b3d_physicsInitBodies ( strSession  )

Set the current PRS as initial PRS to all bodies.

Prototype : fun [LIB3D_Session] I

Parameters
LIB3D_Session: a session object
Returns
I : 0 if success or 1 if error
b3d_physicsDebug ( strSession  ,
state   
)

Show / Hide the debug physics lines.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: 1 to show, 0 to hide
Returns
I : 0 if success or 1 if error
b3d_physicsIsDebug ( strSession  ,
state   
)

Return if the debug physics lines is shown / hidden.

Prototype : fun [LIB3D_Session I] I

Parameters
LIB3D_Session: a session object
I: 1 to show, 0 to hide
Returns
I : 0 if hidden, 1 if shown or nil if error