1. I, as in my AV, *must* remain stationary, as in not moving with the object.
2. Due to object return constraints, the object must be an attachment.
3. I would "like" to have the normal turn right, turn left, up, down, forward and backward keys "move" the object.
4. The camera needs to either follow **or** be followed by this object, such that the view I see from the camera is as though I was in mouselook mode and "wearing" the object.
5. Using the "camera controls", such as the controls window, or the alt/ctrl-alt functions is "not" viable, due to the fact that it uses "zoom" instead of forward and backward motion, and forward zoom is "limited" to about 1-2 meters in front of my AV, even with constraints turned off. I.e., its not possible to "move" far enough in a forward direction to get where I want to go with the object.
I have attempted to use this test code to do it, but with total lack of success. The most "glaring" problems being that a) the camera doesn't seem to update to the object, even though I am using "its" position, not my AV's, and when if, I can get it to update, its only when the controls are set to "pass through" to the AV, which defeats the entire point of locking them (keeping me stationary), and b) when the test case I codes it tried, it doesn't matter *what* values I use, whether it be <1,0,0>, <0,1,0>, <0,0,1> or even something crazy, like <0,0,50>, the "object" always ends up 1 meter up and left of where it started, in front of my AV. One would think that changing the vector would cause it to move in a different direction....
default
{
on_rez(integer id)
{
llResetScript();
}
state_entry()
{
llSetTexture("5748decc-f629-461c-9a36-a35a221fe21f",ALL_SIDES);
llSetTexture("Fox_Mask_Solid",1);
llRequestPermissions(llGetOwner(),
PERMISSION_TAKE_CONTROLS |
PERMISSION_TRACK_CAMERA |
PERMISSION_CONTROL_CAMERA |
0);
llSetTimerEvent(0.25);
llTakeControls(CONTROL_FWD | CONTROL_BACK | CONTROL_LEFT | CONTROL_RIGHT | CONTROL_ROT_LEFT | CONTROL_ROT_RIGHT | CONTROL_UP | CONTROL_DOWN | 0,TRUE,FALSE);
}
touch_start(integer total_number)
{
llSetTexture("Test_Alpha",ALL_SIDES);
llSetTexture("Fox_Mask_Trans",1);
// Temp, to unlock when things go boom!
// In the final design this will merely make it transparent and cost more CCS
// stamina to sustain than the mask by itself. It will still move the camera with
// it.
llSetCameraParams([CAMERA_ACTIVE, 0]);
}
timer()
{
list getdat = llGetObjectDetails(llGetKey(),[OBJECT_POS , OBJECT_ROT]);
vector vTargetPos = llList2Vector(getdat,0);
rotation rTargetRot = llList2Rot(getdat,1);
// Should set camera to the object location, a little in front, but since ***all***
// attempts to to do that failed, lets just try to use one that "does" work, in
// theory, and test with that.
llSetCameraParams([
CAMERA_ACTIVE, 1,
CAMERA_DISTANCE, 0.0,
CAMERA_BEHINDNESS_ANGLE, 0.1,
CAMERA_BEHINDNESS_LAG, 0.1,
CAMERA_FOCUS, vTargetPos + <0.0, 0.0, 1.0> * rTargetRot,
CAMERA_FOCUS_LAG, 0.0,
CAMERA_FOCUS_THRESHOLD, 0.0,
CAMERA_FOCUS_LOCKED, TRUE,
CAMERA_FOCUS_OFFSET, ZERO_VECTOR,
CAMERA_POSITION, vTargetPos + <-2.0, 0.0, 2.0> * rTargetRot,
CAMERA_POSITION_LAG, 0.1,
CAMERA_POSITION_THRESHOLD, 0.1,
CAMERA_POSITION_LOCKED, TRUE]);
}
control(key id, integer held, integer change)
{
if (held & CONTROL_FWD) //For now, lets just get this thing to move forward...
{
list abc;
abc = llGetObjectDetails(llGetKey(),[OBJECT_POS]);
llSetPos(llList2Vector(abc,0) + <0,1,0>
;}
}
}
BTW. Someone tell SL that *at minimum* a
CODE
tag would be nice, since the auto-unindent that standard forums always do to code makes it, sometimes, nearly unreadable and hard to follow... :(