NEW LSL llSetAgentRot(float radians );
tracked
dantia Gothly
Currently, we have no way to rotate the avatar. This function would rotate the owner of the script on the Z-axis and would work as an attachment. With this, we can rotate the avatar to the surface normal of a wall, table, or other avatars without the need to use RLV functions that manipulate the camera or having to sit and unsit the avatar. This would allow for things like wall climbing and a host of other useful applications.
rotation RotNormal(vector _normal){
vector vLeft = llVecNorm( _normal % llRot2Fwd(llGetRot()));
vector vFwd = vLeft % _normal;
rotation rRot = llAxes2Rot(vFwd, vLeft, _normal);
return rRot;
}
wall_climb()
{
vector scale = llGetAgentSize(owner);
vector vStart = llGetPos() + <scale.x/2,0,scale.z/2> * llGetRot();
vector vEnd = vStart + <0.25,0,-1.0> * llGetRot();
list CN = llCastRay(vStart, vEnd, [RC_DATA_FLAGS,RC_GET_NORMAL, RC_MAX_HITS, 1]);
float FW_Dist = llVecDist(vStart,llList2Vector(CN, 1) + <scale.x/2,0,0> * RotNormal(llList2Vector(CN, 2)));
/*
Set the position and agent rotation to the surface normal of the detected object.
*/
}
Log In
Signal Linden
tracked
Kadah Coba
For accessibility reasons, the function should not instantly snap the avatar to the new rotation. Sudden view port changes are problematic for many of us.
Otherwise, this functionality is overdue.
Otoa Kiyori
It would be nice if turn speed can also be adjusted with something like "tau" (also with reasonal minimal rotation speed) ... with sudden rotation change, the camera following might switch posittion too fast and... it can shake screeen (if the script with this new function is changing avatar rotation quickly between two different angles). This can be simulated with RLV @setrot function.
dantia Gothly
Otoa Kiyori The way the RLV function hijacks the camra both feels bad and its slow. if you run the function to fast it breaks down. it is also only avalible in those clients that support it only works for some and not other users. The Tau suggestion is a good one and I could see that being useful for easing into the rotation.
Cheshyr Pontchartrain
I'd love to see it, but we had this ability at one point (note the nonfunctional LookAt parameter on map teleports.) One of the Lindens objected that it was a griefer vector and had the feature disabled.
dantia Gothly
Cheshyr Pontchartrain: Using the llTeleportAgent() look-at parameter doesn't work for this type of thing. It brings up the teleport screen, and if the teleport position is the same, it will fail to teleport the agent, as well as causing a whooshing sound effect every time it fires. The usage of this function in this manner is not a reliable or useful workaround for rotating the avatar.
Cheshyr Pontchartrain
dantia Gothly: You misunderstood. I wasn't suggesting the use of llTeleportAgent(). I said that its rotate function doesn't actually work, because one of the Lindens disabled it many years ago. I think I had the wrong function name, though. I meant the original map-based teleport. Not the ones for Experiences.
Vincent Nacon
Yeah, it's kinda strange that LL never provided a way to rotate the avatar outside of animation. Too often had friends asked me if it's possible to rotate their avatars when they're trying to hug each other's or one doing piggy backride or such. This is long overdue.