Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008141opensim[REGION] Script Functionspublic2017-04-04 05:302017-06-26 03:01
Assigned ToUbitUmarov 
PlatformOperating SystemOperating System Version
Product Versionmaster (dev code) 
Target Versionmaster (dev code)Fixed in Version 
Summary0008141: experimental Inertia override
Descriptionso far mass, center of mass and moment of inertia of a link set are calculated automatically from the prims density, volume, shape and relative positions. In most cases only prims known to physics are consider. So every time you change prims, the dynamic characteristics of the link set change.
Additionally the automatic calculations may not be that good in same cases.

added a new set of functions to replace those automatic values by ones provided on script.
the values are stored on the root prim

osSetInertia(float mass, vector centerOfMass, vector principalInertiaScaled, rotation lslrot)

- Mass total mass of link set
- centerOfMass location of center of mass relative to root prim in local frame
- principalInertiaScaled moment of inertia relative to principal axis and center of mass,Ixx, Iyy, Izz divided by mass so they can be changed independently
- lslrot rotation of the inertia, relative to local axis

to avoid think about moment of inertia relative to a body principal axis, we can tell they can be like the ones of a box, sphere or cylinder

osSetInertiaAsBox(float mass, vector boxSize, vector centerOfMass, rotation lslrot)

osSetInertiaAsCylinder(float mass, float radius, float lenght, vector centerOfMass, rotation lslrot)

osSetInertiaAsSphere(float mass, float radius, vector centerOfMass)

to return to normal calculation:


for debug:
list osGetInertiaData()

 returns a list with contents:
- float the total mass of the link set
- vector center mass position relative to root prim
- vector elements of diagonal of inertia Ixx,Iyy,Izz divided by total mass
- vector elements of upper triangle of inertia Ixy (= Iyx), Ixz (= Izx), Iyz(= Izy) divided by total mass

only supported by ubOde for now

unrealistic values can be used, but should be avoid. Restrictions may be added In future. Some may make the physics engine very unhappy
if the relative scale of Ijj, or box dimensions is large, physics simulation math errors will also large.
the Inertia values and box, cylinder or sphere dimensions can't not be zero

TagsNo tags attached.
Git Revision or version number
Run ModeStandalone (1 Region)
Physics EngineubODE
Script Engine
Mono VersionNone
Attached Files

- Relationships

-  Notes
UbitUmarov (administrator)
2017-04-14 17:36

keep in mind that simulation units are still not SI.
Water as a density of 1000Kg/m3 but in simulation that is 10MassUnits/m3
so provide a mass you would consider from RL divided by 100. ie for a 2000kg car use 20.
djphil (reporter)
2017-06-26 03:01
edited on: 2017-06-26 03:02

Please, keep in mind.

If new functions are added to opensim but are not added to the opensim wiki, then many users ignore their existence and how they work.

In this case, creating new function loses much of its interest ...

Call for Volunteers

osClearInertia @ [^]
osGetInertiaData@ [^]
osSetInertia @ [^]
osSetInertiaAsBox @ [^]
osSetInertiaAsCylinder @ [^]
osSetInertiaAsSphere @ [^]

Tank you in advance.

- Issue History
Date Modified Username Field Change
2017-04-04 05:30 UbitUmarov New Issue
2017-04-04 05:30 UbitUmarov Status new => assigned
2017-04-04 05:30 UbitUmarov Assigned To => UbitUmarov
2017-04-14 17:36 UbitUmarov Note Added: 0031753
2017-06-26 03:01 djphil Note Added: 0032076
2017-06-26 03:02 djphil Note Edited: 0032076 View Revisions
2017-06-26 03:02 djphil Note Edited: 0032076 View Revisions

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker