josmas / openwonderland

Automatically exported from code.google.com/p/openwonderland
GNU General Public License v2.0
3 stars 5 forks source link

Avatar cannot sit on chairs #260

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
* What steps will reproduce the problem?

Simplified case:
1. Place a floor tile with a chair on it and parented to it
2. Gradually raise the height of the floor tile
3. At 1.2 meters high for the tile sitting works

Real world case:
1. Make 2 meeting rooms with chairs on 2 different floors (different heights)

* What is the expected output? What do you see instead?

Simplified case:
- avatar should be able to sit
- at 1.2 (and above) meters high, the avatar sat underneath the ground

Real world case:
- avatar should be able to sit on any chair from any meeting room, at different 
floors/heights off the ground
- at any time, with testing different heights ("Y") of the floors, the avatar 
can sit on chairs on one floor but not on the other.

What version of the product are you using? On what operating system?
Latest trunks. Ubuntu or Win7 server and client.

Please provide any additional information below.

Original issue reported on code.google.com by michel.m...@gmail.com on 17 Apr 2012 at 6:18

GoogleCodeExporter commented 9 years ago
From Nicole:

The sitting problem has existing for a while or perhaps forever. The problem 
also happens on owf2. What's odd about it is that the avatar always drops down 
to y=0 no matter what's underneath. I tried putting a series of objects under 
the floor. If I walk the avatar off the edge of the highest platform, the 
avatar stops when it reaches the next level. But that doesn't happen when the 
avatar sits. The avatar falls through all the objects. It's almost as if 
there's a y=0 hard-coded in there.... So I guess this is not the result of a 
recent change.

Original comment by jonathan...@gmail.com on 24 Apr 2012 at 9:56

GoogleCodeExporter commented 9 years ago
At Jonathan's suggestion, I tried one more test. I created two platforms below 
y=0. One at y=-3 and one at y=-10. I placed a chair on each platform. Sitting 
worked fine on the higher platform, but when I tried to sit on the lower 
platform, the avatar ended up in a sitting position on the higher level. When I 
raised the higher platform to Y=3, sitting on the lower platform worked 
(although the avatar dropped from high above into the chair) and sitting on the 
higher level didn't work - the avatar fell down to the lower level. I'm now 
fairly convinced that there is a hard-coded value in the sit animation that has 
the avatar go up to about y=1.3 meters and then drop down into the chair. If 
the chair is higher than 1.3 meters, the avatar falls below the chair. If the 
chair is lower than 1.3 meters, the avatar will fall into it unless there is an 
obstacle in the way.

I can't entirely explain why the avatar falls through obstacles above 1.3 
meters, but is stopped by them below 1.3 meters, as in my first test of 
platforms below y=0. There is clearly some interaction with the animation and 
floor following. Or else, perhaps it's as if the avatar is teleported to 1.3 
meters to start the sit animation and thus appears to fall through floors when 
on a platform higher than 1.3 meters above 0. 

Original comment by nicole.m...@gmail.com on 25 Apr 2012 at 1:40

GoogleCodeExporter commented 9 years ago
I did a quick skim through the code, and found two points of interest:

#1) the height of the chair object is always zero:

http://code.google.com/p/openwonderland-modules/source/browse/trunk/0.5/stable/s
ittingComponent/src/classes/org/jdesktop/wonderland/modules/sitting/client/Sitti
ngCellComponent.java#180

#2) at the end of sitting, the GoSit command resets the avatar's position based 
on the goal position (which was the chair, which had a goal position of zero):

http://code.google.com/p/openwonderland-avatars/source/browse/trunk/src/imi/char
acter/behavior/GoSit.java#178

So my theory is that if the chair's height were correct, the avatar wouldn't 
fall through the floor.

Original comment by jonathan...@gmail.com on 25 Apr 2012 at 7:35

GoogleCodeExporter commented 9 years ago
can you try it Jonathan ? It would help my customer (and I) a lot   :-) 
-michel

Original comment by michel.m...@gmail.com on 25 Apr 2012 at 7:48

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r4840.

Original comment by jonathan...@gmail.com on 30 Apr 2012 at 9:47