Get camera position

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Get camera position

by 12Me21 » Sat Sep 01, 2018 18:42

Is there a way to get the player's camera position? Not the value set by set_eye_offset, just the position that is normally 1.625 units above the player location.
I don't want to just hard code it to be 1.625 units, and anyway, it's not always exactly 1.625 because of view bobbing.
 

User avatar
Krock
Developer
 
Posts: 4389
Joined: Thu Oct 03, 2013 07:48
Location: Switzerland
GitHub: SmallJoker

Re: Get camera position

by Krock » Sat Sep 01, 2018 18:55

0.4.x: Hardcode it.
5.0.0-dev: https://github.com/minetest/minetest/bl ... .txt#L5442 -> `player:get_properties().eye_height`
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
 

User avatar
12Me21
Member
 
Posts: 873
Joined: Tue Mar 05, 2013 00:36
Location: (Ignore all of my posts before 2018)
GitHub: 12Me21

Re: Get camera position

by 12Me21 » Mon Sep 24, 2018 21:33

Krock wrote:0.4.x: Hardcode it.
5.0.0-dev: https://github.com/minetest/minetest/bl ... .txt#L5442 -> `player:get_properties().eye_height`


This doesn't take view bobbing (or other camera animations) into account, though.
 

micheal65536
Member
 
Posts: 130
Joined: Mon May 22, 2017 20:27

Re: Get camera position

by micheal65536 » Thu Oct 04, 2018 16:55

12Me21 wrote:
Krock wrote:0.4.x: Hardcode it.
5.0.0-dev: https://github.com/minetest/minetest/bl ... .txt#L5442 -> `player:get_properties().eye_height`


This doesn't take view bobbing (or other camera animations) into account, though.

View bobbing is client-side only, your mod runs server-side (unless you're talking about client-side mods, which I assume you're not because you didn't specify and server-side mods are the "standard" Minetest mods). The server is not aware of view bobbing, and therefore your mod cannot be aware of it.

Perhaps it would be helpful to describe the problem that you're actually trying to solve, and why you need to take view bobbing into account.
 


Return to Modding Discussion



Who is online

Users browsing this forum: MSN [Bot] and 1 guest