MantisBT - opensim
View Issue Details
0007524opensim[REGION] Script Functionspublic2015-04-06 18:292015-08-18 09:34
master (dev code) 
Grid (1 Region per Sim)
Mono / Linux64
0007524: llTargetOmega ignores gain arguement
llTargetOmega 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.
llTargetOmega(<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.
No tags attached.
related to 0006543new  llTargetOmega not work on physical prims 
related to 0007304new  llTargetOmega not implemented for Physical object 
diff patch.diff (1,052) 2015-04-06 18:29
patch 0001-Fix-llTargetOmega-non-physical-gain.patch (1,057) 2015-04-07 23:17
Issue History
2015-04-06 18:29cinderblocksNew Issue
2015-04-06 18:29cinderblocksFile Added: patch.diff
2015-04-06 18:30cinderblocksStatusnew => patch included
2015-04-07 11:07MagnuzNote Added: 0027986
2015-04-07 23:16MagnuzNote Edited: 0027986bug_revision_view_page.php?bugnote_id=27986#r3994
2015-04-07 23:17MagnuzFile Added: 0001-Fix-llTargetOmega-non-physical-gain.patch
2015-04-12 12:17nebadonNote Added: 0027995
2015-04-12 12:18nebadonStatuspatch included => resolved
2015-04-12 12:18nebadonResolutionopen => fixed
2015-04-12 12:18nebadonAssigned To => nebadon
2015-04-13 10:54MagnuzRelationship addedrelated to 0006543
2015-04-13 10:54MagnuzRelationship addedrelated to 0007304
2015-08-18 09:34aiaustinNote Added: 0029239
2015-08-18 09:34aiaustinStatusresolved => closed

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.

2015-04-12 12:17   
patch applied > [^]
2015-08-18 09:34   
Resolved issue marked as closed. Please open a new issue and refer to this one if problems arise.