Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with numbered seats (design flaw) #29

Open
HowardBaxton opened this issue Apr 3, 2019 · 3 comments
Open

Issue with numbered seats (design flaw) #29

HowardBaxton opened this issue Apr 3, 2019 · 3 comments

Comments

@HowardBaxton
Copy link
Contributor

All works well if the numbered seats are used, the problem arises if the numbered seats are not used and new sitters click the root prim to sit. Here's what happens:

The first sitter will sit as usual and uses the root prims sit target (link number 1).

The second sitter is assigned to the sit target in link number 2. All is well if link number 2 prim is not numbered or is numbered for seat 2. However if this linked prim is using numbered seats and this particular prim with link number 2 is using seat 3, then the sitter will be assigned to seat 3.

The third sitter is assigned to the sit target in link number 3. Same story as with the second sitter. It can work or it will be messed up depending on the seat numbering.

((The same issue occurs in SL and on OS where it was discovered.))

@LeonaMorro
Copy link
Member

But is there something that we could do to change this?
I (currently) don't think so, because it is SL who places the Avatar on the sit target. If I want to sit on an occupied Root Prim SL places me on the next free sitTarget and that may be a prim with a seat number. We are not able to distinguish between an avatar that has clicked on the occupied root prim and is placed by SL onto a child prims sit target or an avatar who clicked the child prim and correctlly seated there. And if the child Prim has a seat number nPose have to respect it, otherwise numberd seats will not work.

@HowardBaxton
Copy link
Contributor Author

Is it possible to distinguish which prim is touched? This would be the only alternative I can think of to determine where the new sitter intended to sit. Also a thought, if we could possibly use llDetectedTouchST to determine where the sitter intended to sit on a single prim build.

I find this discovery very enlightening as I've always assumed that the sit target played a roll in sitting a new sitter. In fact there is a sit engine that changes the sit target position to the existing seat position when a new sitter sits (I assume a smoother sit experience). However, I have also seen where many new sitters can successfully sit a single mesh prim if the physics layer of the mesh is set up correctly.

@LeonaMorro
Copy link
Member

Is it possible to distinguish which prim is touched?

No, there isn't anything that fires before the sitting is completed and only the change event that fires after.

In fact there is a sit engine that changes the sit target position to the existing seat position when a new sitter sits

yes it could be smoother for a new sitter. In nPose a new sitter "jumps" to the next free sitTarget but the sitTarget is not at the final sitting position, so there is a second "jump" when the avatar is moved to his final position (by nPose). This second "jump" could be removed (reduced) if the sitTarget is at (or near) the final position. But of course we can not remove this second "jump" if ther are more sitters than sitTarget.

I've always assumed that the sit target played a roll in sitting a new sitter

This is my view of how sitting works in SL. It is a "model" gathered from different sources in the internet as well as different observations I made. It may be completly wrong.

if (the prim that is clicked on has a sit target && that sit target is not full) {
	the prims sit target is used;
}
else if(one or more other linked prims have sit targets that are not full) {
	the sit target of the prim with the lowest link number will be used
}
// if we are not seated until now, sitting may fail. With nPose this can only happen if we have more sitters than prims.
else {
	fire a beam from the camera location towards the mouse pointer
	//if your object has a weird physical shape that don't match roughly the visual shape, the intersection may occour with an other object (behind yours)
	if(the beam intersects a physical shape) {
		if(the intersection is too far away) {
			sitting failed
		}
		else {
			// if you (or the object you wish to sit on) is inside a physical shape of another object (phantom or not)
			// the beam intersects this physical shape and SL tries to sit you on this object (which very often fails) (Mega Prim Sim Surroundings ....)
			the point where the beam intersects the physical shape is the point we want to sit
			evaluate the surrounding of this point
			if(the point is not "near" an edge) {
				sitting failed
			}
			else {
				try to place the point "near" to the edge in a way that the normal vector of face beneath is pointing roughly upwards
				//if your object has a weird physical shape it may happen that there isn't such a point
				if(failed) {
					sitting failed
				}
				else {
					check if there is some physical shape above the point
					if(yes) {
						sitting failed
					}
					else {
						do some other stuff (I don't know)
						if(failed) {
							sitting failed
						}
						else {
							get the prim that is marked with the point and link the avatar to it
							sitting success
						}
					}
				}
			}
		}
	}
	else {
		sitting failed
	}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants