Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007524opensim[REGION] Script Functionspublic2015-04-06 18:292015-08-18 09:34
Assigned Tonebadon 
PlatformLinuxOperating SystemSlackwareOperating System Version14.1
Product Versionmaster (dev code) 
Target VersionFixed in Version 
Summary0007524: llTargetOmega ignores gain arguement
DescriptionllTargetOmega in xengine ignores the gain argument. As per [^] , the gain argument shall modulates the final spinrate and disables the rotation behavior if zero.

This is simple to fix, really, just multiply spinrate by gain.
Steps To ReproducellTargetOmega(<1.0,0.0,0.0>*llGetRot(), 0.1, 0.01);


llTargetOmega(<1.0,0.0,0.0>*llGetRot(), 0.1, 1.0);


llTargetOmega(<1.0,0.0,0.0>*llGetRot(), 0.1, 0.0); <- this one should actually stop the rotation completely per spec.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineBulletSim
Script Engine
EnvironmentMono / Linux64
Mono Versiontrunk
Attached Filesdiff file icon patch.diff [^] (1,052 bytes) 2015-04-06 18:29 [Show Content]
patch file icon 0001-Fix-llTargetOmega-non-physical-gain.patch [^] (1,057 bytes) 2015-04-07 23:17 [Show Content]

- Relationships
related to 0006543resolvedtampa llTargetOmega not work on physical prims 
related to 0007304new llTargetOmega not implemented for Physical object 

-  Notes
Magnuz (reporter)
2015-04-07 11:07
edited on: 2015-04-07 23:16

I'm sorry, but this interpretation of gain in llTargetOmega is not correct.
The description in [^] is over-simplified and incomplete.
The description in [^] is somewhat better.

llTargetOmega( vector axis, float spinrate, float gain ) is really two different functions, even if they produce visually similar results.

Function 1, non-physical llTargetOmega, in SL:
'axis' = the axis around which the object rotates.
'spinrate' * length('axis') = the spin rate in radians per second the object rotates with if gain is non-zero.
'gain' = rotation on if non-zero, off if zero.
Stated to be entirely client-side once set from the server, but there are indications it is now continuously synchronized from the server in SL.
'gain' is not implemented in OpenSim, but should be used like this for non-physical objects:

         protected void TargetOmega(SceneObjectPart part, LSL_Vector axis, double spinrate, double gain)
            PhysicsActor pa = part.PhysActor;
            if ( ( pa == null || !pa.IsPhysical ) && gain == 0.0d )
                spinrate = 0.0d;
             part.UpdateAngularVelocity(axis * spinrate);

Function 2, physical llTargetOmega, in SL:
'axis' = the axis around which the object rotates.
'spinrate' * length('axis') = the spin rate in radians per second the object tries to reach, affected by other physics interaction like powers and friction.
'gain' = the strength with which the object tries to reach or maintain the set spin rate. With a smaller 'gain', the acceleration is slower, and if it doesn't exceed counter-acting physics interactions, like friction, actual spin rate will never reach set spin rate and may actually stay at zero.
'gain' is not implemented in OpenSim, and requires a rather complex physics model to work like in SL. Perhaps something for Robert Adams.

I added the patch ( 0001-Fix-llTargetOmega-non-physical-gain.patch ) for the non-physical version.

nebadon (administrator)
2015-04-12 12:17

patch applied > [^]
aiaustin (developer)
2015-08-18 09:34

Resolved issue marked as closed. Please open a new issue and refer to this one if problems arise.

- Issue History
Date Modified Username Field Change
2015-04-06 18:29 cinderblocks New Issue
2015-04-06 18:29 cinderblocks File Added: patch.diff
2015-04-06 18:30 cinderblocks Status new => patch included
2015-04-07 11:07 Magnuz Note Added: 0027986
2015-04-07 23:16 Magnuz Note Edited: 0027986 View Revisions
2015-04-07 23:17 Magnuz File Added: 0001-Fix-llTargetOmega-non-physical-gain.patch
2015-04-12 12:17 nebadon Note Added: 0027995
2015-04-12 12:18 nebadon Status patch included => resolved
2015-04-12 12:18 nebadon Resolution open => fixed
2015-04-12 12:18 nebadon Assigned To => nebadon
2015-04-13 10:54 Magnuz Relationship added related to 0006543
2015-04-13 10:54 Magnuz Relationship added related to 0007304
2015-08-18 09:34 aiaustin Note Added: 0029239
2015-08-18 09:34 aiaustin Status resolved => closed

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker