Entity pitch?
- ZenonSeth
- Member
- Posts: 63
- Joined: Mon Sep 18, 2017 19:23
- GitHub: ZenonSeth
- In-game: ZenonSeth ZenSeth
Entity pitch?
Hi guys, I was experimenting with entities in the past and was left with the impression that we can't set an enetity's pitch angle.
However, just recently when doing some other mods i suddenly realized that the mine-carts actually change angle when ascending/descending slopes. I made sure - and sure enough there's only 1 minecart object - so it must be rotated.
I did look through the mine cart code quickly but couldn't find any obvious references to pitch - so figured I'd post and ask here.
However, just recently when doing some other mods i suddenly realized that the mine-carts actually change angle when ascending/descending slopes. I made sure - and sure enough there's only 1 minecart object - so it must be rotated.
I did look through the mine cart code quickly but couldn't find any obvious references to pitch - so figured I'd post and ask here.
- My Mods -
- Krock
- Developer
- Posts: 4650
- Joined: Thu Oct 03, 2013 07:48
- GitHub: SmallJoker
- Location: Switzerland
- Contact:
Re: Entity pitch?
You're totally correct that there's only one minecart object but its "pitch" change is done by three different animations, which are then used depending on whether the cart drives straight forward, upwards or downwards: code reference
Attached objects can also be rotated, which looks the same as a "pitch" rotate, as used here in boost_cart to tilt the player model slightly, depending on the direction.
A non-ugly pitch/roll function was already requested multiple times, but yet it wasn't added - either nobody cares, knows how it works or it's yet not possible in a nice way using the Irrlicht engine - I don't know.
Attached objects can also be rotated, which looks the same as a "pitch" rotate, as used here in boost_cart to tilt the player model slightly, depending on the direction.
A non-ugly pitch/roll function was already requested multiple times, but yet it wasn't added - either nobody cares, knows how it works or it's yet not possible in a nice way using the Irrlicht engine - I don't know.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>
- ZenonSeth
- Member
- Posts: 63
- Joined: Mon Sep 18, 2017 19:23
- GitHub: ZenonSeth
- In-game: ZenonSeth ZenSeth
Re: Entity pitch?
That makes sense, at least there's kind of a work around.
I haven't found a case where I absolutely needed to make pitch but I was changing how some frames worked to allow rotation and various attachment of the displayed object in it - and wanted to make a tiled/upside-down entity. Doesn't quite seem like I could do that with this, but thanks for the info, good to know
I haven't found a case where I absolutely needed to make pitch but I was changing how some frames worked to allow rotation and various attachment of the displayed object in it - and wanted to make a tiled/upside-down entity. Doesn't quite seem like I could do that with this, but thanks for the info, good to know
- My Mods -
- stu
- Member
- Posts: 923
- Joined: Sat Feb 02, 2013 02:51
- GitHub: stujones11
- Location: United Kingdom
Re: Entity pitch?
There is certainly nothing in Irrlicht that prohibits pitch control, afaik native scene nodes only expose methods for position scale and (Euler) rotation, ie there is no notion of pitch, yaw or roll. Of course you can also manipulate the transform matrix directly and work with quaternions or whatever takes your fancy :)Krock wrote: A non-ugly pitch/roll function was already requested multiple times, but yet it wasn't added - either nobody cares, knows how it works or it's yet not possible in a nice way using the Irrlicht engine - I don't know.
I am really not sure why this has not yet been implement in the MT engine, maybe there was a good reason not to allow that but I think more likely the author did not think it necessary for a voxel game or it was simply an oversight.
One thing to consider is that if MT ever did support non axis-aligned collisions, the inclusion of pitch/roll would make that even more computationally expensive, however, I am not really sure if it would make that big a difference.
Re: Entity pitch?
Is it correct to assume the current way to rotate an attached object is to re-set it with set_attach? So instead of saying "attached_thing:set_yaw(…)" you would say "attached_thing:set_attached(…)"Krock wrote:...
Attached objects can also be rotated, which looks the same as a "pitch" rotate, as used here in boost_cart to tilt the player model slightly, depending on the direction.
Edit: whelp, seems to work okay
But I'm not sure what I've created.
Re: Entity pitch?
Sweet! I'm not sure either but don't look it in the eye!Skulls wrote:But I'm not sure what I've created.
Could you share your code?
Re: Entity pitch?
It is demo/hack/initial proof of concept and not fit for consumption but I tossed it up on GitHub at https://github.com/misterskullz/nb_player_demo, MIT license.
Add the "Tester" tool to the inventory, point at a node and left click to add / remove the attachments, right click a node to start / stop the rotation. You can't see the rotation in 3rd person view due to the attachment update bug but if you spawn another client and connect to localhost the monstrosity can be viewed.
I've got my sever step set to 0.03 and I was toying with the idea of node box based things with animation done in globalstep. I didn't see much CPU or GPU difference with the attachments enabled but this has not been tested at scale (only 6 extra entities) so I'm sure there will be some unknowns, probably a show stopper or two. Even with server step set to 0.03 you can see some jitter in the rotation. No idea what the additional network traffic looks like.
Add the "Tester" tool to the inventory, point at a node and left click to add / remove the attachments, right click a node to start / stop the rotation. You can't see the rotation in 3rd person view due to the attachment update bug but if you spawn another client and connect to localhost the monstrosity can be viewed.
I've got my sever step set to 0.03 and I was toying with the idea of node box based things with animation done in globalstep. I didn't see much CPU or GPU difference with the attachments enabled but this has not been tested at scale (only 6 extra entities) so I'm sure there will be some unknowns, probably a show stopper or two. Even with server step set to 0.03 you can see some jitter in the rotation. No idea what the additional network traffic looks like.
Re: Entity pitch?
Thank you!Skulls wrote:I tossed it up on GitHub at https://github.com/misterskullz/nb_player_demo, MIT license
- sorcerykid
- Member
- Posts: 1847
- Joined: Fri Aug 26, 2016 15:36
- GitHub: sorcerykid
- In-game: Nemo
- Location: Illinois, USA
Re: Entity pitch?
I'm curious what the difference would be if bone rotation was used instead of attachments.
- Festus1965
- Member
- Posts: 4181
- Joined: Sun Jan 03, 2016 11:58
- GitHub: Festus1965
- In-game: Festus1965 Thomas Thailand Explorer
- Location: Thailand ChiangMai
- Contact:
Re: Entity pitch?
I am just sure you cant play a normal piano now right ... haha
so guess girls want to have cycling neck-ledge or sport with hulla hub then ...
so guess girls want to have cycling neck-ledge or sport with hulla hub then ...
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)
If urgend, you find me in Roblox (as CNXThomas)
Who is online
Users browsing this forum: No registered users and 12 guests