Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0002842opensim[REGION] Physics Enginespublic2008-12-15 11:372012-09-17 22:06
Assigned To 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0002842: The Recent Activation of llSetTorque Will Not Toggle
DescriptionHere is some code for a simple cube object. If you rez it and click it, it should turn torque on and off.

float grav = 9.8;
float mass;
integer toggle = 1;
        mass = llGetMass();
        llSetStatus(STATUS_PHYSICS, TRUE);
    touch_start(integer num)
    if (toggle < 0) llSetTorque(mass * <0,0,0>, FALSE);
    if (toggle > 0) llSetTorque(mass * <50, 0, 0>, FALSE);
     toggle *= -1;

The cube spins on first click, then stops spinning on second click. Then it will not restart with additional clicks.

Unless, you play around and edit it, or set it non physical. The "re-energizing" of rotation seems to be related to the cube being set briefly non physical (or non-existant).
Additional InformationBehaves thus in Hiro's sim. No idea of his sim version config so what I specify below could be bogus.

Significant issue . . . setting llSetTorque to 0 . . . it's not clear that should stop rotation or merely stop continued acceleration of rotation rate.
TagsNo tags attached.
Git Revision or version number
Run Mode Grid (1 Region per Sim)
Physics EngineODE
Script Engine
EnvironmentMono / Windows
Mono Version2.0.1
Attached Files

- Relationships

-  Notes
Twitch (manager)
2008-12-16 07:02

This may be a broader problem with the touch event. I have a cigar I've been smoking for 6 or 8 months that is touch-activated - I can no longer get it to work as of r7708
Twitch (manager)
2008-12-16 07:03

Owen's LSL code was also tested on my region running on 32 bit debian unstable with mono r2.3a, yielding similar results
OwenOyen (reporter)
2008-12-30 09:11

The toggle appears to work now. But there is a new observation.

A cube rezzed on the ground and with the script pasted above within it will begin to rise vertically upward from the torque of the cube corner pushing against the ground (one supposes). A click of the cube stops this vertical motion and there is nothing in the script to cause this.

The click also does nothing to the cube rotation, and probably properly. Another click increases the rotation rate, also probably properly.

The rotation/torque-relevant LSL script instructions activated are llApplyRotationalImpulse and llSetTorque. It would be VERY GOOD if llTargetOmega were included with these two torque-relevant LSL instructions activated. Boat heading change simplifies with llTargetOmega.
OwenOyen (reporter)
2008-12-30 09:18

Additional observation. This is bad.

The stop vertical motion noted above is clearly a flaw in implementation. llSetRot sets velocity to zero (the object becomes non physical briefly) in order to rotate. I have placed llSetTorque in a boat and executed it and I find it now behaves just like llSetRot -- meaning the velocity is going to zero for each turn, which is not as it should be. llSetTorque is supposed to operate on purely physical objects, without ever setting them non physical.
Fly-Man- (developer)
2009-09-18 09:18

Tested this with a local region server

1st click: Prim turns
2nd click: Prim stops
3rd click: Prim turns again
makopoppo (manager)
2011-08-06 20:26

At least, tested on 0.7.2-dev, the phenomenon described in (0008561) still exists.
thomax (reporter)
2012-09-17 22:06

confirmed in september 2012

- Issue History
Date Modified Username Field Change
2008-12-15 11:37 OwenOyen New Issue
2008-12-15 11:37 OwenOyen SVN Revision => 0
2008-12-15 11:37 OwenOyen Run Mode => Grid (1 Region per Sim)
2008-12-15 11:37 OwenOyen Physics Engine => ODE
2008-12-15 11:37 OwenOyen Environment => Mono / Windows
2008-12-15 11:37 OwenOyen Mono Version => 2.0.1
2008-12-16 07:02 Twitch Note Added: 0007988
2008-12-16 07:03 Twitch Note Added: 0007989
2008-12-30 09:11 OwenOyen Note Added: 0008561
2008-12-30 09:18 OwenOyen Note Added: 0008562
2009-09-18 09:18 Fly-Man- Note Added: 0013482
2009-09-18 09:18 Fly-Man- Status new => feedback
2011-08-06 20:26 makopoppo Note Added: 0019405
2011-08-06 20:26 makopoppo Status feedback => acknowledged
2012-09-17 22:06 thomax Note Added: 0022624

Copyright © 2000 - 2012 MantisBT Group
Powered by Mantis Bugtracker