My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
jsode  
jsode module
doc
Updated May 31, 2009 by sou...@gmail.com

If something seems wrong or incomplete, please enter a comment at the bottom of this page.



- source - main - QA -

jsode module

jsode is a module that manages support to ODE. ODE is an open source, high performance library for simulating rigid body dynamics. It is fully featured, stable, mature and platform independent with an easy to use C/C++ API. It has advanced joint types and integrated collision detection with friction. ODE is useful for simulating vehicles, objects in virtual reality environments and virtual creatures. It is currently used in many computer games, 3D authoring tools and simulation tools.
note:
In the following API description, vec3 type is a js 3 dimentions Array like [1,3,5]


class jsode::World

- top - revision -

constructor

constructor()
dWorldCreate
note:
This function creates also a Space (space) object and a SurfaceParameters object (defaultSurfaceParameters).

Methods

Destroy

Destroy()
TBD

Step

Step( time [, iterations] )
note:
If the iterations argument is given, this uses an iterative method that takes time on the order of m*N and memory on the order of m, where m is the total number of constraint rows and N is the number of iterations.

Properties

gravity

vec3 gravity
Gets or sets the gravity vector for a given world.

real

real ERP
dWorldGetERP
  • real CFM
  • dWorldGetCFM
  • real contactSurfaceLayer
  • dWorldGetContactSurfaceLayer

env

Body env
Returns the environment object that is the fixed body of this world (like the ground).

???

  • efaultSurfaceParameters
  • This defines the default properties of the colliding grometries surfaces.

    The property is read-only but not i'ts content.
  • space
  • This is the default space object that is bound to the world.

class jsode::Body

- top - revision -

constructor

constructor( world )
TBD

Methods

Destroy

void Destroy()
TBD dBodyDestroy

IsConnectedTo

boolean IsConnectedTo( body )
TBD dAreConnected

Properties

vector

vec3 position
dBodySetPosition
  • vec4 quaternion
  • dBodySetQuaternion

  • vec3 linearVel
  • dBodySetLinearVel
  • vec3 angularVel
  • dBodySetAngularVel
  • vec3 force
  • dBodySetForce
  • vec3 torque
  • dBodySetTorque

mass

mass
Is the mass object (jsode::Mass) of the body.

Native Interface

  • NIMatrix44Read
  • Is the current body's position.

class jsode::Geom

- top - revision -

Methods

Destroy

  • estroy()
  • dGeomSetData NULL, dGeomDestroy

Properties

enable

boolean enable
Is the status of the geometry.

body

body body
Bind the current geometry to the given body object.

offset

  • ffset
  • Sets the position and rotation of the geometry to its center of mass.

    Use undefined value to reset the geometry offset.

tansformation

  • ansformation
  • Sets the position and rotation of the geometry to its center of mass.

position

vec3 position
Is the current position of the geometry.

Callback functions

  • impact(index, thisGeom, againstGeom, position);
  • This function is called each time two geometries collide together. index is the index of the collision between step and step+1.

    thisGeom is the geometry that is colliding (usualy, this object).

    againstGeom is the geometry against with this geometry is colliding (the other Geom).

    vec3 position is the position of the impact point in world position.

Native Interface

  • NIMatrix44Read
  • Is the current geometry's position.

class jsode::GeomBoxjsode::Geom

- top - revision -

constructor

constructor( space )
TBD

Properties

lengths

vec3 lengths
Is the x, y, z size of the box.

class jsode::GeomCapsulejsode::Geom

- top - revision -

constructor

constructor( space )
TBD

Properties

radius

real radius
TBD

length

real length
Is the length of the capsule.

class jsode::GeomPlanejsode::Geom

- top - revision -

constructor

constructor( space )
TBD

class jsode::GeomRayjsode::Geom

- top - revision -

constructor

constructor( space )
TBD

length

real length
TBD

start

vec3 start
TBD

direction

vec3 direction
TBD

class jsode::GeomSpherejsode::Geom

- top - revision -

constructor

constructor( space )
TBD

Properties

radius

real radius

class jsode::GeomTrimeshjsode::Geom

- top - revision -

constructor

constructor( space )
TBD

class jsode::Joint

- top - revision -

Methods

Destroy

Destroy()
TBD

Properties

body1

Body body1
Set the first body of the joint.

body2

Body body2
Set the second body of the joint.

useFeedback

boolean useFeedback
Set to true activates the feedback, and ALSE to desactivates it.

Using feedback will allows body1Force, body1Torque, body2Force and body2Torque to be used.

feedbackVector

vec3 body1Force
Is the current force vector that applies to the body1 if feedback is activated.
  • vec3 body1Torque
  • Is the current torque vector that applies to the body1 if feedback is activated.
  • vec3 body2Force
Is the current force vector that applies to the body2 if feedback is activated.
  • vec3 body2Torque
  • Is the current torque vector that applies to the body2 if feedback is activated.

jointParam

real loStop
  • real hiStop
  • real bounce
  • real CFM
  • real stopERP
  • real stopCFM
  • real velocity
  • real maxForce

class jsode::JointBalljsode::Joint

- top - revision -

constructor

constructor( world )

Properties

anchor

vec3 anchor

anchor2

vec3 anchor2

class jsode::JointFixedjsode::Joint

- top - revision -

constructor

constructor( world )

Methods

Set

Set()
Set the current position of body1 and body2 as fixed.

class jsode::JointHingejsode::Joint

- top - revision -

Methods

constructor

constructor( world )
TBD

AddTorque

void AddTorque( torque )
TBD

Properties

anchor

vec3 anchor
TBD

anchor2

vec3 anchor2
TBD

axis

vec3 axis
Get or set the axis of the joint.

angle

real angle
Get the current angle.

angleRate

real angleRate
Get the current rotation speed.

class jsode::JointPlanejsode::Joint

- top - revision -

constructor

constructor( world )
TBD

class jsode::JointSliderjsode::Joint

- top - revision -

constructor

constructor( world )
TBD

Properties

axis

vec3 axis
TBD

position

real position
TBD

positionRate

real positionRate
TBD

class jsode::Mass

- top - revision -

Methods

Translate

void Translate( vec3 )
TBD dMassTranslate + dBodySetMass

Adjust

void Adjust( mass )
TBD dBodyGetMass, dMassAdjust, dBodySetMass

SetZero

void SetZero()
TBD dBodyGetMass, dMassSetZero, dBodySetMass

SetBoxTotal

SetBoxTotal( mass, vec3 )
TBD dBodyGetMass, dMassSetBoxTotal, dBodySetMass

Properties

value

real value
TBD dBodyGetMass, dBodySetMass

center

vec3 center
TBD dBodyGetMass, dBodySetMass get/set a vec3

class jsode::Space

- top - revision -

constructor

constructor( parentSpace )

class jsode::SurfaceParameters

- top - revision -

constructor

constructor()
note:
by default, mu is set to Infinity.

Properties

surface

  • real mu
  • Coulomb friction coefficient. This must be in the range 0 to dInfinity. 0 results in a frictionless contact, and dInfinity results in a contact that never slips. Note that frictionless contacts are less time consuming to compute than ones with friction, and infinite friction contacts can be cheaper than contacts with finite friction. This must always be set.

  • real mu2
  • Optional Coulomb friction coefficient for friction direction 2 (0..dInfinity).

  • real bounce
  • Restitution parameter (0..1). 0 means the surfaces are not bouncy at all, 1 is maximum bouncyness.
  • real bounceVel
  • The minimum incoming velocity necessary for bounce. Incoming velocities below this will effectively have a bounce parameter of 0.
  • real softERP
  • Contact normal "softness" parameter.
  • real softCFM
  • Contact normal "softness" parameter.
  • real motion1, real motion2, real motionN
  • Surface velocity in friction directions 1 and 2 and along the normal.
  • real slip1, real slip2
  • The coefficients of force-dependent-slip (FDS) for friction directions 1 and 2.
note:
Use undefined as value to reset the property.
ODE API:
dSurfaceParameters

- top - main -


Sign in to add a comment
Powered by Google Project Hosting