Eye offset of attached player - rotation

Post Reply
SFENCE
Member
Posts: 274
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Eye offset of attached player - rotation

by SFENCE » Post

I have trouble with the eye offset of the player, which is attached to another object in the case, that this object rotates on all axis.

Code: Select all

  player:set_attach(self.object, "", {x = 0, y = 14, z = 4}, {x = -90, y = 0, z = 0})
  player:set_eye_offset({x = 0, y = 0, z = 0})
  player:set_look_vertical(-math.pi/2)
  player:set_look_horizontal(1.75*math.pi)
When I use pitch rotation, the player is shown in the right place, but eye offsets look to be unaffected by rotation, so the eye starts to rotate around some point, probably 0, 0, 0, and go under the seat, to of the object, the player is attached to.
Is there some way to fix this?
Spoiler
Image
Image
Attachments
screenshot_20210703_110307.png
screenshot_20210703_110307.png (89.06 KiB) Viewed 570 times
screenshot_20210703_110331.png
screenshot_20210703_110331.png (136.59 KiB) Viewed 570 times
cdb_3P0AYqjEIn68

User avatar
Gael de Sailly
Member
Posts: 845
Joined: Sun Jan 26, 2014 17:01
GitHub: gaelysam
IRC: Gael-de-Sailly
In-game: Gael-de-Sailly gaelysam
Location: Voiron, France

Re: Eye offset of attached player - rotation

by Gael de Sailly » Post

I'm having the same problem while trying to fix issues in TfL_S7 train mod by Mainote.

It seems that the eye offset vector is relative to the center of the object instead of the position where the player is drawn, and the vector rotates with the yaw. This leads to the camera going off the train when looking on the sides.
Did you solve your issue since July? I think the problem is on Minetest's side, but I'm asking just in case you found something.
Just realize how bored we would be if the world was perfect.

SFENCE
Member
Posts: 274
Joined: Sun Sep 29, 2019 07:13
GitHub: SFENCE
In-game: SFENCE

Re: Eye offset of attached player - rotation

by SFENCE » Post

Gael de Sailly wrote:
Thu Dec 30, 2021 14:34
I'm having the same problem while trying to fix issues in TfL_S7 train mod by Mainote.

It seems that the eye offset vector is relative to the center of the object instead of the position where the player is drawn, and the vector rotates with the yaw. This leads to the camera going off the train when looking on the sides.
Did you solve your issue since July? I think the problem is on Minetest's side, but I'm asking just in case you found something.
So, it looks like Minetest client-side problem.
Thanks for the answer.
cdb_3P0AYqjEIn68

User avatar
Blockhead
Member
Posts: 1602
Joined: Wed Jul 17, 2019 10:14
GitHub: Montandalar
IRC: Blockhead256
In-game: Blockhead Blockhead256
Location: Land Down Under
Contact:

Re: Eye offset of attached player - rotation

by Blockhead » Post

Gael de Sailly wrote:
Thu Dec 30, 2021 14:34
I'm having the same problem while trying to fix issues in TfL_S7 train mod by Mainote.

It seems that the eye offset vector is relative to the center of the object instead of the position where the player is drawn, and the vector rotates with the yaw. This leads to the camera going off the train when looking on the sides.
Did you solve your issue since July? I think the problem is on Minetest's side, but I'm asking just in case you found something.
The main problem with the train mods is that the entity selection box doesn't rotate with the entity. So if it's longer than it is wide, it may be super easy to escape the train when travelling along one axis, but really hard on the other axis. The only real solution is to fix the engine I think..
/˳˳_˳˳]_[˳˳_˳˳]_[˳˳_˳˳\ Advtrains enthusiast | My map: Noah's Railyard | My Content on ContentDB ✝️♂

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests