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

Add model pitch and roll and add API #2251

Closed
Kalabasa opened this issue Feb 2, 2015 · 11 comments
Closed

Add model pitch and roll and add API #2251

Kalabasa opened this issue Feb 2, 2015 · 11 comments
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API

Comments

@Kalabasa
Copy link
Contributor

Kalabasa commented Feb 2, 2015

Issue type
  • Feature request
Add setpitch(radians) and setroll(radians) and the corresponding getters.

We already have get/setyaw(radians) to rotate the model visually. Why not get/setpitch(radians) and get/setroll(radians) too? This gives us complete control on model rotation.

One use case is for spiders that crawl walls and ceilings. The can rotate upside-down or sideways so that they look like they're actually crawling on walls and ceilings.

Another simpler use case is flying entities (arrows rotating in line with their trajectory, bats flying around).

(Wow. It's been 3 years. Updated description to be more accurate.)

@SmallJoker
Copy link
Member

We already have a function to set the pitch:

int ObjectRef::l_set_look_pitch(lua_State *L)

https://github.com/minetest/minetest/blob/master/src/script/lua_api/l_object.cpp#L759

But that doesn't work with Lua entities, there's no variable for that:
https://github.com/minetest/minetest/blob/master/src/content_sao.cpp#L374
https://github.com/minetest/minetest/blob/master/src/player.cpp#L51

@Kalabasa
Copy link
Contributor Author

Kalabasa commented Feb 3, 2015

That's look pitch, not model rotation pitch

@SmallJoker
Copy link
Member

Because model rotation pitch has not been added yet.

@Kalabasa
Copy link
Contributor Author

Kalabasa commented Feb 9, 2015

Oh, that's what I meant. I'm changing the title...

@Kalabasa Kalabasa changed the title Add setpitch(..) to API. Add model pitch rotation. Then setpitch(..) to API. Feb 9, 2015
@paramat paramat added the Feature request Issues that request the addition or enhancement of a feature label Mar 31, 2016
@raymoo
Copy link
Contributor

raymoo commented Jun 21, 2016

Automatic pitch movement like we have with yaw would also be nice to have as an option.

@Kalabasa
Copy link
Contributor Author

That would be excellent for flying units, although the trigonometry involved might get complicated.

@Nyarg
Copy link

Nyarg commented Mar 19, 2017

Half issue is using set_bone_position() - model need have bone of course.
'half' because attached childs isn't inherit root rotation.

This was referenced Sep 14, 2017
@paramat paramat changed the title Add model pitch rotation. Then setpitch(..) to API. Add model pitch and roll and API. Sep 15, 2017
@paramat paramat changed the title Add model pitch and roll and API. Add model pitch and roll and add API. Sep 15, 2017
@paramat paramat changed the title Add model pitch and roll and add API. Add model pitch and roll and add API Sep 15, 2017
@paramat
Copy link
Contributor

paramat commented Apr 8, 2018

Related to #1800

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented May 12, 2018

👍 I also want this. It's an obvious missing feature of entities.

Yaw, pitch and roll should be all settable for entities. It's annoying that you can only rotate entities around one axis, this is too limiting.

Some use cases:

  • Arrows which can pitch up and down while flying (current arrows look hilarious when you shoot up as their pitch never changes)
  • Other ballistic projectiles
  • Rotatable items in item frames
  • Entity-based item frames on floor and ceiling
  • Probably many more

@paramat
Copy link
Contributor

paramat commented May 13, 2018

See experiments in #7323 Thread has good discussion but was a duplicate.

@paramat
Copy link
Contributor

paramat commented Jan 2, 2019

#7395 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Issues that request the addition or enhancement of a feature @ Script API
Projects
None yet
Development

No branches or pull requests

7 participants