MantisBT - opensim
View Issue Details
0005488opensim[REGION] Script Functionspublic2011-05-18 11:262015-01-15 15:58
ebremer 
Robert Adams 
normalmajoralways
assignedopen 
 
 
diva-r15402-b
Standalone (Multiple Regions)
BasicPhysics
.NET / Windows64
None
Second Life 2.6.6 -229662
0005488: llLookAt not working on diva-r15402-b
This script does not work in OpenSim, but does work fine in Second Life. sensor is triggering and getting correct avatar position, seems to be the llLookAt function itself.

//Causes Object to look at nearest Avatar.
default
{
    state_entry()
    {
        llSensorRepeat("", "", AGENT, 50.0, PI, 0.5);
    }
 
    sensor(integer total_number)
    {
        llLookAt( llDetectedPos(0) + <0.0, 0.0, 1.0>, 3.0, 1.0 );
    }
}
No tags attached.
has duplicate 0006888closed  llLookAt 
Issue History
2011-05-18 11:26ebremerNew Issue
2011-05-18 11:26ebremerGit Revision => diva-r15402-b
2011-05-18 11:26ebremerSVN Revision => 0
2011-05-18 11:26ebremerRun Mode => Standalone (Multiple Regions)
2011-05-18 11:26ebremerPhysics Engine => BasicPhysics
2011-05-18 11:26ebremerEnvironment => .NET / Windows64
2011-05-18 11:26ebremerMono Version => None
2011-05-18 11:26ebremerViewer => Second Life 2.6.6 -229662
2011-09-23 18:41justinccNote Added: 0020019
2011-11-13 18:05Digi FlyNote Added: 0020349
2011-11-13 18:06Digi FlyNote Edited: 0020349bug_revision_view_page.php?bugnote_id=20349#r8
2011-11-13 18:06Digi FlyNote Edited: 0020349bug_revision_view_page.php?bugnote_id=20349#r9
2012-05-02 10:47Ferd FredNote Added: 0021350
2012-05-03 08:59cmickeybNote Added: 0021353
2012-05-03 12:05Digi FlyNote Added: 0021355
2013-04-09 00:51tglionNote Added: 0023771
2013-04-09 06:27Richardus RaymakerNote Added: 0023772
2013-04-10 07:12tglionNote Added: 0023774
2013-04-10 10:37cmickeybNote Added: 0023775
2013-04-10 10:38cmickeybAssigned To => Robert Adams
2013-04-10 10:38cmickeybStatusnew => assigned
2015-01-15 15:58justinccRelationship addedhas duplicate 0006888

Notes
(0020019)
justincc   
2011-09-23 18:41   
Does this fail on current development code?
(0020349)
Digi Fly   
2011-11-13 18:05   
(edited on: 2011-11-13 18:06)
I have tested llLookAt, with this script, same as above only lower strength. used it in sl & opensim. SL works fine.
and opensim its a dead cube. no movement at all.

Tested with git: 6b4ae4f30c2091f5f6fa99dfc904cfdd42a266ea [r/17162]

//Causes Object to look at nearest Avatar.
default
{
    state_entry()
    {
        llSensorRepeat("", "", AGENT, 50.0, PI, 0.5);
    }
 
    sensor(integer total_number)
    {
        llLookAt( llDetectedPos(0) + <0.0, 0.0, 1.0>, 1.0, 1.0 );
    }
}

(0021350)
Ferd Fred   
2012-05-02 10:47   
This is a partial fix by using a replacement function:

// This is an OpenSim compatible llLookAt()!
face_target(vector lookat)
{
    rotation rot = llGetRot() * llRotBetween(<0.0 ,0.0 ,1.0 > * llGetRot(), lookat - llGetPos());
    llSetRot(rot);
}
(0021353)
cmickeyb   
2012-05-03 08:59   
Can you tell me what behavior you are seeing and what behavior you think you should see. llLookAt() has been "fixed" multiple times. It does not use physics so it won't behave the same as SL specifically with the strength and dampening parameters.
(0021355)
Digi Fly   
2012-05-03 12:05   
Quick test shows its working normal in opensim parameters :)
But right now i have test it on linux. Think it looks fixt,
only missing phyics :)
(0023771)
tglion   
2013-04-09 00:51   
llLookAt does still not working correct. Whith or without physics,
it rotates often wrongly around z-axsis. Looks like a bit messy.
This is on latest git checkout of dev master.

To reproduce:
Create a rectangle-prim x=0.5m, y=0.4m, z=1.0m , put an eye-texture on the top.
Then put following script into this prim:

default {
    state_entry() {
        llSensorRepeat("", llGetOwner(), AGENT, 96.0, PI, 0.5);
    }

    sensor(integer n) {
        integer i;
        for (i=0; i<n; ++i) {
            vector p1 = llDetectedPos(i);
            llLookAt(p1, 1.0, 1.0);
            return;
        }
    }
}

walking around the object now, compare same on SL and you will see, whats going wrong...
(0023772)
Richardus Raymaker   
2013-04-09 06:27   
opensim 0.7.5 final here.

Just tried the latest example , and saw something strange.
After some manual testing with singularity and imprudence it looks like
the Y axe is broken with rotation. If i use in the viewer the up or down arrow i can only set rotation on the Y axe from 270 -> 0 -> 90 degree.

It dont go round like the other axes from 0-360.
(0023774)
tglion   
2013-04-10 07:12   
Other problems are:
1) the llLookAt don't respect the axis-locking (for eg. if set llSetStatus(STATUS_ROTATE_X, FALSE); in physics-mode).
2) The lookAt on physics objects should look with top of x-axis (like in SL) and not with the top of z-axis of the object.

Tested with PhysicsEngine ODE and Bullet and compared it with SL
(0023775)
cmickeyb   
2013-04-10 10:37   
Just some feedback on this. The current implementation of llLookAt is a complete hack using explicit position updates and (at least used to) "works" for a small number of cases. It doesn't use any physics. Until recently we didn't have any of the machinery necessary to make it work. Some of the recent changes in Bullet might enable a "correct" implementation.

I'll include radams1 in this chain & talk to him about how to get it working with Bullet. If anyone would like to provide some code for the implementation, that would be great. :-)