viewer#2113 Optional disable eyes/head follow cursor/lookat
Intended for photography, but there is curently no nice way to present it so it's in debug options until we get some critical mass of features that can be collected into a single whole.master
parent
817bc25b27
commit
ed6148d6c6
|
|
@ -14218,6 +14218,17 @@
|
|||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>DisableLookAtAnimation</key>
|
||||
<map>
|
||||
<key>Comment</key>
|
||||
<string>Avatar follows cursor with avatars eyes, when disabled, avatar will look forward</string>
|
||||
<key>Persist</key>
|
||||
<integer>0</integer>
|
||||
<key>Type</key>
|
||||
<string>Boolean</string>
|
||||
<key>Value</key>
|
||||
<integer>0</integer>
|
||||
</map>
|
||||
<key>WebProfileFloaterRect</key>
|
||||
<map>
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@
|
|||
#include "llvoavatar.h"
|
||||
#include "lldrawable.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llrendersphere.h"
|
||||
#include "llselectmgr.h"
|
||||
#include "llglheaders.h"
|
||||
|
|
@ -561,8 +562,16 @@ void LLHUDEffectLookAt::update()
|
|||
{
|
||||
if (calcTargetPosition())
|
||||
{
|
||||
static LLCachedControl<bool> disable_look_at(gSavedSettings, "DisableLookAtAnimation", true);
|
||||
LLMotion* head_motion = ((LLVOAvatar*)(LLViewerObject*)mSourceObject)->findMotion(ANIM_AGENT_HEAD_ROT);
|
||||
if (!head_motion || head_motion->isStopped())
|
||||
if (disable_look_at())
|
||||
{
|
||||
if (head_motion)
|
||||
{
|
||||
((LLVOAvatar*)(LLViewerObject*)mSourceObject)->stopMotion(ANIM_AGENT_HEAD_ROT);
|
||||
}
|
||||
}
|
||||
else if (!head_motion || head_motion->isStopped())
|
||||
{
|
||||
((LLVOAvatar*)(LLViewerObject*)mSourceObject)->startMotion(ANIM_AGENT_HEAD_ROT);
|
||||
}
|
||||
|
|
@ -665,7 +674,15 @@ bool LLHUDEffectLookAt::calcTargetPosition()
|
|||
if (!mTargetPos.isFinite())
|
||||
return false;
|
||||
|
||||
source_avatar->setAnimationData("LookAtPoint", (void *)&mTargetPos);
|
||||
static LLCachedControl<bool> disable_look_at(gSavedSettings, "DisableLookAtAnimation", true);
|
||||
if (disable_look_at())
|
||||
{
|
||||
source_avatar->removeAnimationData("LookAtPoint");
|
||||
}
|
||||
else
|
||||
{
|
||||
source_avatar->setAnimationData("LookAtPoint", (void*)&mTargetPos);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3966,6 +3966,16 @@ function="World.EnvPreset"
|
|||
function="ToggleControl"
|
||||
parameter="AllowSelectAvatar" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Disable Look At Animation"
|
||||
name="Disable Look At Animation">
|
||||
<menu_item_check.on_check
|
||||
function="CheckControl"
|
||||
parameter="DisableLookAtAnimation" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="DisableLookAtAnimation" />
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Render Only Friends"
|
||||
name="Render Only Friends">
|
||||
|
|
|
|||
Loading…
Reference in New Issue